@progress/telerik-jquery-report-viewer 25.25.313 → 26.25.716
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/accessibility.js +22 -64
- package/dist/cjs/aiPrompt.js +315 -0
- package/dist/cjs/base-component.js +8 -11
- package/dist/cjs/binder.js +12 -12
- package/dist/cjs/command.js +44 -25
- package/dist/cjs/commandSet.js +78 -53
- package/dist/cjs/components/button.js +41 -0
- package/dist/cjs/components/toggle-button.js +47 -0
- package/dist/cjs/constants.js +22 -0
- package/dist/cjs/documentMapArea.js +114 -93
- package/dist/cjs/event-emitter.js +2 -8
- package/dist/cjs/history.js +13 -12
- package/dist/cjs/index.js +4 -12
- package/dist/cjs/mainMenu.js +38 -28
- package/dist/cjs/mem-storage.js +7 -13
- package/dist/cjs/notificationService.js +128 -0
- package/dist/cjs/parameterValidators.js +26 -25
- package/dist/cjs/parameters.js +180 -161
- package/dist/cjs/parametersArea.js +309 -298
- package/dist/cjs/perspectives.js +23 -27
- package/dist/cjs/report-viewer/report-viewer-settings.js +4 -10
- package/dist/cjs/reportViewer.js +441 -190
- package/dist/cjs/search.js +218 -328
- package/dist/cjs/sendEmail.js +262 -267
- package/dist/cjs/service-client-sentinel.js +1 -1
- package/dist/cjs/sideMenu.js +20 -16
- package/dist/cjs/sr.js +11 -5
- package/dist/cjs/template-cache.js +2 -2
- package/dist/cjs/toolbar/button.js +18 -0
- package/dist/cjs/toolbar/link-button.js +6 -12
- package/dist/cjs/toolbar/page-count-label.js +1 -1
- package/dist/cjs/toolbar/page-number-input.js +16 -14
- package/dist/cjs/toolbar.js +203 -0
- package/dist/cjs/touch.js +8 -8
- package/dist/cjs/uiController.js +70 -57
- package/dist/cjs/utils.js +20 -207
- package/dist/font/font-icons.css +25 -222
- package/dist/font/font-icons.min.css +3 -3
- package/dist/js/telerikReportViewer.js +8196 -9110
- package/dist/js/telerikReportViewer.kendo.js +105616 -60642
- package/dist/js/telerikReportViewer.kendo.min.js +2 -2
- package/dist/js/telerikReportViewer.min.js +1 -1
- package/dist/js/telerikReportViewer.stringResources.js +11 -5
- package/dist/styles/telerikReportViewer.css +3 -3
- package/dist/styles/telerikReportViewer.min.css +3 -3
- package/dist/templates/telerikReportViewerTemplate.html +299 -238
- package/package.json +2 -3
- package/dist/cjs/controller.js +0 -1226
- package/dist/cjs/kendo-jquery.js +0 -4
- package/dist/cjs/pagesArea.js +0 -625
- package/dist/cjs/print.js +0 -165
- package/dist/cjs/scroll.js +0 -535
- package/dist/cjs/serviceClient.js +0 -311
- package/dist/cjs/telerikReportViewer.kendo.js +0 -60196
- package/dist/cjs/telerikReportViewer.kendo.min.js +0 -19776
- package/dist/cjs/uiFreezeCoordinator.js +0 -282
- package/dist/es/accessibility.js +0 -204
- package/dist/es/base-component.js +0 -22
- package/dist/es/binder.js +0 -75
- package/dist/es/command.js +0 -28
- package/dist/es/commandSet.js +0 -163
- package/dist/es/controller.js +0 -1222
- package/dist/es/documentMapArea.js +0 -161
- package/dist/es/domUtils.js +0 -43
- package/dist/es/enums.js +0 -41
- package/dist/es/event-emitter.js +0 -127
- package/dist/es/events.js +0 -20
- package/dist/es/globalSettings.js +0 -5
- package/dist/es/history.js +0 -131
- package/dist/es/index.js +0 -25
- package/dist/es/jqueryThrottleDebounce.js +0 -46
- package/dist/es/kendo-jquery.js +0 -1
- package/dist/es/mainMenu.js +0 -319
- package/dist/es/mem-storage.js +0 -40
- package/dist/es/pagesArea.js +0 -621
- package/dist/es/parameterValidators.js +0 -160
- package/dist/es/parameters.js +0 -916
- package/dist/es/parametersArea.js +0 -493
- package/dist/es/perspectives.js +0 -134
- package/dist/es/print.js +0 -161
- package/dist/es/report-viewer/report-viewer-settings.js +0 -134
- package/dist/es/reportViewer.js +0 -666
- package/dist/es/scroll.js +0 -531
- package/dist/es/search.js +0 -580
- package/dist/es/sendEmail.js +0 -388
- package/dist/es/service-client-sentinel.js +0 -49
- package/dist/es/serviceClient.js +0 -307
- package/dist/es/sideMenu.js +0 -212
- package/dist/es/sr.js +0 -164
- package/dist/es/stringResources.js +0 -7
- package/dist/es/telerikReportViewer.kendo.js +0 -60194
- package/dist/es/telerikReportViewer.kendo.min.js +0 -19774
- package/dist/es/template-cache.js +0 -35
- package/dist/es/toolbar/link-button.js +0 -38
- package/dist/es/toolbar/page-count-label.js +0 -14
- package/dist/es/toolbar/page-number-input.js +0 -60
- package/dist/es/touch.js +0 -82
- package/dist/es/uiController.js +0 -138
- package/dist/es/uiFreezeCoordinator.js +0 -278
- package/dist/es/utils.js +0 -444
- package/dist/templates/telerikReportViewerTemplate-FA.html +0 -317
- /package/dist/font/{ReportingIcons-19.0.25.313.ttf → ReportingIcons-19.1.25.716.ttf} +0 -0
package/dist/cjs/sideMenu.js
CHANGED
@@ -5,19 +5,23 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
var utils = require('./utils.js');
|
6
6
|
var stringResources = require('./stringResources.js');
|
7
7
|
|
8
|
-
function SideMenu(
|
9
|
-
|
10
|
-
var menu = $(
|
8
|
+
function SideMenu(element, options, viewerOptions) {
|
9
|
+
options = $.extend({}, options, viewerOptions);
|
10
|
+
var menu = $(element).data("kendoMenu");
|
11
11
|
var enableAccessibility = options.enableAccessibility;
|
12
12
|
var DEFAULT_TABINDEX = 3;
|
13
13
|
var panelBar;
|
14
14
|
var sideMenuVisible = false;
|
15
15
|
var controller = options.controller;
|
16
|
+
var notificationService = options.notificationService;
|
16
17
|
if (!controller) {
|
17
18
|
throw "No controller (telerikReporting.ReportViewerController) has been specified.";
|
18
19
|
}
|
20
|
+
if (!notificationService) {
|
21
|
+
throw "No notificationService (telerikReporting.NotificationService) has been specified.";
|
22
|
+
}
|
19
23
|
if (!menu) {
|
20
|
-
init(
|
24
|
+
init(element);
|
21
25
|
}
|
22
26
|
function init(root) {
|
23
27
|
var $root = $(root);
|
@@ -32,23 +36,23 @@ function SideMenu(dom, rootOptions, otherOptions) {
|
|
32
36
|
panelBar.element.on("keydown", onPanelKeyDown);
|
33
37
|
setTabIndexes($root);
|
34
38
|
enableCloseOnClick($root);
|
35
|
-
$root.click(
|
39
|
+
$root.on("click", (e) => {
|
36
40
|
if (e.target == root) {
|
37
|
-
|
41
|
+
notificationService.setSideMenuVisible({ visible: !sideMenuVisible });
|
38
42
|
}
|
39
43
|
});
|
40
44
|
replaceStringResources();
|
41
45
|
}
|
42
|
-
|
46
|
+
notificationService.setSideMenuVisible((event, args) => {
|
43
47
|
setSideMenuVisibility();
|
44
48
|
if (enableAccessibility) {
|
45
|
-
panelBar.element.focus
|
49
|
+
panelBar.element.trigger("focus");
|
46
50
|
}
|
47
51
|
sideMenuVisible = args.visible;
|
48
52
|
if (!sideMenuVisible) {
|
49
53
|
panelBar.collapse($("#trv-side-menu-export-command"));
|
50
54
|
}
|
51
|
-
}).getSideMenuVisible(
|
55
|
+
}).getSideMenuVisible((event, args) => {
|
52
56
|
args.visible = sideMenuVisible;
|
53
57
|
});
|
54
58
|
function setSideMenuVisibility() {
|
@@ -57,7 +61,7 @@ function SideMenu(dom, rootOptions, otherOptions) {
|
|
57
61
|
if (hidden) {
|
58
62
|
$root.show();
|
59
63
|
} else {
|
60
|
-
window.setTimeout(
|
64
|
+
window.setTimeout(() => {
|
61
65
|
$root.hide();
|
62
66
|
}, 500);
|
63
67
|
}
|
@@ -66,14 +70,14 @@ function SideMenu(dom, rootOptions, otherOptions) {
|
|
66
70
|
var $item = $(e.item);
|
67
71
|
panelBar.unbind("expand", onSubmenuOpen);
|
68
72
|
panelBar.append({ text: stringResources.stringResources.loadingFormats, spriteCssClass: "k-icon k-loading" }, $item);
|
69
|
-
options.controller.getDocumentFormats().then(fillFormats).then(
|
73
|
+
options.controller.getDocumentFormats().then(fillFormats).then(() => {
|
70
74
|
panelBar.expand($item);
|
71
|
-
}).then(
|
75
|
+
}).then(() => {
|
72
76
|
panelBar.bind("expand", onSubmenuOpen);
|
73
77
|
});
|
74
78
|
}
|
75
79
|
function fillFormats(formats) {
|
76
|
-
Array.from($(
|
80
|
+
Array.from($(element).find("ul[data-command-list=export-format-list]")).forEach((list) => {
|
77
81
|
var $list = $(list);
|
78
82
|
var $parent = $list.parents("li");
|
79
83
|
var tabIndex = $parent.attr("tabindex");
|
@@ -95,7 +99,7 @@ function SideMenu(dom, rootOptions, otherOptions) {
|
|
95
99
|
var isLeaf = $(listItem).children("ul").length === 0;
|
96
100
|
if (isLeaf) {
|
97
101
|
$(listItem).children("a").on("click", (event) => {
|
98
|
-
|
102
|
+
notificationService.setSideMenuVisible({ visible: !sideMenuVisible });
|
99
103
|
});
|
100
104
|
}
|
101
105
|
});
|
@@ -154,7 +158,7 @@ function SideMenu(dom, rootOptions, otherOptions) {
|
|
154
158
|
} else {
|
155
159
|
$item = panelBar.select();
|
156
160
|
}
|
157
|
-
if (!$item ||
|
161
|
+
if (!$item || $item.length === 0) {
|
158
162
|
return;
|
159
163
|
}
|
160
164
|
handleItemSelect($item, isSelectedFocusedItem);
|
@@ -166,7 +170,7 @@ function SideMenu(dom, rootOptions, otherOptions) {
|
|
166
170
|
}
|
167
171
|
}
|
168
172
|
function handleItemSelect(item, handleExpandCollapse) {
|
169
|
-
if (
|
173
|
+
if (item.length === 0) {
|
170
174
|
return;
|
171
175
|
}
|
172
176
|
var isLeaf = item.children("ul").length === 0;
|
package/dist/cjs/sr.js
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
var _a;
|
4
3
|
var sr = {
|
5
4
|
// warning and error string resources
|
6
5
|
controllerNotInitialized: "Controller is not initialized.",
|
@@ -35,7 +34,7 @@ var sr = {
|
|
35
34
|
errorObtainingAuthenticationToken: "Error obtaining authentication token.",
|
36
35
|
clientExpired: "Click 'Refresh' to restore client session.",
|
37
36
|
promisesChainStopError: "Error shown. Throwing promises chain stop error.",
|
38
|
-
|
37
|
+
renderingCancelled: "Report processing was canceled.",
|
39
38
|
tryReportPreview: "The report may now be previewed.",
|
40
39
|
// viewer template string resources
|
41
40
|
parameterEditorSelectNone: "clear selection",
|
@@ -56,6 +55,8 @@ var sr = {
|
|
56
55
|
menuPreviousPageTitle: "Previous Page",
|
57
56
|
menuNextPageTitle: "Next Page",
|
58
57
|
menuPageNumberTitle: "Page Number Selector",
|
58
|
+
menuPageText: "Page",
|
59
|
+
menuPageOfText: "of",
|
59
60
|
menuDocumentMapTitle: "Toggle Document Map",
|
60
61
|
menuParametersAreaTitle: "Toggle Parameters Area",
|
61
62
|
menuZoomInTitle: "Zoom In",
|
@@ -73,6 +74,7 @@ var sr = {
|
|
73
74
|
menuPrintPreviewTitle: "Toggle Print Preview",
|
74
75
|
menuSearchText: "Search",
|
75
76
|
menuSearchTitle: "Toggle Search",
|
77
|
+
menuAiPromptTitle: "Toggle AI Prompt",
|
76
78
|
menuSideMenuTitle: "Toggle Side Menu",
|
77
79
|
sendEmailFromLabel: "From:",
|
78
80
|
sendEmailToLabel: "To:",
|
@@ -105,6 +107,7 @@ var sr = {
|
|
105
107
|
ariaLabelParametersAreaSplitter: "Parameters area splitbar.",
|
106
108
|
ariaLabelPagesArea: "Report contents area",
|
107
109
|
ariaLabelSearchDialogArea: "Search area",
|
110
|
+
ariaLabelAiPromptDialogArea: "AI prompt area",
|
108
111
|
ariaLabelSendEmailDialogArea: "Send email area",
|
109
112
|
ariaLabelSearchDialogStop: "Stop search",
|
110
113
|
ariaLabelSearchDialogOptions: "Search options",
|
@@ -160,7 +163,10 @@ var sr = {
|
|
160
163
|
sendEmailValidationEmailFormat: "Email format is not valid",
|
161
164
|
sendEmailValidationSingleEmail: "The field accepts a single email address only",
|
162
165
|
sendEmailValidationFormatRequired: "Format field is required",
|
163
|
-
errorSendingDocument: "Error sending report document (Report = '{0}')."
|
166
|
+
errorSendingDocument: "Error sending report document (Report = '{0}').",
|
167
|
+
aiPromptConsentDialogTitle: "Before you start with AI",
|
168
|
+
aiPromptConsentAgreeLabel: "Consent",
|
169
|
+
aiPromptConsentRejectLabel: "Cancel"
|
164
170
|
};
|
165
|
-
window.telerikReportViewer
|
166
|
-
|
171
|
+
window.telerikReportViewer ||= {};
|
172
|
+
window.telerikReportViewer.sr ||= sr;
|
@@ -7,10 +7,10 @@ var utils = require('./utils.js');
|
|
7
7
|
const TemplateCache = function() {
|
8
8
|
var cache = {};
|
9
9
|
return {
|
10
|
-
load:
|
10
|
+
load: (url, serviceUrl, client) => {
|
11
11
|
var p = cache[url];
|
12
12
|
if (!p) {
|
13
|
-
cache[url] = p = client.get(url).then(
|
13
|
+
cache[url] = p = client.get(url).then((html) => {
|
14
14
|
var templates = {};
|
15
15
|
var styleSheets = [];
|
16
16
|
var baseUri = utils.rTrim(serviceUrl, "\\/") + "/";
|
@@ -0,0 +1,18 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
class ToolbarButton {
|
6
|
+
constructor(element, command) {
|
7
|
+
this._element = element;
|
8
|
+
this._command = command;
|
9
|
+
this._initButton();
|
10
|
+
}
|
11
|
+
_initButton() {
|
12
|
+
const options = {};
|
13
|
+
options.icon = this._element.dataset.icon;
|
14
|
+
new kendo.ui.Button(this._element, options);
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
exports.ToolbarButton = ToolbarButton;
|
@@ -4,35 +4,29 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
var baseComponent = require('../base-component.js');
|
6
6
|
|
7
|
-
var __defProp = Object.defineProperty;
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
9
|
-
var __publicField = (obj, key, value) => {
|
10
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
11
|
-
return value;
|
12
|
-
};
|
13
7
|
class LinkButton extends baseComponent.BaseComponent {
|
8
|
+
// #region fields
|
9
|
+
cmd;
|
14
10
|
// #endregion
|
15
11
|
// #region constructor
|
16
12
|
constructor(element, options) {
|
17
13
|
super(element, options);
|
18
|
-
// #region fields
|
19
|
-
__publicField(this, "cmd");
|
20
14
|
var dataCommand = this.$element.attr("data-command");
|
21
15
|
if (dataCommand) {
|
22
16
|
this.cmd = this.options.commands[dataCommand];
|
23
17
|
}
|
24
18
|
if (this.cmd) {
|
25
19
|
this.$element.on("click", (event) => {
|
26
|
-
if (this.cmd.
|
27
|
-
this.cmd.exec($(
|
20
|
+
if (this.cmd.getEnabled()) {
|
21
|
+
this.cmd.exec($(event.currentTarget).attr("data-command-parameter"));
|
28
22
|
} else {
|
29
23
|
event.preventDefault();
|
30
24
|
}
|
31
25
|
});
|
32
26
|
$(this.cmd).on("enabledChanged", (event) => {
|
33
|
-
(this.cmd.
|
27
|
+
(this.cmd.getEnabled() ? $.fn.removeClass : $.fn.addClass).call(this.$element, "disabled");
|
34
28
|
}).on("checkedChanged", (event) => {
|
35
|
-
(this.cmd.
|
29
|
+
(this.cmd.getChecked() ? $.fn.addClass : $.fn.removeClass).call(this.$element, "checked");
|
36
30
|
});
|
37
31
|
}
|
38
32
|
}
|
@@ -8,7 +8,7 @@ class PageCountLabel extends baseComponent.BaseComponent {
|
|
8
8
|
// #region constructor
|
9
9
|
constructor(element, options) {
|
10
10
|
super(element, options);
|
11
|
-
|
11
|
+
options.notificationService.pageCountChange((event, value) => {
|
12
12
|
this.$element.text(value);
|
13
13
|
});
|
14
14
|
}
|
@@ -3,22 +3,18 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
var baseComponent = require('../base-component.js');
|
6
|
+
var stringResources = require('../stringResources.js');
|
6
7
|
var utils = require('../utils.js');
|
8
|
+
var RCV = require('@progress/telerik-common-report-viewer');
|
7
9
|
|
8
|
-
var __defProp = Object.defineProperty;
|
9
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
10
|
-
var __publicField = (obj, key, value) => {
|
11
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
12
|
-
return value;
|
13
|
-
};
|
14
10
|
class PageNumberInput extends baseComponent.BaseComponent {
|
11
|
+
// #region fields
|
12
|
+
cmd;
|
13
|
+
_numeric;
|
15
14
|
// #endregion
|
16
15
|
// #region constructor
|
17
16
|
constructor(element, options) {
|
18
17
|
super(element, options);
|
19
|
-
// #region fields
|
20
|
-
__publicField(this, "cmd");
|
21
|
-
__publicField(this, "_numeric");
|
22
18
|
this.cmd = this.options.commands["goToPage"];
|
23
19
|
this._numeric = new kendo.ui.NumericTextBox(this.element, {
|
24
20
|
format: "0",
|
@@ -30,19 +26,25 @@ class PageNumberInput extends baseComponent.BaseComponent {
|
|
30
26
|
});
|
31
27
|
this._numeric._text[0].dataset.role = "telerik_ReportViewer_PageNumberInput";
|
32
28
|
this._numeric.element[0].dataset.role = "";
|
33
|
-
this.
|
29
|
+
this._numeric.wrapper[0].classList.add("trv-toolbar-numeric");
|
30
|
+
this._numeric._text[0].setAttribute("aria-label", stringResources.stringResources.ariaLabelPageNumberEditor);
|
31
|
+
this.options.controller.onAsync("reportLoadComplete", async (reportInfo) => {
|
34
32
|
this._numeric.max(reportInfo.pageCount);
|
35
33
|
this._numeric.min(Math.min(1, reportInfo.pageCount));
|
36
34
|
this._numeric.value(Math.min(1, reportInfo.pageCount));
|
37
|
-
}).on("loadedReportChange", (
|
35
|
+
}).on("loadedReportChange", () => {
|
38
36
|
this._numeric.min(0);
|
39
37
|
this._numeric.max(0);
|
40
38
|
this._numeric.value(0);
|
41
|
-
}).on("renderingStopped", (
|
39
|
+
}).on("renderingStopped", () => {
|
42
40
|
this._numeric.min(0);
|
43
41
|
this._numeric.max(0);
|
44
42
|
this._numeric.value(0);
|
45
|
-
})
|
43
|
+
});
|
44
|
+
this.options.notificationService.pageNumberChange((event, value) => {
|
45
|
+
var pageNumber = value;
|
46
|
+
var pageCount = this.options.controller.getPageCount();
|
47
|
+
this.element.parentElement.setAttribute("aria-label", utils.stringFormat(stringResources.stringResources.ariaLabelPageNumberSelector, [pageNumber, pageCount]));
|
46
48
|
this._numeric.value(value);
|
47
49
|
});
|
48
50
|
}
|
@@ -50,7 +52,7 @@ class PageNumberInput extends baseComponent.BaseComponent {
|
|
50
52
|
// #region event handlers
|
51
53
|
_onChange(event, data) {
|
52
54
|
var val = this._numeric.value();
|
53
|
-
var num =
|
55
|
+
var num = RCV.tryParseInt(val);
|
54
56
|
if (!isNaN(num)) {
|
55
57
|
this.cmd.exec(num);
|
56
58
|
}
|
@@ -0,0 +1,203 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
var stringResources = require('./stringResources.js');
|
6
|
+
var pageCountLabel = require('./toolbar/page-count-label.js');
|
7
|
+
var pageNumberInput = require('./toolbar/page-number-input.js');
|
8
|
+
var constants = require('./constants.js');
|
9
|
+
|
10
|
+
function replaceStringResources($toolbar) {
|
11
|
+
if (!$toolbar) {
|
12
|
+
return;
|
13
|
+
}
|
14
|
+
const labels = $toolbar.find(".trv-replace-string");
|
15
|
+
if (labels && labels.length > 0) {
|
16
|
+
Array.from(labels).forEach((element) => {
|
17
|
+
const $element = $(element);
|
18
|
+
const stringResource = stringResources.stringResources[$element.text()];
|
19
|
+
if ($element && stringResource) {
|
20
|
+
$element.text(stringResource);
|
21
|
+
}
|
22
|
+
});
|
23
|
+
}
|
24
|
+
}
|
25
|
+
class Toolbar {
|
26
|
+
// #region fields
|
27
|
+
_options;
|
28
|
+
/** @type {HTMLElement} */
|
29
|
+
_element;
|
30
|
+
$element;
|
31
|
+
_kendoToolbar;
|
32
|
+
_neverOverflowToolBarButtons = ["goToPrevPage", "goToNextPage"];
|
33
|
+
// #endregion
|
34
|
+
// #region constructor
|
35
|
+
constructor(element, options, viewerOptions) {
|
36
|
+
this._element = element;
|
37
|
+
this._options = options;
|
38
|
+
this.$element = $(this._element);
|
39
|
+
if (this._kendoToolbar === void 0) {
|
40
|
+
this.initKendoToolbar();
|
41
|
+
}
|
42
|
+
this._options.controller.on("beginLoadReport", () => {
|
43
|
+
const kendoExportDropDown = this.$element.find(`#${constants.ToolBarConstants.ExportDropdownId}`).data("kendoDropDownButton");
|
44
|
+
kendoExportDropDown?.enable(false);
|
45
|
+
}).onAsync("reportLoadComplete", async () => {
|
46
|
+
if (viewerOptions.renderingExtensions === void 0) {
|
47
|
+
this._options.controller.getDocumentFormats().then((extensions) => {
|
48
|
+
this.updateExportDropdownItems(extensions);
|
49
|
+
}).catch((error) => {
|
50
|
+
this._options.controller.trigger("error", { message: error });
|
51
|
+
});
|
52
|
+
} else {
|
53
|
+
this.updateExportDropdownItems(viewerOptions.renderingExtensions);
|
54
|
+
}
|
55
|
+
});
|
56
|
+
}
|
57
|
+
// #endregion
|
58
|
+
// #region methods
|
59
|
+
initKendoToolbar() {
|
60
|
+
replaceStringResources(this.$element);
|
61
|
+
const children = Array.from(this._element.children);
|
62
|
+
const toolBarItems = [];
|
63
|
+
children.forEach((child) => toolBarItems.push(this.createToolbarItem(child)));
|
64
|
+
this.$element.empty();
|
65
|
+
this._kendoToolbar = this.$element.kendoToolBar({
|
66
|
+
items: toolBarItems,
|
67
|
+
click: (e) => {
|
68
|
+
this.executeCommand(e);
|
69
|
+
},
|
70
|
+
toggle: (e) => {
|
71
|
+
this.executeCommand(e);
|
72
|
+
}
|
73
|
+
}).data("kendoToolBar");
|
74
|
+
const pageNumberInputEl = this.$element.find(constants.ToolBarConstants.PageNumberInputDataRoleSelector).get(0);
|
75
|
+
if (pageNumberInputEl) {
|
76
|
+
new pageNumberInput.PageNumberInput(pageNumberInputEl, this._options);
|
77
|
+
}
|
78
|
+
const pageCountLabelEl = this.$element.find(constants.ToolBarConstants.PageCountLabelDataRoleSelector).get(0);
|
79
|
+
if (pageCountLabelEl) {
|
80
|
+
new pageCountLabel.PageCountLabel(pageCountLabelEl, this._options);
|
81
|
+
}
|
82
|
+
}
|
83
|
+
createToolbarItem(elementData) {
|
84
|
+
const cmdName = (elementData.dataset?.command || "").replace("telerik_ReportViewer_", "");
|
85
|
+
if (cmdName === "toggleAiPromptDialog" && !this._options.controller.getAiConfigurationOptions()?.isAvailable) {
|
86
|
+
return;
|
87
|
+
}
|
88
|
+
const id = elementData.id;
|
89
|
+
const role = elementData.dataset?.role;
|
90
|
+
const icon = elementData.dataset?.icon;
|
91
|
+
const overflow = elementData.dataset?.overflow;
|
92
|
+
const title = stringResources.stringResources[elementData.title] || elementData.title || "";
|
93
|
+
const ariaLabel = stringResources.stringResources[elementData.ariaLabel] || elementData.ariaLabel || "";
|
94
|
+
const cmdParam = elementData.dataset?.commandParameter;
|
95
|
+
const command = this._options.commands[cmdName];
|
96
|
+
switch (role) {
|
97
|
+
case constants.ToolBarConstants.Separator:
|
98
|
+
return {
|
99
|
+
type: constants.ToolBarConstants.Separator,
|
100
|
+
overflow: overflow || "auto"
|
101
|
+
};
|
102
|
+
case constants.ToolBarConstants.CustomElement:
|
103
|
+
elementData.title = title;
|
104
|
+
elementData.ariaLabel = ariaLabel;
|
105
|
+
return {
|
106
|
+
template: elementData.outerHTML
|
107
|
+
};
|
108
|
+
case constants.ToolBarConstants.MenuButton:
|
109
|
+
return {
|
110
|
+
id,
|
111
|
+
type: constants.ToolBarConstants.DropDownButton,
|
112
|
+
icon,
|
113
|
+
enable: false,
|
114
|
+
showArrowButton: true,
|
115
|
+
overflow: "never",
|
116
|
+
fillMode: "flat",
|
117
|
+
menuButtons: [
|
118
|
+
{ text: "Loading...", enabled: false }
|
119
|
+
]
|
120
|
+
};
|
121
|
+
case constants.ToolBarConstants.ButtonGroup:
|
122
|
+
const groupChildren = Array.from(elementData.children);
|
123
|
+
const buttonGroupButtons = [];
|
124
|
+
groupChildren.forEach((groupChild) => {
|
125
|
+
if (groupChild.dataset?.role !== constants.ToolBarConstants.Button && groupChild.dataset?.role !== constants.ToolBarConstants.ToggleButton) {
|
126
|
+
console.warn("The data-role attribute of element nested inside a buttonGroup is missing or not supported. Only 'button' or 'toggle-button' data-role is allowed.");
|
127
|
+
return;
|
128
|
+
}
|
129
|
+
buttonGroupButtons.push(this.createToolbarItem(groupChild));
|
130
|
+
});
|
131
|
+
return {
|
132
|
+
type: constants.ToolBarConstants.ButtonGroup,
|
133
|
+
buttons: buttonGroupButtons,
|
134
|
+
fillMode: "flat",
|
135
|
+
overflow: overflow ? overflow : "auto"
|
136
|
+
};
|
137
|
+
case constants.ToolBarConstants.Button:
|
138
|
+
case constants.ToolBarConstants.ToggleButton:
|
139
|
+
$(command).on("enabledChanged", (e, newState) => {
|
140
|
+
this._kendoToolbar.enable($(`button[${constants.ToolBarConstants.DataCommandAttr}="${cmdName}"]`), newState);
|
141
|
+
}).on("checkedChanged", (e, newState) => {
|
142
|
+
this._kendoToolbar.toggle($(`button[${constants.ToolBarConstants.DataCommandAttr}="${cmdName}"]`), newState);
|
143
|
+
});
|
144
|
+
return {
|
145
|
+
id,
|
146
|
+
type: constants.ToolBarConstants.Button,
|
147
|
+
text: title,
|
148
|
+
icon,
|
149
|
+
attributes: {
|
150
|
+
[constants.ToolBarConstants.DataCommandAttr]: cmdName,
|
151
|
+
[constants.ToolBarConstants.DataCommandParameterAttr]: cmdParam,
|
152
|
+
[constants.ToolBarConstants.AriaLabelAttr]: ariaLabel,
|
153
|
+
[constants.ToolBarConstants.TitleAttr]: title
|
154
|
+
},
|
155
|
+
fillMode: "flat",
|
156
|
+
togglable: role === constants.ToolBarConstants.ToggleButton,
|
157
|
+
overflow: overflow ? overflow : "auto",
|
158
|
+
showText: "overflow"
|
159
|
+
};
|
160
|
+
default:
|
161
|
+
console.error(`The data-role attribute is missing or not supported: ${role}`);
|
162
|
+
return {};
|
163
|
+
}
|
164
|
+
}
|
165
|
+
executeCommand(event) {
|
166
|
+
const cmdName = event.target.get(0)?.dataset.command || "";
|
167
|
+
const cmdParam = event.target.get(0)?.dataset.commandParameter || "";
|
168
|
+
if (!cmdName) {
|
169
|
+
return;
|
170
|
+
}
|
171
|
+
const cmdFn = this._options.commands[cmdName];
|
172
|
+
if (!cmdFn) {
|
173
|
+
console.error(`The provided data-command attribute is not present within the commands collection: ${cmdName}`);
|
174
|
+
return;
|
175
|
+
}
|
176
|
+
cmdFn.exec(cmdParam);
|
177
|
+
}
|
178
|
+
updateExportDropdownItems(extensions) {
|
179
|
+
const kendoExportDropDown = this.$element.find(`#${constants.ToolBarConstants.ExportDropdownId}`).data("kendoDropDownButton");
|
180
|
+
if (!kendoExportDropDown) {
|
181
|
+
return;
|
182
|
+
}
|
183
|
+
if (!(extensions && extensions.length > 0)) {
|
184
|
+
console.warn("No extensions found - the export dropdown button will remain disabled.");
|
185
|
+
return;
|
186
|
+
}
|
187
|
+
const exportDropdownItems = [];
|
188
|
+
extensions.forEach((extension) => exportDropdownItems.push({
|
189
|
+
id: extension.name,
|
190
|
+
text: extension.localizedName,
|
191
|
+
attributes: {
|
192
|
+
[constants.ToolBarConstants.DataCommandAttr]: "export",
|
193
|
+
[constants.ToolBarConstants.DataCommandParameterAttr]: extension.name
|
194
|
+
}
|
195
|
+
}));
|
196
|
+
const options = kendoExportDropDown.options;
|
197
|
+
options.items = exportDropdownItems;
|
198
|
+
kendoExportDropDown.setOptions(options);
|
199
|
+
kendoExportDropDown.enable(true);
|
200
|
+
}
|
201
|
+
}
|
202
|
+
|
203
|
+
exports.Toolbar = Toolbar;
|
package/dist/cjs/touch.js
CHANGED
@@ -9,39 +9,39 @@ function TouchBehavior(dom, options) {
|
|
9
9
|
function init(element) {
|
10
10
|
if (typeof $.fn.kendoTouch === "function") {
|
11
11
|
try {
|
12
|
-
$(element).mousedown(
|
12
|
+
$(element).on("mousedown", () => {
|
13
13
|
ignoreTouch = true;
|
14
|
-
}).mouseup(
|
14
|
+
}).on("mouseup", () => {
|
15
15
|
ignoreTouch = false;
|
16
16
|
}).kendoTouch({
|
17
17
|
multiTouch: true,
|
18
18
|
enableSwipe: true,
|
19
|
-
swipe:
|
19
|
+
swipe: (e) => {
|
20
20
|
if (!ignoreTouch) {
|
21
21
|
onSwipe(e);
|
22
22
|
}
|
23
23
|
},
|
24
|
-
gesturestart:
|
24
|
+
gesturestart: (e) => {
|
25
25
|
if (!ignoreTouch) {
|
26
26
|
onGestureStart(e);
|
27
27
|
}
|
28
28
|
},
|
29
|
-
gestureend:
|
29
|
+
gestureend: (e) => {
|
30
30
|
if (!ignoreTouch) {
|
31
31
|
onGestureEnd(e);
|
32
32
|
}
|
33
33
|
},
|
34
|
-
gesturechange:
|
34
|
+
gesturechange: (e) => {
|
35
35
|
if (!ignoreTouch) {
|
36
36
|
onGestureChange(e);
|
37
37
|
}
|
38
38
|
},
|
39
|
-
doubletap:
|
39
|
+
doubletap: (e) => {
|
40
40
|
if (!ignoreTouch) {
|
41
41
|
onDoubleTap(e);
|
42
42
|
}
|
43
43
|
},
|
44
|
-
touchstart:
|
44
|
+
touchstart: (e) => {
|
45
45
|
if (!ignoreTouch) {
|
46
46
|
fire("touchstart");
|
47
47
|
}
|