@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.
- package/README.md +1 -1
- package/dist/cjs/accessibility.js +208 -0
- package/dist/cjs/base-component.js +26 -0
- package/dist/cjs/binder.js +79 -0
- package/dist/cjs/command.js +32 -0
- package/dist/cjs/commandSet.js +167 -0
- package/dist/cjs/controller.js +1204 -0
- package/dist/cjs/documentMapArea.js +159 -0
- package/dist/cjs/domUtils.js +50 -0
- package/dist/cjs/enums.js +52 -0
- package/dist/cjs/event-emitter.js +131 -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 +323 -0
- package/dist/cjs/mem-storage.js +44 -0
- package/dist/cjs/pagesArea.js +622 -0
- package/dist/cjs/parameterValidators.js +164 -0
- package/dist/cjs/parameters.js +921 -0
- package/dist/cjs/parametersArea.js +486 -0
- package/dist/cjs/perspectives.js +138 -0
- package/dist/cjs/print.js +165 -0
- package/dist/cjs/report-viewer/report-viewer-settings.js +138 -0
- package/dist/cjs/reportViewer.js +665 -0
- package/dist/cjs/scroll.js +535 -0
- package/dist/cjs/search.js +584 -0
- package/dist/cjs/sendEmail.js +392 -0
- package/dist/cjs/service-client-sentinel.js +52 -0
- package/dist/cjs/serviceClient.js +311 -0
- package/dist/cjs/sideMenu.js +216 -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/toolbar/link-button.js +42 -0
- package/dist/cjs/toolbar/page-count-label.js +18 -0
- package/dist/cjs/toolbar/page-number-input.js +64 -0
- package/dist/cjs/touch.js +86 -0
- package/dist/cjs/uiController.js +142 -0
- package/dist/cjs/uiFreezeCoordinator.js +282 -0
- package/dist/cjs/utils.js +489 -0
- package/dist/es/accessibility.js +204 -0
- package/dist/es/base-component.js +22 -0
- package/dist/es/binder.js +75 -0
- package/dist/es/command.js +28 -0
- package/dist/es/commandSet.js +163 -0
- package/dist/es/controller.js +1200 -0
- package/dist/es/documentMapArea.js +155 -0
- package/dist/es/domUtils.js +43 -0
- package/dist/es/enums.js +41 -0
- package/dist/es/event-emitter.js +127 -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 +319 -0
- package/dist/es/mem-storage.js +40 -0
- package/dist/es/pagesArea.js +618 -0
- package/dist/es/parameterValidators.js +160 -0
- package/dist/es/parameters.js +916 -0
- package/dist/es/parametersArea.js +482 -0
- package/dist/es/perspectives.js +134 -0
- package/dist/es/print.js +161 -0
- package/dist/es/report-viewer/report-viewer-settings.js +134 -0
- package/dist/es/reportViewer.js +661 -0
- package/dist/es/scroll.js +531 -0
- package/dist/es/search.js +580 -0
- package/dist/es/sendEmail.js +388 -0
- package/dist/es/service-client-sentinel.js +48 -0
- package/dist/es/serviceClient.js +307 -0
- package/dist/es/sideMenu.js +212 -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/toolbar/link-button.js +38 -0
- package/dist/es/toolbar/page-count-label.js +14 -0
- package/dist/es/toolbar/page-number-input.js +60 -0
- package/dist/es/touch.js +82 -0
- package/dist/es/uiController.js +138 -0
- package/dist/es/uiFreezeCoordinator.js +278 -0
- package/dist/es/utils.js +444 -0
- package/dist/font/font-icons.css +4 -4
- package/dist/font/font-icons.min.css +3 -3
- package/dist/js/telerikReportViewer.js +8346 -8507
- package/dist/js/telerikReportViewer.min.js +1 -17
- package/dist/js/telerikReportViewer.stringResources.js +166 -173
- package/dist/styles/telerikReportViewer.css +3 -3
- package/dist/styles/telerikReportViewer.min.css +3 -3
- package/dist/templates/telerikReportViewerTemplate-FA.html +4 -4
- package/dist/templates/telerikReportViewerTemplate.html +6 -6
- package/package.json +14 -7
- /package/dist/font/{ReportingIcons-18.0.24.305.ttf → ReportingIcons-18.1.24.709.ttf} +0 -0
@@ -0,0 +1,75 @@
|
|
1
|
+
import { GlobalSettings } from './globalSettings.js';
|
2
|
+
|
3
|
+
class Binder {
|
4
|
+
static bind($element, ...args) {
|
5
|
+
const commands = args[0].commands;
|
6
|
+
const viewerOptions = args[1];
|
7
|
+
Binder.attachCommands($element, commands, viewerOptions);
|
8
|
+
var plugins = $element.find('[data-role^="telerik_ReportViewer_"]');
|
9
|
+
Array.from(plugins).forEach((element) => {
|
10
|
+
var $element2 = $(element);
|
11
|
+
var fn = $.fn[$element2.attr("data-role")];
|
12
|
+
if (typeof fn === "function") {
|
13
|
+
fn.apply($element2, args);
|
14
|
+
}
|
15
|
+
});
|
16
|
+
}
|
17
|
+
static attachCommands($element, commands, viewerOptions) {
|
18
|
+
var elementSelector = '[data-command^="telerik_ReportViewer_"]';
|
19
|
+
var customElementSelector = "[data-target-report-viewer]" + elementSelector;
|
20
|
+
$element.on("click", elementSelector, commandHandler);
|
21
|
+
if (!GlobalSettings.CommandHandlerAttached) {
|
22
|
+
$(document.body).on("click", customElementSelector, customCommandHandler);
|
23
|
+
GlobalSettings.CommandHandlerAttached = true;
|
24
|
+
}
|
25
|
+
Object.entries(commands).forEach(([key, command]) => {
|
26
|
+
attachCommand(key, command, viewerOptions, $element);
|
27
|
+
});
|
28
|
+
function commandHandler(event) {
|
29
|
+
var prefixedDataCommand = $(this).attr("data-command");
|
30
|
+
if (prefixedDataCommand) {
|
31
|
+
var dataCommand = prefixedDataCommand.substring("telerik_ReportViewer_".length);
|
32
|
+
var cmd = commands[dataCommand];
|
33
|
+
if (cmd && cmd.enabled()) {
|
34
|
+
cmd.exec($(this).attr("data-command-parameter"));
|
35
|
+
}
|
36
|
+
event.preventDefault();
|
37
|
+
}
|
38
|
+
}
|
39
|
+
function customCommandHandler(event) {
|
40
|
+
var $this = $(this);
|
41
|
+
var prefixedDataCommand = $this.attr("data-command");
|
42
|
+
var reportViewerTarget = $this.attr("data-target-report-viewer");
|
43
|
+
if (prefixedDataCommand && reportViewerTarget) {
|
44
|
+
var dataCommand = prefixedDataCommand.substring("telerik_ReportViewer_".length);
|
45
|
+
var reportViewer = $(reportViewerTarget).data("telerik_ReportViewer");
|
46
|
+
var cmd = reportViewer.commands[dataCommand];
|
47
|
+
if (cmd.enabled()) {
|
48
|
+
cmd.exec($(this).attr("data-command-parameter"));
|
49
|
+
}
|
50
|
+
event.preventDefault();
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
function attachCommand(dataCommand, cmd, viewerOptions, $element) {
|
56
|
+
if (cmd) {
|
57
|
+
var elementSelector = '[data-command="telerik_ReportViewer_' + dataCommand + '"]';
|
58
|
+
var customElementSelector = '[data-target-report-viewer="' + viewerOptions.selector + '"]' + elementSelector;
|
59
|
+
var $defaultElement = $element.find(elementSelector);
|
60
|
+
var $customElement = $(customElementSelector);
|
61
|
+
$(cmd).on("enabledChanged", function(event) {
|
62
|
+
(cmd.enabled() ? $.fn.removeClass : $.fn.addClass).call($defaultElement.parent("li"), "k-disabled");
|
63
|
+
(cmd.enabled() ? $.fn.removeClass : $.fn.addClass).call($customElement, viewerOptions.disabledButtonClass);
|
64
|
+
}).on("checkedChanged", function(event) {
|
65
|
+
var defaultTarget = $defaultElement.parent("li");
|
66
|
+
(cmd.checked() ? $.fn.addClass : $.fn.removeClass).call(defaultTarget, getSelectedClassName(defaultTarget));
|
67
|
+
(cmd.checked() ? $.fn.addClass : $.fn.removeClass).call($customElement, viewerOptions.checkedButtonClass);
|
68
|
+
});
|
69
|
+
}
|
70
|
+
}
|
71
|
+
function getSelectedClassName($element) {
|
72
|
+
return $element.hasClass("trv-menu-toggleable") ? "k-selected !k-bg-primary" : "k-selected";
|
73
|
+
}
|
74
|
+
|
75
|
+
export { Binder };
|
@@ -0,0 +1,28 @@
|
|
1
|
+
function Command(execCallback) {
|
2
|
+
var enabledState = true;
|
3
|
+
var checkedState = false;
|
4
|
+
var cmd = {
|
5
|
+
enabled: function(state) {
|
6
|
+
if (arguments.length === 0) {
|
7
|
+
return enabledState;
|
8
|
+
}
|
9
|
+
var newState = Boolean(state);
|
10
|
+
enabledState = newState;
|
11
|
+
$(this).trigger("enabledChanged");
|
12
|
+
return cmd;
|
13
|
+
},
|
14
|
+
checked: function(state) {
|
15
|
+
if (arguments.length === 0) {
|
16
|
+
return checkedState;
|
17
|
+
}
|
18
|
+
var newState = Boolean(state);
|
19
|
+
checkedState = newState;
|
20
|
+
$(this).trigger("checkedChanged");
|
21
|
+
return cmd;
|
22
|
+
},
|
23
|
+
exec: execCallback
|
24
|
+
};
|
25
|
+
return cmd;
|
26
|
+
}
|
27
|
+
|
28
|
+
export { Command };
|
@@ -0,0 +1,163 @@
|
|
1
|
+
import { ScaleModes, PageModes, ViewModes } from './enums.js';
|
2
|
+
import { Command } from './command.js';
|
3
|
+
|
4
|
+
var scaleTransitionMap = {};
|
5
|
+
scaleTransitionMap[ScaleModes.FIT_PAGE] = { scaleMode: ScaleModes.FIT_PAGE_WIDTH };
|
6
|
+
scaleTransitionMap[ScaleModes.FIT_PAGE_WIDTH] = { scaleMode: ScaleModes.SPECIFIC, scale: 1 };
|
7
|
+
scaleTransitionMap[ScaleModes.SPECIFIC] = { scaleMode: ScaleModes.FIT_PAGE };
|
8
|
+
var scaleValues = [0.1, 0.25, 0.5, 0.75, 1, 1.5, 2, 4, 8];
|
9
|
+
function CommandSet(options) {
|
10
|
+
var controller = options.controller;
|
11
|
+
if (!controller) {
|
12
|
+
throw "No options.controller.";
|
13
|
+
}
|
14
|
+
var historyManager = options.history;
|
15
|
+
if (!historyManager) {
|
16
|
+
throw "No options.history.";
|
17
|
+
}
|
18
|
+
function getDocumentMapVisible() {
|
19
|
+
var args = {};
|
20
|
+
controller.getDocumentMapState(args);
|
21
|
+
return Boolean(args.visible);
|
22
|
+
}
|
23
|
+
function getParametersAreaVisible() {
|
24
|
+
var args = {};
|
25
|
+
controller.getParametersAreaState(args);
|
26
|
+
return Boolean(args.visible);
|
27
|
+
}
|
28
|
+
function getSideMenuVisible() {
|
29
|
+
var args = {};
|
30
|
+
controller.getSideMenuVisible(args);
|
31
|
+
return Boolean(args.visible);
|
32
|
+
}
|
33
|
+
function getSearchDialogVisible() {
|
34
|
+
var args = {};
|
35
|
+
controller.getSearchDialogState(args);
|
36
|
+
return Boolean(args.visible);
|
37
|
+
}
|
38
|
+
function getSendEmailDialogVisible() {
|
39
|
+
var args = {};
|
40
|
+
controller.getSendEmailDialogState(args);
|
41
|
+
return Boolean(args.visible);
|
42
|
+
}
|
43
|
+
return {
|
44
|
+
"historyBack": new Command(function() {
|
45
|
+
historyManager.back();
|
46
|
+
}),
|
47
|
+
"historyForward": new Command(function() {
|
48
|
+
historyManager.forward();
|
49
|
+
}),
|
50
|
+
"stopRendering": new Command(function() {
|
51
|
+
controller.stopRendering();
|
52
|
+
}),
|
53
|
+
"goToPrevPage": new Command(function() {
|
54
|
+
controller.navigateToPage(controller.getCurrentPageNumber() - 1);
|
55
|
+
}),
|
56
|
+
"goToNextPage": new Command(function() {
|
57
|
+
controller.navigateToPage(controller.getCurrentPageNumber() + 1);
|
58
|
+
}),
|
59
|
+
"goToFirstPage": new Command(function() {
|
60
|
+
controller.navigateToPage(1);
|
61
|
+
}),
|
62
|
+
"goToLastPage": new Command(function() {
|
63
|
+
controller.navigateToPage(controller.getPageCount());
|
64
|
+
}),
|
65
|
+
"goToPage": new Command(function(pageNumber) {
|
66
|
+
if (!isNaN(pageNumber)) {
|
67
|
+
var pageCount = controller.getPageCount();
|
68
|
+
if (pageNumber > pageCount) {
|
69
|
+
pageNumber = pageCount;
|
70
|
+
} else if (pageNumber < 1) {
|
71
|
+
pageNumber = 1;
|
72
|
+
}
|
73
|
+
controller.navigateToPage(pageNumber);
|
74
|
+
return pageNumber;
|
75
|
+
}
|
76
|
+
}),
|
77
|
+
"refresh": new Command(
|
78
|
+
function() {
|
79
|
+
controller.refreshReport(true);
|
80
|
+
}
|
81
|
+
),
|
82
|
+
"export": new Command(function(format) {
|
83
|
+
if (format) {
|
84
|
+
controller.exportReport(format);
|
85
|
+
}
|
86
|
+
}),
|
87
|
+
"print": new Command(function() {
|
88
|
+
controller.printReport();
|
89
|
+
}),
|
90
|
+
"pageMode": new Command(function() {
|
91
|
+
controller.setPageMode(
|
92
|
+
controller.getPageMode() === PageModes.SINGLE_PAGE ? PageModes.CONTINUOUS_SCROLL : PageModes.SINGLE_PAGE
|
93
|
+
);
|
94
|
+
}),
|
95
|
+
"togglePrintPreview": new Command(function() {
|
96
|
+
controller.setViewMode(
|
97
|
+
controller.getViewMode() === ViewModes.PRINT_PREVIEW ? ViewModes.INTERACTIVE : ViewModes.PRINT_PREVIEW
|
98
|
+
);
|
99
|
+
}),
|
100
|
+
"toggleDocumentMap": new Command(function() {
|
101
|
+
controller.setDocumentMapVisible({ visible: !getDocumentMapVisible() });
|
102
|
+
}),
|
103
|
+
"toggleParametersArea": new Command(function() {
|
104
|
+
controller.setParametersAreaVisible({ visible: !getParametersAreaVisible() });
|
105
|
+
}),
|
106
|
+
"zoom": new Command(function(scale) {
|
107
|
+
controller.setScale(scale);
|
108
|
+
}),
|
109
|
+
"zoomIn": new Command(function() {
|
110
|
+
zoom(1);
|
111
|
+
}),
|
112
|
+
"zoomOut": new Command(function() {
|
113
|
+
zoom(-1);
|
114
|
+
}),
|
115
|
+
"toggleSideMenu": new Command(function() {
|
116
|
+
controller.setSideMenuVisible({ visible: !getSideMenuVisible() });
|
117
|
+
}),
|
118
|
+
"toggleZoomMode": new Command(function(e) {
|
119
|
+
var scale = controller.getScale();
|
120
|
+
var scaleMode = controller.getScaleMode();
|
121
|
+
controller.setScale(scaleTransitionMap[scaleMode].scale || scale);
|
122
|
+
controller.setScaleMode(scaleTransitionMap[scaleMode].scaleMode);
|
123
|
+
}),
|
124
|
+
"toggleSearchDialog": new Command(function() {
|
125
|
+
controller.setSearchDialogVisible({ visible: !getSearchDialogVisible() });
|
126
|
+
}),
|
127
|
+
"toggleSendEmailDialog": new Command(function() {
|
128
|
+
controller.setSendEmailDialogVisible({ visible: !getSendEmailDialogVisible() });
|
129
|
+
})
|
130
|
+
};
|
131
|
+
function zoom(step) {
|
132
|
+
controller.setScale(getZoomScale(controller.getScale(), step));
|
133
|
+
}
|
134
|
+
function getZoomScale(scale, steps) {
|
135
|
+
var pos = -1;
|
136
|
+
var length = scaleValues.length;
|
137
|
+
for (var i = 0; i < length; i++) {
|
138
|
+
var value = scaleValues[i];
|
139
|
+
if (scale < value) {
|
140
|
+
pos = i - 0.5;
|
141
|
+
break;
|
142
|
+
}
|
143
|
+
if (scale === value) {
|
144
|
+
pos = i;
|
145
|
+
break;
|
146
|
+
}
|
147
|
+
}
|
148
|
+
pos = pos + steps;
|
149
|
+
if (steps >= 0) {
|
150
|
+
pos = Math.round(pos - 0.49);
|
151
|
+
} else {
|
152
|
+
pos = Math.round(pos + 0.49);
|
153
|
+
}
|
154
|
+
if (pos < 0) {
|
155
|
+
pos = 0;
|
156
|
+
} else if (pos > length - 1) {
|
157
|
+
pos = length - 1;
|
158
|
+
}
|
159
|
+
return scaleValues[pos];
|
160
|
+
}
|
161
|
+
}
|
162
|
+
|
163
|
+
export { CommandSet };
|