@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,307 @@
1
+ import { rTrim, $ajax, stringFormat } from './utils.js';
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var JSON_CONTENT_TYPE = "application/json; charset=UTF-8";
20
+ var URLENCODED_CONTENT_TYPE = "application/x-www-form-urlencoded; charset=UTF-8";
21
+ var HTTP_GET = "GET";
22
+ var HTTP_POST = "POST";
23
+ var HTTP_DELETE = "DELETE";
24
+ var defaultOptions = {};
25
+ function getHeaders(authorizationToken) {
26
+ const headers = {
27
+ "Accept": "application/json, text/javascript, */*; q=0.01"
28
+ };
29
+ if (authorizationToken) {
30
+ headers["Authorization"] = "Bearer " + authorizationToken;
31
+ }
32
+ return headers;
33
+ }
34
+ function ServiceClient(options) {
35
+ options = $.extend({}, defaultOptions, options);
36
+ var baseUrl = rTrim(options.serviceUrl || options.baseUrl, "\\/");
37
+ var loginPromise;
38
+ var _ajax = $ajax;
39
+ function validateClientID(clientID) {
40
+ if (!clientID) {
41
+ throw "Invalid clientID";
42
+ }
43
+ }
44
+ function urlFromTemplate(template, args) {
45
+ args = $.extend({}, { baseUrl }, args);
46
+ return stringFormat(template, args);
47
+ }
48
+ function login() {
49
+ if (!loginPromise) {
50
+ var loginInfo = options.loginInfo;
51
+ if (loginInfo && loginInfo.url && (loginInfo.username || loginInfo.password)) {
52
+ const endPoint = loginInfo.url;
53
+ loginPromise = _ajax(endPoint, {
54
+ method: HTTP_POST,
55
+ data: {
56
+ grant_type: "password",
57
+ username: loginInfo.username,
58
+ password: loginInfo.password
59
+ },
60
+ dataType: "json",
61
+ contentType: URLENCODED_CONTENT_TYPE
62
+ }).then(function(result) {
63
+ return result.access_token;
64
+ });
65
+ } else {
66
+ loginPromise = Promise.resolve();
67
+ }
68
+ }
69
+ return loginPromise;
70
+ }
71
+ return {
72
+ _urlFromTemplate: urlFromTemplate,
73
+ registerClient: function(settings) {
74
+ const endPoint = `${baseUrl}/clients`;
75
+ return login().then(function(authorizationToken) {
76
+ return _ajax(endPoint, __spreadValues({
77
+ headers: getHeaders(authorizationToken),
78
+ method: HTTP_POST,
79
+ dataType: "json",
80
+ // Used to avoid Chrome caching functionality for simple async requests
81
+ // when the first request is not completed the second request is not send
82
+ // and the same response is used for both of the request. In this case the
83
+ // second client is not registered to the service and the same clientId is used.
84
+ data: JSON.stringify({ timeStamp: Date.now() })
85
+ }, settings));
86
+ }).then(function(clientData) {
87
+ if (clientData.Message) {
88
+ throw clientData.Message;
89
+ }
90
+ return clientData.clientId;
91
+ });
92
+ },
93
+ unregisterClient: function(clientID, settings) {
94
+ validateClientID(clientID);
95
+ const endPoint = `${baseUrl}/clients/${clientID}`;
96
+ return login().then(function(authorizationToken) {
97
+ return _ajax(endPoint, __spreadValues({
98
+ headers: getHeaders(authorizationToken),
99
+ method: HTTP_DELETE
100
+ }, settings));
101
+ });
102
+ },
103
+ getParameters: function(clientID, report, parameterValues, settings) {
104
+ validateClientID(clientID);
105
+ const endPoint = `${baseUrl}/clients/${clientID}/parameters`;
106
+ return login().then(function(authorizationToken) {
107
+ return _ajax(endPoint, __spreadValues({
108
+ headers: getHeaders(authorizationToken),
109
+ method: HTTP_POST,
110
+ contentType: JSON_CONTENT_TYPE,
111
+ dataType: "json",
112
+ data: JSON.stringify({ report, parameterValues })
113
+ }, settings));
114
+ });
115
+ },
116
+ createReportInstance: function(clientID, report, parameterValues, settings) {
117
+ validateClientID(clientID);
118
+ const endPoint = `${baseUrl}/clients/${clientID}/instances`;
119
+ return login().then(function(authorizationToken) {
120
+ return _ajax(endPoint, __spreadValues({
121
+ headers: getHeaders(authorizationToken),
122
+ method: HTTP_POST,
123
+ contentType: JSON_CONTENT_TYPE,
124
+ dataType: "json",
125
+ data: JSON.stringify({ report, parameterValues })
126
+ }, settings));
127
+ }).then(function(instanceData) {
128
+ return instanceData.instanceId;
129
+ });
130
+ },
131
+ deleteReportInstance: function(clientID, instanceID, settings) {
132
+ validateClientID(clientID);
133
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}`;
134
+ return login().then(function(authorizationToken) {
135
+ return _ajax(endPoint, __spreadValues({
136
+ headers: getHeaders(authorizationToken),
137
+ method: HTTP_DELETE
138
+ }, settings));
139
+ });
140
+ },
141
+ // eslint-disable-next-line max-params
142
+ createReportDocument: function(clientID, instanceID, format, deviceInfo, useCache, baseDocumentID, actionID, settings) {
143
+ validateClientID(clientID);
144
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents`;
145
+ return login().then(function(authorizationToken) {
146
+ deviceInfo = deviceInfo || {};
147
+ deviceInfo["BasePath"] = baseUrl;
148
+ return _ajax(endPoint, __spreadValues({
149
+ headers: getHeaders(authorizationToken),
150
+ method: HTTP_POST,
151
+ contentType: JSON_CONTENT_TYPE,
152
+ dataType: "json",
153
+ data: JSON.stringify({
154
+ format,
155
+ deviceInfo,
156
+ useCache,
157
+ baseDocumentID,
158
+ actionID
159
+ })
160
+ }, settings));
161
+ }).then(function(documentData) {
162
+ return documentData.documentId;
163
+ });
164
+ },
165
+ // eslint-disable-next-line max-params
166
+ sendDocument: function(clientID, instanceID, documentID, mailArgs, settings) {
167
+ validateClientID(clientID);
168
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}/send`;
169
+ return login().then(function(authorizationToken) {
170
+ return _ajax(endPoint, __spreadValues({
171
+ headers: getHeaders(authorizationToken),
172
+ method: HTTP_POST,
173
+ contentType: JSON_CONTENT_TYPE,
174
+ data: JSON.stringify({
175
+ from: mailArgs.from,
176
+ to: mailArgs.to,
177
+ cc: mailArgs.cc,
178
+ subject: mailArgs.subject,
179
+ body: mailArgs.body
180
+ })
181
+ }, settings));
182
+ });
183
+ },
184
+ deleteReportDocument: function(clientID, instanceID, documentID, settings) {
185
+ validateClientID(clientID);
186
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}`;
187
+ return login().then(function(authorizationToken) {
188
+ return _ajax(endPoint, __spreadValues({
189
+ headers: getHeaders(authorizationToken),
190
+ method: HTTP_DELETE
191
+ }, settings));
192
+ });
193
+ },
194
+ getDocumentInfo: function(clientID, instanceID, documentID, settings) {
195
+ validateClientID(clientID);
196
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}/info`;
197
+ return login().then(function(authorizationToken) {
198
+ return _ajax(endPoint, __spreadValues({
199
+ headers: getHeaders(authorizationToken),
200
+ method: HTTP_GET,
201
+ dataType: "json"
202
+ }, settings));
203
+ });
204
+ },
205
+ // eslint-disable-next-line max-params
206
+ getPage: function(clientID, instanceID, documentID, pageNumber, settings) {
207
+ validateClientID(clientID);
208
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}/pages/${pageNumber}`;
209
+ return login().then(function(authorizationToken) {
210
+ return _ajax(endPoint, __spreadValues({
211
+ headers: getHeaders(authorizationToken),
212
+ method: HTTP_GET,
213
+ dataType: "json"
214
+ }, settings));
215
+ });
216
+ },
217
+ get: function(url) {
218
+ return _ajax(url, {
219
+ method: HTTP_GET
220
+ });
221
+ },
222
+ formatDocumentUrl: function(clientID, instanceID, documentID, queryString) {
223
+ var url = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}`;
224
+ if (queryString) {
225
+ url += "?" + queryString;
226
+ }
227
+ return url;
228
+ },
229
+ getDocumentFormats: function(settings) {
230
+ const endPoint = `${baseUrl}/formats`;
231
+ return login().then(function(authorizationToken) {
232
+ return _ajax(endPoint, __spreadValues({
233
+ headers: getHeaders(authorizationToken),
234
+ method: HTTP_GET,
235
+ dataType: "json"
236
+ }, settings));
237
+ });
238
+ },
239
+ getServiceVersion: function(settings) {
240
+ const endPoint = `${baseUrl}/version`;
241
+ return login().then(function(authorizationToken) {
242
+ return _ajax(endPoint, __spreadValues({
243
+ headers: getHeaders(authorizationToken),
244
+ method: HTTP_GET,
245
+ dataType: "json"
246
+ }, settings));
247
+ });
248
+ },
249
+ // eslint-disable-next-line max-params
250
+ getResource: function(clientID, instanceID, documentID, resourceID, settings) {
251
+ validateClientID(clientID);
252
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}/resources/${resourceID}`;
253
+ return login().then(function(authorizationToken) {
254
+ return _ajax(endPoint, __spreadValues({
255
+ headers: getHeaders(authorizationToken),
256
+ method: HTTP_GET,
257
+ dataType: (settings == null ? void 0 : settings.dataType) || "json"
258
+ }, settings));
259
+ });
260
+ },
261
+ // eslint-disable-next-line max-params
262
+ getSearchResults: function(clientID, instanceID, documentID, searchToken, matchCase, matchWholeWord, useRegex, settings) {
263
+ validateClientID(clientID);
264
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}/search`;
265
+ return login().then(function(authorizationToken) {
266
+ return _ajax(endPoint, __spreadValues({
267
+ headers: getHeaders(authorizationToken),
268
+ method: HTTP_POST,
269
+ contentType: JSON_CONTENT_TYPE,
270
+ dataType: "json",
271
+ data: JSON.stringify({
272
+ searchToken,
273
+ matchCase,
274
+ matchWholeWord,
275
+ useRegularExpressions: useRegex
276
+ })
277
+ }, settings));
278
+ });
279
+ },
280
+ setAccessToken: function(accessToken) {
281
+ loginPromise = Promise.resolve(accessToken);
282
+ },
283
+ login,
284
+ keepClientAlive: function(clientID, settings) {
285
+ const endPoint = `${baseUrl}/clients/keepAlive/${clientID}`;
286
+ return login().then(function(authorizationToken) {
287
+ return _ajax(endPoint, __spreadValues({
288
+ headers: getHeaders(authorizationToken),
289
+ method: HTTP_POST
290
+ }, settings));
291
+ });
292
+ },
293
+ getClientsSessionTimeoutSeconds: function(settings) {
294
+ const endPoint = `${baseUrl}/clients/sessionTimeout`;
295
+ return login().then(function(authorizationToken) {
296
+ return _ajax(endPoint, __spreadValues({
297
+ headers: getHeaders(authorizationToken),
298
+ method: HTTP_GET
299
+ }, settings));
300
+ }).then(function(sessionTimeoutData) {
301
+ return sessionTimeoutData.clientSessionTimeout;
302
+ });
303
+ }
304
+ };
305
+ }
306
+
307
+ export { ServiceClient };
@@ -0,0 +1,212 @@
1
+ import { stringFormat } from './utils.js';
2
+ import { stringResources } from './stringResources.js';
3
+
4
+ function SideMenu(dom, rootOptions, otherOptions) {
5
+ var options = $.extend({}, rootOptions, otherOptions);
6
+ var menu = $(dom).data("kendoMenu");
7
+ var enableAccessibility = options.enableAccessibility;
8
+ var DEFAULT_TABINDEX = 3;
9
+ var panelBar;
10
+ var sideMenuVisible = false;
11
+ var controller = options.controller;
12
+ if (!controller) {
13
+ throw "No controller (telerikReporting.ReportViewerController) has been specified.";
14
+ }
15
+ if (!menu) {
16
+ init(dom);
17
+ }
18
+ function init(root) {
19
+ var $root = $(root);
20
+ try {
21
+ panelBar = $root.children("ul").kendoPanelBar().data("kendoPanelBar");
22
+ } catch (e) {
23
+ console.error("Instantiation of Kendo PanelBar as side menu threw an exception", e);
24
+ throw e;
25
+ }
26
+ panelBar.bind("expand", onSubmenuOpen);
27
+ panelBar.element.off("keydown", onPanelKeyDown);
28
+ panelBar.element.on("keydown", onPanelKeyDown);
29
+ setTabIndexes($root);
30
+ enableCloseOnClick($root);
31
+ $root.click(function(e) {
32
+ if (e.target == root) {
33
+ controller.setSideMenuVisible({ visible: !sideMenuVisible });
34
+ }
35
+ });
36
+ replaceStringResources();
37
+ }
38
+ controller.setSideMenuVisible(function(event, args) {
39
+ setSideMenuVisibility();
40
+ if (enableAccessibility) {
41
+ panelBar.element.focus();
42
+ }
43
+ sideMenuVisible = args.visible;
44
+ if (!sideMenuVisible) {
45
+ panelBar.collapse($("#trv-side-menu-export-command"));
46
+ }
47
+ }).getSideMenuVisible(function(event, args) {
48
+ args.visible = sideMenuVisible;
49
+ });
50
+ function setSideMenuVisibility() {
51
+ var $root = panelBar.element.parent();
52
+ var hidden = $root.position().left < 0 || !$root.is(":visible");
53
+ if (hidden) {
54
+ $root.show();
55
+ } else {
56
+ window.setTimeout(function() {
57
+ $root.hide();
58
+ }, 500);
59
+ }
60
+ }
61
+ function onSubmenuOpen(e) {
62
+ var $item = $(e.item);
63
+ panelBar.unbind("expand", onSubmenuOpen);
64
+ panelBar.append({ text: stringResources.loadingFormats, spriteCssClass: "k-icon k-loading" }, $item);
65
+ options.controller.getDocumentFormats().then(fillFormats).then(function() {
66
+ panelBar.expand($item);
67
+ }).then(function() {
68
+ panelBar.bind("expand", onSubmenuOpen);
69
+ });
70
+ }
71
+ function fillFormats(formats) {
72
+ Array.from($(dom).find("ul[data-command-list=export-format-list]")).forEach((list) => {
73
+ var $list = $(list);
74
+ var $parent = $list.parents("li");
75
+ var tabIndex = $parent.attr("tabindex");
76
+ if (!tabIndex) {
77
+ tabIndex = DEFAULT_TABINDEX;
78
+ }
79
+ $list.empty();
80
+ Array.from(formats).forEach((format) => {
81
+ var ariaLabel = enableAccessibility ? stringFormat('aria-label="{localizedName}" ', format) : " ";
82
+ 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);
83
+ panelBar.append(li, $parent);
84
+ });
85
+ setListItemsTabIndex($parent.find("li"), tabIndex);
86
+ enableCloseOnClick($parent);
87
+ });
88
+ }
89
+ function enableCloseOnClick(root) {
90
+ Array.from(root.find("li")).forEach((listItem) => {
91
+ var isLeaf = $(listItem).children("ul").length === 0;
92
+ if (isLeaf) {
93
+ $(listItem).children("a").on("click", (event) => {
94
+ controller.setSideMenuVisible({ visible: !sideMenuVisible });
95
+ });
96
+ }
97
+ });
98
+ }
99
+ function setTabIndexes(root) {
100
+ if (!root) {
101
+ return;
102
+ }
103
+ var $list = root.children("ul");
104
+ var parentTabIndex = root.attr("tabindex");
105
+ var listIndex = parentTabIndex ? parentTabIndex : DEFAULT_TABINDEX;
106
+ setListItemsTabIndex($list, listIndex);
107
+ }
108
+ function setListItemsTabIndex(list, tabIndex) {
109
+ list.attr("tabindex", tabIndex);
110
+ var items = list.find("li");
111
+ Array.from(items).forEach((item) => {
112
+ var $item = $(item);
113
+ $item.attr("tabindex", tabIndex);
114
+ var anchor = $item.children("a");
115
+ if (anchor.length > 0) {
116
+ var $anchor = $(anchor);
117
+ $anchor.attr("tabindex", -1);
118
+ }
119
+ $item.on("focus", (event) => {
120
+ var anchor2 = $item.children("a");
121
+ if (anchor2.length > 0) {
122
+ anchor2.addClass("k-focus");
123
+ }
124
+ });
125
+ $item.on("blur", (event) => {
126
+ var anchor2 = $item.children("a");
127
+ if (anchor2.length > 0) {
128
+ anchor2.removeClass("k-focus");
129
+ }
130
+ });
131
+ $item.off("keydown", onItemKeyDown);
132
+ $item.on("keydown", onItemKeyDown);
133
+ });
134
+ }
135
+ function onPanelKeyDown(e) {
136
+ if (e.which == kendo.keys.ENTER) {
137
+ var $item;
138
+ var isSelectedFocusedItem = false;
139
+ var focusedItem = document.activeElement;
140
+ if (focusedItem && focusedItem.localName == "li") {
141
+ var items = panelBar.element.find("li.k-item");
142
+ for (var i = 0; i < items.length; i++) {
143
+ var listItem = items[i];
144
+ if (focusedItem === listItem) {
145
+ $item = $(listItem);
146
+ isSelectedFocusedItem = true;
147
+ break;
148
+ }
149
+ }
150
+ } else {
151
+ $item = panelBar.select();
152
+ }
153
+ if (!$item || !$item.length > 0) {
154
+ return;
155
+ }
156
+ handleItemSelect($item, isSelectedFocusedItem);
157
+ }
158
+ }
159
+ function onItemKeyDown(e) {
160
+ if (e.which == kendo.keys.ENTER) {
161
+ handleItemSelect($(e.target), false);
162
+ }
163
+ }
164
+ function handleItemSelect(item, handleExpandCollapse) {
165
+ if (!item.length > 0) {
166
+ return;
167
+ }
168
+ var isLeaf = item.children("ul").length === 0;
169
+ if (!isLeaf) {
170
+ if (handleExpandCollapse) {
171
+ if (item.hasClass("k-active")) {
172
+ panelBar.collapse(item);
173
+ } else {
174
+ panelBar.expand(item);
175
+ }
176
+ }
177
+ } else {
178
+ var $anchor = item.find("a");
179
+ if ($anchor.length > 0) {
180
+ $anchor[0].click();
181
+ }
182
+ }
183
+ }
184
+ function replaceStringResources() {
185
+ var menuAreas = findMenuArea();
186
+ if (!menuAreas) {
187
+ return;
188
+ }
189
+ Array.from(menuAreas).forEach((menu2) => {
190
+ var $menu = $(menu2);
191
+ var menuItems = $menu.children("li.k-panelbar-header");
192
+ $menu.attr("aria-label", stringResources[$menu.attr("aria-label")]);
193
+ Array.from(menuItems).forEach((menuItem) => {
194
+ var $menuItem = $(menuItem);
195
+ var $a = $menuItem.find("a");
196
+ $menuItem.attr("aria-label", stringResources[$menuItem.attr("aria-label")]);
197
+ if ($a) {
198
+ var $span = $a.find("span:not(.k-icon)");
199
+ $a.attr("title", stringResources[$a.attr("title")]);
200
+ if ($span) {
201
+ $span.text(stringResources[$span.text()]);
202
+ }
203
+ }
204
+ });
205
+ });
206
+ }
207
+ function findMenuArea() {
208
+ return $("div[data-role=telerik_ReportViewer_SideMenu] > ul");
209
+ }
210
+ }
211
+
212
+ export { SideMenu };
package/dist/es/sr.js ADDED
@@ -0,0 +1,162 @@
1
+ var _a;
2
+ var sr = {
3
+ // warning and error string resources
4
+ controllerNotInitialized: "Controller is not initialized.",
5
+ noReportInstance: "No report instance.",
6
+ missingTemplate: "!obsolete resource!",
7
+ noReport: "No report.",
8
+ noReportDocument: "No report document.",
9
+ missingOrInvalidParameter: "There are missing or invalid parameter values. Please input valid data for the following parameters:\n",
10
+ invalidParameter: "Please input a valid value.",
11
+ invalidDateTimeValue: "Please input a valid date.",
12
+ parameterIsEmpty: "Parameter value cannot be empty.",
13
+ cannotValidateType: "Cannot validate parameter of type {type}.",
14
+ loadingFormats: "Loading...",
15
+ loadingReport: "Loading report...",
16
+ preparingDownload: "Preparing document to download. Please wait...",
17
+ preparingPrint: "Preparing document to print. Please wait...",
18
+ errorLoadingTemplates: "Error loading the report viewer's templates. (templateUrl = '{0}').",
19
+ errorServiceUrl: "Cannot access the Reporting REST service. (serviceUrl = '{0}'). Make sure the service address is correct and enable CORS if needed. (https://enable-cors.org)",
20
+ errorServiceVersion: "The version of the Report Viewer '{1}' does not match the version of the Reporting REST Service '{0}'. Please make sure both are running same version.",
21
+ loadingReportPagesInProgress: "{0} pages loaded so far...",
22
+ loadedReportPagesComplete: "Done. Total {0} pages loaded.",
23
+ noPageToDisplay: "No page to display.",
24
+ errorDeletingReportInstance: "Error deleting report instance: '{0}'.",
25
+ errorRegisteringViewer: "Error registering the viewer with the service.",
26
+ noServiceClient: "No serviceClient has been specified for this controller.",
27
+ errorRegisteringClientInstance: "Error registering client instance.",
28
+ errorCreatingReportInstance: "Error creating report instance (Report = '{0}').",
29
+ errorCreatingReportDocument: "Error creating report document (Report = '{0}'; Format = '{1}').",
30
+ unableToGetReportParameters: "Unable to get report parameters.",
31
+ errorObtainingAuthenticationToken: "Error obtaining authentication token.",
32
+ clientExpired: "Click 'Refresh' to restore client session.",
33
+ promisesChainStopError: "Error shown. Throwing promises chain stop error.",
34
+ renderingCanceled: "Report processing was canceled.",
35
+ tryReportPreview: "The report may now be previewed.",
36
+ // viewer template string resources
37
+ parameterEditorSelectNone: "clear selection",
38
+ parameterEditorSelectAll: "select all",
39
+ parametersAreaPreviewButton: "Preview",
40
+ menuNavigateBackwardText: "Navigate Backward",
41
+ menuNavigateBackwardTitle: "Navigate Backward",
42
+ menuNavigateForwardText: "Navigate Forward",
43
+ menuNavigateForwardTitle: "Navigate Forward",
44
+ menuStopRenderingText: "Stop Rendering",
45
+ menuStopRenderingTitle: "Stop Rendering",
46
+ menuRefreshText: "Refresh",
47
+ menuRefreshTitle: "Refresh",
48
+ menuFirstPageText: "First Page",
49
+ menuFirstPageTitle: "First Page",
50
+ menuLastPageText: "Last Page",
51
+ menuLastPageTitle: "Last Page",
52
+ menuPreviousPageTitle: "Previous Page",
53
+ menuNextPageTitle: "Next Page",
54
+ menuPageNumberTitle: "Page Number Selector",
55
+ menuDocumentMapTitle: "Toggle Document Map",
56
+ menuParametersAreaTitle: "Toggle Parameters Area",
57
+ menuZoomInTitle: "Zoom In",
58
+ menuZoomOutTitle: "Zoom Out",
59
+ menuPageStateTitle: "Toggle FullPage/PageWidth",
60
+ menuPrintText: "Print...",
61
+ menuContinuousScrollText: "Toggle Continuous Scrolling",
62
+ menuSendMailText: "Send an email",
63
+ menuPrintTitle: "Print",
64
+ menuContinuousScrollTitle: "Toggle Continuous Scrolling",
65
+ menuSendMailTitle: "Send an email",
66
+ menuExportText: "Export",
67
+ menuExportTitle: "Export",
68
+ menuPrintPreviewText: "Toggle Print Preview",
69
+ menuPrintPreviewTitle: "Toggle Print Preview",
70
+ menuSearchText: "Search",
71
+ menuSearchTitle: "Toggle Search",
72
+ menuSideMenuTitle: "Toggle Side Menu",
73
+ sendEmailFromLabel: "From:",
74
+ sendEmailToLabel: "To:",
75
+ sendEmailCCLabel: "CC:",
76
+ sendEmailSubjectLabel: "Subject:",
77
+ sendEmailFormatLabel: "Format:",
78
+ sendEmailSendLabel: "Send",
79
+ sendEmailCancelLabel: "Cancel",
80
+ // accessibility string resources
81
+ ariaLabelPageNumberSelector: "Page number selector. Showing page {0} of {1}.",
82
+ ariaLabelPageNumberEditor: "Page number editor",
83
+ ariaLabelExpandable: "Expandable",
84
+ ariaLabelSelected: "Selected",
85
+ ariaLabelParameter: "parameter",
86
+ ariaLabelErrorMessage: "Error message",
87
+ ariaLabelParameterInfo: "Contains {0} options",
88
+ ariaLabelMultiSelect: "Multiselect",
89
+ ariaLabelMultiValue: "Multivalue",
90
+ ariaLabelSingleValue: "Single value",
91
+ ariaLabelParameterDateTime: "DateTime",
92
+ ariaLabelParameterString: "String",
93
+ ariaLabelParameterNumerical: "Numerical",
94
+ ariaLabelParameterBoolean: "Boolean",
95
+ ariaLabelParametersAreaPreviewButton: "Preview the report",
96
+ ariaLabelMainMenu: "Main menu",
97
+ ariaLabelCompactMenu: "Compact menu",
98
+ ariaLabelSideMenu: "Side menu",
99
+ ariaLabelDocumentMap: "Document map area",
100
+ ariaLabelDocumentMapSplitter: "Document map area splitbar.",
101
+ ariaLabelParametersAreaSplitter: "Parameters area splitbar.",
102
+ ariaLabelPagesArea: "Report contents area",
103
+ ariaLabelSearchDialogArea: "Search area",
104
+ ariaLabelSendEmailDialogArea: "Send email area",
105
+ ariaLabelSearchDialogStop: "Stop search",
106
+ ariaLabelSearchDialogOptions: "Search options",
107
+ ariaLabelSearchDialogNavigateUp: "Navigate up",
108
+ ariaLabelSearchDialogNavigateDown: "Navigate down",
109
+ ariaLabelSearchDialogMatchCase: "Match case",
110
+ ariaLabelSearchDialogMatchWholeWord: "Match whole word",
111
+ ariaLabelSearchDialogUseRegex: "Use regex",
112
+ ariaLabelMenuNavigateBackward: "Navigate backward",
113
+ ariaLabelMenuNavigateForward: "Navigate forward",
114
+ ariaLabelMenuStopRendering: "Stop rendering",
115
+ ariaLabelMenuRefresh: "Refresh",
116
+ ariaLabelMenuFirstPage: "First page",
117
+ ariaLabelMenuLastPage: "Last page",
118
+ ariaLabelMenuPreviousPage: "Previous page",
119
+ ariaLabelMenuNextPage: "Next page",
120
+ ariaLabelMenuPageNumber: "Page number selector",
121
+ ariaLabelMenuDocumentMap: "Toggle document map",
122
+ ariaLabelMenuParametersArea: "Toggle parameters area",
123
+ ariaLabelMenuZoomIn: "Zoom in",
124
+ ariaLabelMenuZoomOut: "Zoom out",
125
+ ariaLabelMenuPageState: "Toggle FullPage/PageWidth",
126
+ ariaLabelMenuPrint: "Print",
127
+ ariaLabelMenuContinuousScroll: "Continuous scrolling",
128
+ ariaLabelMenuSendMail: "Send an email",
129
+ ariaLabelMenuExport: "Export",
130
+ ariaLabelMenuPrintPreview: "Toggle print preview",
131
+ ariaLabelMenuSearch: "Search in report contents",
132
+ ariaLabelMenuSideMenu: "Toggle side menu",
133
+ ariaLabelSendEmailFrom: "From email address",
134
+ ariaLabelSendEmailTo: "Recipient email address",
135
+ ariaLabelSendEmailCC: "Carbon Copy email address",
136
+ ariaLabelSendEmailSubject: "Email subject:",
137
+ ariaLabelSendEmailFormat: "Report format:",
138
+ ariaLabelSendEmailSend: "Send email",
139
+ ariaLabelSendEmailCancel: "Cancel sending email",
140
+ // search dialog resources
141
+ searchDialogTitle: "Search in report contents",
142
+ searchDialogSearchInProgress: "searching...",
143
+ searchDialogNoResultsLabel: "No results",
144
+ searchDialogResultsFormatLabel: "Result {0} of {1}",
145
+ searchDialogStopTitle: "Stop Search",
146
+ searchDialogNavigateUpTitle: "Navigate Up",
147
+ searchDialogNavigateDownTitle: "Navigate Down",
148
+ searchDialogMatchCaseTitle: "Match Case",
149
+ searchDialogMatchWholeWordTitle: "Match Whole Word",
150
+ searchDialogUseRegexTitle: "Use Regex",
151
+ searchDialogCaptionText: "Find",
152
+ searchDialogPageText: "page",
153
+ // Send Email dialog resources
154
+ sendEmailDialogTitle: "Send Email",
155
+ sendEmailValidationEmailRequired: "Email field is required",
156
+ sendEmailValidationEmailFormat: "Email format is not valid",
157
+ sendEmailValidationSingleEmail: "The field accepts a single email address only",
158
+ sendEmailValidationFormatRequired: "Format field is required",
159
+ errorSendingDocument: "Error sending report document (Report = '{0}')."
160
+ };
161
+ window.telerikReportViewer || (window.telerikReportViewer = {});
162
+ (_a = window.telerikReportViewer).sr || (_a.sr = sr);
@@ -0,0 +1,7 @@
1
+ import './sr.js';
2
+
3
+ var sr = sr || {};
4
+ const userResources = (window.telerikReportViewer || {}).sr || {};
5
+ const stringResources = $.extend({}, sr, userResources);
6
+
7
+ export { stringResources };