@progress/telerik-jquery-report-viewer 25.25.211 → 26.25.521
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 +311 -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 +306 -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 +259 -264
- package/dist/cjs/service-client-sentinel.js +1 -1
- package/dist/cjs/sideMenu.js +20 -16
- package/dist/cjs/sr.js +9 -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 +186 -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 +8173 -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 +9 -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.211.ttf → ReportingIcons-19.1.25.521.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",
|
@@ -73,6 +72,7 @@ var sr = {
|
|
73
72
|
menuPrintPreviewTitle: "Toggle Print Preview",
|
74
73
|
menuSearchText: "Search",
|
75
74
|
menuSearchTitle: "Toggle Search",
|
75
|
+
menuAiPromptTitle: "Toggle AI Prompt",
|
76
76
|
menuSideMenuTitle: "Toggle Side Menu",
|
77
77
|
sendEmailFromLabel: "From:",
|
78
78
|
sendEmailToLabel: "To:",
|
@@ -105,6 +105,7 @@ var sr = {
|
|
105
105
|
ariaLabelParametersAreaSplitter: "Parameters area splitbar.",
|
106
106
|
ariaLabelPagesArea: "Report contents area",
|
107
107
|
ariaLabelSearchDialogArea: "Search area",
|
108
|
+
ariaLabelAiPromptDialogArea: "AI prompt area",
|
108
109
|
ariaLabelSendEmailDialogArea: "Send email area",
|
109
110
|
ariaLabelSearchDialogStop: "Stop search",
|
110
111
|
ariaLabelSearchDialogOptions: "Search options",
|
@@ -160,7 +161,10 @@ var sr = {
|
|
160
161
|
sendEmailValidationEmailFormat: "Email format is not valid",
|
161
162
|
sendEmailValidationSingleEmail: "The field accepts a single email address only",
|
162
163
|
sendEmailValidationFormatRequired: "Format field is required",
|
163
|
-
errorSendingDocument: "Error sending report document (Report = '{0}')."
|
164
|
+
errorSendingDocument: "Error sending report document (Report = '{0}').",
|
165
|
+
aiPromptConsentDialogTitle: "Before you start with AI",
|
166
|
+
aiPromptConsentAgreeLabel: "Consent",
|
167
|
+
aiPromptConsentRejectLabel: "Cancel"
|
164
168
|
};
|
165
|
-
window.telerikReportViewer
|
166
|
-
|
169
|
+
window.telerikReportViewer ||= {};
|
170
|
+
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,186 @@
|
|
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
|
+
class Toolbar {
|
11
|
+
// #region fields
|
12
|
+
_options;
|
13
|
+
/** @type {HTMLElement} */
|
14
|
+
_element;
|
15
|
+
_kendoToolbar;
|
16
|
+
_neverOverflowToolBarButtons = ["goToPrevPage", "goToNextPage"];
|
17
|
+
// #endregion
|
18
|
+
// #region constructor
|
19
|
+
constructor(element, options, viewerOptions) {
|
20
|
+
this._element = element;
|
21
|
+
this._options = options;
|
22
|
+
if (this._kendoToolbar === void 0) {
|
23
|
+
this.initKendoToolbar();
|
24
|
+
}
|
25
|
+
this._options.controller.on("beginLoadReport", () => {
|
26
|
+
const kendoExportDropDown = $(`#${constants.ToolBarConstants.ExportDropdownId}`).data("kendoDropDownButton");
|
27
|
+
kendoExportDropDown?.enable(false);
|
28
|
+
}).onAsync("reportLoadComplete", async () => {
|
29
|
+
if (viewerOptions.renderingExtensions === void 0) {
|
30
|
+
this._options.controller.getDocumentFormats().then((extensions) => {
|
31
|
+
this.updateExportDropdownItems(extensions);
|
32
|
+
}).catch((error) => {
|
33
|
+
this._options.controller.trigger("error", { message: error });
|
34
|
+
});
|
35
|
+
} else {
|
36
|
+
this.updateExportDropdownItems(viewerOptions.renderingExtensions);
|
37
|
+
}
|
38
|
+
});
|
39
|
+
}
|
40
|
+
// #endregion
|
41
|
+
// #region methods
|
42
|
+
initKendoToolbar() {
|
43
|
+
const children = Array.from(this._element.children);
|
44
|
+
const toolBarItems = [];
|
45
|
+
children.forEach((child) => toolBarItems.push(this.createToolbarItem(child)));
|
46
|
+
const $element = $(this._element);
|
47
|
+
$element.empty();
|
48
|
+
this._kendoToolbar = $element.kendoToolBar({
|
49
|
+
items: toolBarItems,
|
50
|
+
click: (e) => {
|
51
|
+
this.executeCommand(e);
|
52
|
+
},
|
53
|
+
toggle: (e) => {
|
54
|
+
this.executeCommand(e);
|
55
|
+
}
|
56
|
+
}).data("kendoToolBar");
|
57
|
+
const pageNumberInputEl = $(constants.ToolBarConstants.PageNumberInputDataRoleSelector).get(0);
|
58
|
+
if (pageNumberInputEl) {
|
59
|
+
new pageNumberInput.PageNumberInput(pageNumberInputEl, this._options);
|
60
|
+
}
|
61
|
+
const pageCountLabelEl = $(constants.ToolBarConstants.PageCountLabelDataRoleSelector).get(0);
|
62
|
+
if (pageCountLabelEl) {
|
63
|
+
new pageCountLabel.PageCountLabel(pageCountLabelEl, this._options);
|
64
|
+
}
|
65
|
+
}
|
66
|
+
createToolbarItem(elementData) {
|
67
|
+
const cmdName = (elementData.dataset?.command || "").replace("telerik_ReportViewer_", "");
|
68
|
+
if (cmdName === "toggleAiPromptDialog" && !this._options.controller.getAiConfigurationOptions()?.isAvailable) {
|
69
|
+
return;
|
70
|
+
}
|
71
|
+
const id = elementData.id;
|
72
|
+
const role = elementData.dataset?.role;
|
73
|
+
const icon = elementData.dataset?.icon;
|
74
|
+
const overflow = elementData.dataset?.overflow;
|
75
|
+
const title = stringResources.stringResources[elementData.title] || elementData.title || "";
|
76
|
+
const ariaLabel = stringResources.stringResources[elementData.ariaLabel] || elementData.ariaLabel || "";
|
77
|
+
const cmdParam = elementData.dataset?.commandParameter;
|
78
|
+
const command = this._options.commands[cmdName];
|
79
|
+
switch (role) {
|
80
|
+
case constants.ToolBarConstants.Separator:
|
81
|
+
return {
|
82
|
+
type: constants.ToolBarConstants.Separator,
|
83
|
+
overflow: overflow || "auto"
|
84
|
+
};
|
85
|
+
case constants.ToolBarConstants.CustomElement:
|
86
|
+
elementData.title = title;
|
87
|
+
elementData.ariaLabel = ariaLabel;
|
88
|
+
return {
|
89
|
+
template: elementData.outerHTML
|
90
|
+
};
|
91
|
+
case constants.ToolBarConstants.MenuButton:
|
92
|
+
return {
|
93
|
+
id,
|
94
|
+
type: constants.ToolBarConstants.DropDownButton,
|
95
|
+
icon,
|
96
|
+
enable: false,
|
97
|
+
showArrowButton: true,
|
98
|
+
overflow: "never",
|
99
|
+
fillMode: "flat",
|
100
|
+
menuButtons: [
|
101
|
+
{ text: "Loading...", enabled: false }
|
102
|
+
]
|
103
|
+
};
|
104
|
+
case constants.ToolBarConstants.ButtonGroup:
|
105
|
+
const groupChildren = Array.from(elementData.children);
|
106
|
+
const buttonGroupButtons = [];
|
107
|
+
groupChildren.forEach((groupChild) => {
|
108
|
+
if (groupChild.dataset?.role !== constants.ToolBarConstants.Button && groupChild.dataset?.role !== constants.ToolBarConstants.ToggleButton) {
|
109
|
+
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.");
|
110
|
+
return;
|
111
|
+
}
|
112
|
+
buttonGroupButtons.push(this.createToolbarItem(groupChild));
|
113
|
+
});
|
114
|
+
return {
|
115
|
+
type: constants.ToolBarConstants.ButtonGroup,
|
116
|
+
buttons: buttonGroupButtons,
|
117
|
+
fillMode: "flat",
|
118
|
+
overflow: overflow ? overflow : "auto"
|
119
|
+
};
|
120
|
+
case constants.ToolBarConstants.Button:
|
121
|
+
case constants.ToolBarConstants.ToggleButton:
|
122
|
+
$(command).on("enabledChanged", (e, newState) => {
|
123
|
+
this._kendoToolbar.enable($(`button[${constants.ToolBarConstants.DataCommandAttr}="${cmdName}"]`), newState);
|
124
|
+
}).on("checkedChanged", (e, newState) => {
|
125
|
+
this._kendoToolbar.toggle($(`button[${constants.ToolBarConstants.DataCommandAttr}="${cmdName}"]`), newState);
|
126
|
+
});
|
127
|
+
return {
|
128
|
+
id,
|
129
|
+
type: constants.ToolBarConstants.Button,
|
130
|
+
text: title,
|
131
|
+
icon,
|
132
|
+
attributes: {
|
133
|
+
[constants.ToolBarConstants.DataCommandAttr]: cmdName,
|
134
|
+
[constants.ToolBarConstants.DataCommandParameterAttr]: cmdParam,
|
135
|
+
[constants.ToolBarConstants.AriaLabelAttr]: ariaLabel,
|
136
|
+
[constants.ToolBarConstants.TitleAttr]: title
|
137
|
+
},
|
138
|
+
fillMode: "flat",
|
139
|
+
togglable: role === constants.ToolBarConstants.ToggleButton,
|
140
|
+
overflow: overflow ? overflow : "auto",
|
141
|
+
showText: "overflow"
|
142
|
+
};
|
143
|
+
default:
|
144
|
+
console.error(`The data-role attribute is missing or not supported: ${role}`);
|
145
|
+
return {};
|
146
|
+
}
|
147
|
+
}
|
148
|
+
executeCommand(event) {
|
149
|
+
const cmdName = event.target.get(0)?.dataset.command || "";
|
150
|
+
const cmdParam = event.target.get(0)?.dataset.commandParameter || "";
|
151
|
+
if (!cmdName) {
|
152
|
+
return;
|
153
|
+
}
|
154
|
+
const cmdFn = this._options.commands[cmdName];
|
155
|
+
if (!cmdFn) {
|
156
|
+
console.error(`The provided data-command attribute is not present within the commands collection: ${cmdName}`);
|
157
|
+
return;
|
158
|
+
}
|
159
|
+
cmdFn.exec(cmdParam);
|
160
|
+
}
|
161
|
+
updateExportDropdownItems(extensions) {
|
162
|
+
const kendoExportDropDown = $(`#${constants.ToolBarConstants.ExportDropdownId}`).data("kendoDropDownButton");
|
163
|
+
if (!kendoExportDropDown) {
|
164
|
+
return;
|
165
|
+
}
|
166
|
+
if (!(extensions && extensions.length > 0)) {
|
167
|
+
console.warn("No extensions found - the export dropdown button will remain disabled.");
|
168
|
+
return;
|
169
|
+
}
|
170
|
+
const exportDropdownItems = [];
|
171
|
+
extensions.forEach((extension) => exportDropdownItems.push({
|
172
|
+
id: extension.name,
|
173
|
+
text: extension.localizedName,
|
174
|
+
attributes: {
|
175
|
+
[constants.ToolBarConstants.DataCommandAttr]: "export",
|
176
|
+
[constants.ToolBarConstants.DataCommandParameterAttr]: extension.name
|
177
|
+
}
|
178
|
+
}));
|
179
|
+
const options = kendoExportDropDown.options;
|
180
|
+
options.items = exportDropdownItems;
|
181
|
+
kendoExportDropDown.setOptions(options);
|
182
|
+
kendoExportDropDown.enable(true);
|
183
|
+
}
|
184
|
+
}
|
185
|
+
|
186
|
+
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
|
}
|