@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,155 @@
|
|
1
|
+
import { stringResources } from './stringResources.js';
|
2
|
+
import { DocumentMapAreaPositions } from './enums.js';
|
3
|
+
import { GlobalSettings } from './globalSettings.js';
|
4
|
+
|
5
|
+
var defaultOptions = {};
|
6
|
+
function DocumentMapArea(placeholder, options, otherOptions) {
|
7
|
+
options = $.extend({}, defaultOptions, options, otherOptions);
|
8
|
+
var controller = options.controller;
|
9
|
+
if (!controller) {
|
10
|
+
throw "No controller (telerikReporting.reportViewerController) has been specified.";
|
11
|
+
}
|
12
|
+
var $placeholder = $(placeholder);
|
13
|
+
var $documentMap;
|
14
|
+
var documentMapVisible = options.documentMapVisible !== false;
|
15
|
+
var enableAccessibility = options.enableAccessibility;
|
16
|
+
var currentReport = null;
|
17
|
+
var documentMapNecessary = false;
|
18
|
+
init();
|
19
|
+
function init() {
|
20
|
+
$documentMap = $('<div id="' + options.viewerSelector + '-documentMap"></div>');
|
21
|
+
$documentMap.appendTo(placeholder);
|
22
|
+
attach();
|
23
|
+
replaceStringResources($placeholder);
|
24
|
+
}
|
25
|
+
function onTreeViewSelectionChanged(e) {
|
26
|
+
var documentMapNode = this.dataItem(e.node);
|
27
|
+
var page = documentMapNode.page;
|
28
|
+
var id = documentMapNode.id;
|
29
|
+
controller.navigateToPage(page, {
|
30
|
+
type: "bookmark",
|
31
|
+
id
|
32
|
+
});
|
33
|
+
}
|
34
|
+
function onTreeViewNodeExpand(e) {
|
35
|
+
if (enableAccessibility) {
|
36
|
+
window.setTimeout(function() {
|
37
|
+
setNodeAccessibilityAttributes(e.node);
|
38
|
+
}, 100);
|
39
|
+
}
|
40
|
+
}
|
41
|
+
function setNodeAccessibilityAttributes(node) {
|
42
|
+
var $items = $(node).find("li");
|
43
|
+
Array.from($items).forEach((item) => {
|
44
|
+
var $li = $(item);
|
45
|
+
$li.attr("aria-label", $li[0].innerText);
|
46
|
+
});
|
47
|
+
}
|
48
|
+
function clearDocumentMap() {
|
49
|
+
displayDocumentMap([]);
|
50
|
+
}
|
51
|
+
function displayDocumentMap(documentMap) {
|
52
|
+
var hasDocumentMap = documentMap && !$.isEmptyObject(documentMap);
|
53
|
+
var $treeView = $documentMap.data("kendoTreeView");
|
54
|
+
if (!$treeView) {
|
55
|
+
try {
|
56
|
+
$documentMap.kendoTreeView({
|
57
|
+
dataTextField: "text",
|
58
|
+
select: onTreeViewSelectionChanged
|
59
|
+
});
|
60
|
+
$treeView = $documentMap.data("kendoTreeView");
|
61
|
+
} catch (e) {
|
62
|
+
console.error("Instantiation of Kendo TreeView as Document Map threw an exception", e);
|
63
|
+
throw e;
|
64
|
+
}
|
65
|
+
}
|
66
|
+
$treeView.setDataSource(documentMap);
|
67
|
+
if (enableAccessibility) {
|
68
|
+
setAccessibilityAttributes($treeView);
|
69
|
+
}
|
70
|
+
showDocumentMap(hasDocumentMap);
|
71
|
+
}
|
72
|
+
function setAccessibilityAttributes(treeView) {
|
73
|
+
treeView.bind("expand", onTreeViewNodeExpand);
|
74
|
+
treeView.element.attr("aria-label", stringResources.ariaLabelDocumentMap);
|
75
|
+
var listItems = treeView.element.find("ul");
|
76
|
+
Array.from(listItems).forEach((list) => {
|
77
|
+
setNodeAccessibilityAttributes(list);
|
78
|
+
});
|
79
|
+
if (documentMapNecessary) {
|
80
|
+
setSplitbarAccessibilityAttributes();
|
81
|
+
}
|
82
|
+
}
|
83
|
+
function setSplitbarAccessibilityAttributes() {
|
84
|
+
var splitbar = $placeholder.next();
|
85
|
+
if (options.documentMapAreaPosition === DocumentMapAreaPositions.RIGHT) {
|
86
|
+
splitbar = $placeholder.prev();
|
87
|
+
}
|
88
|
+
splitbar.attr("aria-label", stringResources.ariaLabelDocumentMapSplitter);
|
89
|
+
}
|
90
|
+
function isVisible() {
|
91
|
+
var args = {};
|
92
|
+
controller.getDocumentMapState(args);
|
93
|
+
return args.visible;
|
94
|
+
}
|
95
|
+
function beginLoad() {
|
96
|
+
$placeholder.addClass("trv-loading");
|
97
|
+
}
|
98
|
+
function endLoad() {
|
99
|
+
$placeholder.removeClass("trv-loading");
|
100
|
+
}
|
101
|
+
function showDocumentMap(show) {
|
102
|
+
var splitter = GlobalSettings.viewerInstances.find((element) => element.id === options.viewerSelector + "-document-map-splitter").instance;
|
103
|
+
var sibling = $placeholder.next();
|
104
|
+
if (options.documentMapAreaPosition === DocumentMapAreaPositions.RIGHT) {
|
105
|
+
sibling = $placeholder.prev();
|
106
|
+
}
|
107
|
+
if (splitter) {
|
108
|
+
(documentMapNecessary ? $.fn.removeClass : $.fn.addClass).call(sibling, "trv-hidden");
|
109
|
+
splitter.toggle(".trv-document-map", show);
|
110
|
+
}
|
111
|
+
}
|
112
|
+
function attach() {
|
113
|
+
controller.beginLoadReport(function() {
|
114
|
+
beginLoad();
|
115
|
+
var r = controller.getReportSource().report;
|
116
|
+
var clearMapItems = currentReport !== r || !isVisible();
|
117
|
+
currentReport = r;
|
118
|
+
if (clearMapItems) {
|
119
|
+
clearDocumentMap();
|
120
|
+
}
|
121
|
+
}).reportLoadComplete(function(event, args) {
|
122
|
+
if (args.documentMapAvailable) {
|
123
|
+
documentMapNecessary = true;
|
124
|
+
displayDocumentMap(args.documentMapNodes);
|
125
|
+
controller.setDocumentMapVisible({ enabled: true, visible: documentMapVisible });
|
126
|
+
} else {
|
127
|
+
documentMapNecessary = false;
|
128
|
+
showDocumentMap(documentMapNecessary);
|
129
|
+
}
|
130
|
+
endLoad();
|
131
|
+
}).error(function(event, error) {
|
132
|
+
endLoad();
|
133
|
+
clearDocumentMap();
|
134
|
+
}).renderingStopped(function() {
|
135
|
+
documentMapNecessary = false;
|
136
|
+
showDocumentMap(false);
|
137
|
+
});
|
138
|
+
controller.setDocumentMapVisible(function(event, args) {
|
139
|
+
documentMapVisible = args.visible;
|
140
|
+
showDocumentMap(documentMapVisible && documentMapNecessary);
|
141
|
+
}).getDocumentMapState(function(event, args) {
|
142
|
+
args.enabled = documentMapNecessary;
|
143
|
+
args.visible = documentMapVisible;
|
144
|
+
});
|
145
|
+
}
|
146
|
+
function replaceStringResources($documentMap2) {
|
147
|
+
var $documentMapOverlay = $documentMap2.find(".trv-document-map-overlay");
|
148
|
+
if (!$documentMapOverlay) {
|
149
|
+
return;
|
150
|
+
}
|
151
|
+
$documentMapOverlay.attr("aria-label", stringResources[$documentMapOverlay.attr("aria-label")]);
|
152
|
+
}
|
153
|
+
}
|
154
|
+
|
155
|
+
export { DocumentMapArea };
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import { stringFormat } from './utils.js';
|
2
|
+
|
3
|
+
function toPixels(value) {
|
4
|
+
return parseInt(value, 10) || 0;
|
5
|
+
}
|
6
|
+
function getMargins(dom) {
|
7
|
+
var $target = $(dom);
|
8
|
+
return {
|
9
|
+
left: toPixels($target.css("marginLeft")),
|
10
|
+
right: toPixels($target.css("marginRight")),
|
11
|
+
top: toPixels($target.css("marginTop")),
|
12
|
+
bottom: toPixels($target.css("marginBottom"))
|
13
|
+
};
|
14
|
+
}
|
15
|
+
function getPadding(dom) {
|
16
|
+
var $target = $(dom);
|
17
|
+
return {
|
18
|
+
left: toPixels($target.css("paddingLeft")),
|
19
|
+
right: toPixels($target.css("paddingRight")),
|
20
|
+
top: toPixels($target.css("paddingTop")),
|
21
|
+
bottom: toPixels($target.css("paddingBottom"))
|
22
|
+
};
|
23
|
+
}
|
24
|
+
function getBorderWidth(dom) {
|
25
|
+
var $target = $(dom);
|
26
|
+
return {
|
27
|
+
left: toPixels($target.css("borderLeftWidth")),
|
28
|
+
right: toPixels($target.css("borderRightWidth")),
|
29
|
+
top: toPixels($target.css("borderTopWidth")),
|
30
|
+
bottom: toPixels($target.css("borderBottomWidth"))
|
31
|
+
};
|
32
|
+
}
|
33
|
+
function scale(dom, scaleX, scaleY, originX, originY) {
|
34
|
+
scaleX = scaleX || 1;
|
35
|
+
scaleY = scaleY || 1;
|
36
|
+
originX = originX || 0;
|
37
|
+
originY = originY || 0;
|
38
|
+
var scale2 = stringFormat("scale({0}, {1})", [scaleX, scaleY]);
|
39
|
+
var origin = stringFormat("{0} {1}", [originX, originY]);
|
40
|
+
$(dom).css("transform", scale2).css("transform-origin", origin);
|
41
|
+
}
|
42
|
+
|
43
|
+
export { getBorderWidth, getMargins, getPadding, scale };
|
package/dist/es/enums.js
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
const ViewModes = {
|
2
|
+
INTERACTIVE: "INTERACTIVE",
|
3
|
+
PRINT_PREVIEW: "PRINT_PREVIEW"
|
4
|
+
};
|
5
|
+
const PrintModes = {
|
6
|
+
AUTO_SELECT: "AUTO_SELECT",
|
7
|
+
FORCE_PDF_PLUGIN: "FORCE_PDF_PLUGIN",
|
8
|
+
FORCE_PDF_FILE: "FORCE_PDF_FILE"
|
9
|
+
};
|
10
|
+
const PageModes = {
|
11
|
+
SINGLE_PAGE: "SINGLE_PAGE",
|
12
|
+
CONTINUOUS_SCROLL: "CONTINUOUS_SCROLL"
|
13
|
+
};
|
14
|
+
const ScaleModes = {
|
15
|
+
FIT_PAGE_WIDTH: "FIT_PAGE_WIDTH",
|
16
|
+
FIT_PAGE: "FIT_PAGE",
|
17
|
+
SPECIFIC: "SPECIFIC"
|
18
|
+
};
|
19
|
+
const ParameterTypes = {
|
20
|
+
INTEGER: "System.Int64",
|
21
|
+
FLOAT: "System.Double",
|
22
|
+
STRING: "System.String",
|
23
|
+
DATETIME: "System.DateTime",
|
24
|
+
BOOLEAN: "System.Boolean"
|
25
|
+
};
|
26
|
+
const ParameterEditorTypes = {
|
27
|
+
COMBO_BOX: "COMBO_BOX",
|
28
|
+
LIST_VIEW: "LIST_VIEW"
|
29
|
+
};
|
30
|
+
const ParametersAreaPositions = {
|
31
|
+
RIGHT: "RIGHT",
|
32
|
+
LEFT: "LEFT",
|
33
|
+
TOP: "TOP",
|
34
|
+
BOTTOM: "BOTTOM"
|
35
|
+
};
|
36
|
+
const DocumentMapAreaPositions = {
|
37
|
+
RIGHT: "RIGHT",
|
38
|
+
LEFT: "LEFT"
|
39
|
+
};
|
40
|
+
|
41
|
+
export { DocumentMapAreaPositions, PageModes, ParameterEditorTypes, ParameterTypes, ParametersAreaPositions, PrintModes, ScaleModes, ViewModes };
|
@@ -0,0 +1,127 @@
|
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
3
|
+
var __publicField = (obj, key, value) => {
|
4
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
5
|
+
return value;
|
6
|
+
};
|
7
|
+
class EventEmitter extends EventTarget {
|
8
|
+
constructor() {
|
9
|
+
super();
|
10
|
+
__publicField(this, "_events");
|
11
|
+
__publicField(this, "_eventsCount");
|
12
|
+
this._events = {};
|
13
|
+
this._eventsCount = 0;
|
14
|
+
}
|
15
|
+
/**
|
16
|
+
* @param {string} type
|
17
|
+
* @param {(event: CustomEvent, ...args: any[]) => void} listener
|
18
|
+
* @returns
|
19
|
+
*/
|
20
|
+
addListener(type, listener) {
|
21
|
+
if (typeof listener !== "function") {
|
22
|
+
throw new TypeError("listener must be a function");
|
23
|
+
}
|
24
|
+
if (!this._events[type]) {
|
25
|
+
this._events[type] = [];
|
26
|
+
}
|
27
|
+
function wrappedListener(event) {
|
28
|
+
listener.call(this, event, ...event.detail);
|
29
|
+
}
|
30
|
+
wrappedListener.listener = listener;
|
31
|
+
this._events[type].push(wrappedListener);
|
32
|
+
this._eventsCount++;
|
33
|
+
this.addEventListener(type, wrappedListener.bind(this));
|
34
|
+
return this;
|
35
|
+
}
|
36
|
+
/**
|
37
|
+
* @alias addListener
|
38
|
+
* @param {string} type
|
39
|
+
* @param {(event: CustomEvent, ...args: any[]) => void} listener
|
40
|
+
* @returns
|
41
|
+
*/
|
42
|
+
on(type, listener) {
|
43
|
+
return this.addListener(type, listener);
|
44
|
+
}
|
45
|
+
/**
|
46
|
+
* @param {string} type
|
47
|
+
* @param {any[]} args
|
48
|
+
* @returns
|
49
|
+
*/
|
50
|
+
trigger(type, ...args) {
|
51
|
+
if (!this._events[type]) {
|
52
|
+
return void 0;
|
53
|
+
}
|
54
|
+
const event = new CustomEvent(type, {
|
55
|
+
detail: args,
|
56
|
+
cancelable: true
|
57
|
+
});
|
58
|
+
return this.dispatchEvent(event);
|
59
|
+
}
|
60
|
+
/**
|
61
|
+
* @alias trigger
|
62
|
+
* @param {string} type
|
63
|
+
* @param {any[]} args
|
64
|
+
* @returns
|
65
|
+
*/
|
66
|
+
emit(type, ...args) {
|
67
|
+
return this.trigger(type, ...args);
|
68
|
+
}
|
69
|
+
/**
|
70
|
+
* @param {string} type
|
71
|
+
* @param {(event: CustomEvent, ...args: any[]) => void} listener
|
72
|
+
* @returns
|
73
|
+
*/
|
74
|
+
removeListener(type, listener) {
|
75
|
+
if (!this._events[type]) {
|
76
|
+
return this;
|
77
|
+
}
|
78
|
+
this._events[type] = this._events[type].filter((wrappedListener) => {
|
79
|
+
if (wrappedListener.listener !== listener) {
|
80
|
+
return true;
|
81
|
+
}
|
82
|
+
this.removeEventListener(type, wrappedListener);
|
83
|
+
return false;
|
84
|
+
});
|
85
|
+
if (this._events[type].length === 0) {
|
86
|
+
delete this._events[type];
|
87
|
+
this._eventsCount--;
|
88
|
+
}
|
89
|
+
return this;
|
90
|
+
}
|
91
|
+
/**
|
92
|
+
* @param {string} type
|
93
|
+
* @returns
|
94
|
+
*/
|
95
|
+
removeAllListeners(type) {
|
96
|
+
if (type === void 0) {
|
97
|
+
Object.keys(this._events).forEach((eventType) => {
|
98
|
+
this.removeAllListeners(eventType);
|
99
|
+
});
|
100
|
+
return this;
|
101
|
+
}
|
102
|
+
if (this._events[type]) {
|
103
|
+
this._events[type].forEach((wrappedListener) => {
|
104
|
+
this.removeEventListener(type, wrappedListener);
|
105
|
+
});
|
106
|
+
delete this._events[type];
|
107
|
+
this._eventsCount--;
|
108
|
+
}
|
109
|
+
return this;
|
110
|
+
}
|
111
|
+
/**
|
112
|
+
* @param {string} type
|
113
|
+
* @param {(event: CustomEvent, ...args: any[]) => void} listener
|
114
|
+
* @returns
|
115
|
+
*/
|
116
|
+
off(type, listener) {
|
117
|
+
if (type === void 0) {
|
118
|
+
return this.removeAllListeners();
|
119
|
+
}
|
120
|
+
if (listener === void 0) {
|
121
|
+
return this.removeAllListeners(type);
|
122
|
+
}
|
123
|
+
return this.removeListener(type, listener);
|
124
|
+
}
|
125
|
+
}
|
126
|
+
|
127
|
+
export { EventEmitter };
|
@@ -0,0 +1,19 @@
|
|
1
|
+
const Events = {
|
2
|
+
EXPORT_BEGIN: "EXPORT_BEGIN",
|
3
|
+
EXPORT_END: "EXPORT_END",
|
4
|
+
PRINT_BEGIN: "PRINT_BEGIN",
|
5
|
+
PRINT_END: "PRINT_END",
|
6
|
+
RENDERING_BEGIN: "RENDERING_BEGIN",
|
7
|
+
RENDERING_END: "RENDERING_END",
|
8
|
+
PAGE_READY: "PAGE_READY",
|
9
|
+
ERROR: "ERROR",
|
10
|
+
UPDATE_UI: "UPDATE_UI",
|
11
|
+
INTERACTIVE_ACTION_EXECUTING: "INTERACTIVE_ACTION_EXECUTING",
|
12
|
+
INTERACTIVE_ACTION_ENTER: "INTERACTIVE_ACTION_ENTER",
|
13
|
+
INTERACTIVE_ACTION_LEAVE: "INTERACTIVE_ACTION_LEAVE",
|
14
|
+
VIEWER_TOOLTIP_OPENING: "VIEWER_TOOLTIP_OPENING",
|
15
|
+
SEND_EMAIL_BEGIN: "SEND_EMAIL_BEGIN",
|
16
|
+
SEND_EMAIL_END: "SEND_EMAIL_END"
|
17
|
+
};
|
18
|
+
|
19
|
+
export { Events };
|
@@ -0,0 +1,127 @@
|
|
1
|
+
import { reportSourcesAreEqual } from './utils.js';
|
2
|
+
|
3
|
+
function HistoryManager(options) {
|
4
|
+
var controller = options.controller;
|
5
|
+
if (!controller) {
|
6
|
+
throw "No controller (telerikReporting.reportViewerController) has been specified.";
|
7
|
+
}
|
8
|
+
var settings = options.settings;
|
9
|
+
var history = settings.getHistory() || { records: [], position: -1 };
|
10
|
+
controller.loadedReportChange(function() {
|
11
|
+
addToHistory(true);
|
12
|
+
}).currentPageChanged(function() {
|
13
|
+
updatePageInfo();
|
14
|
+
}).reportLoadComplete(function(event, args) {
|
15
|
+
addToHistory(false);
|
16
|
+
}).clientExpired(function() {
|
17
|
+
var records = history.records;
|
18
|
+
for (var i = 0; i < records.length; i++) {
|
19
|
+
records[i].reportDocumentId = null;
|
20
|
+
}
|
21
|
+
});
|
22
|
+
function getCurrentRecord() {
|
23
|
+
var records = history.records;
|
24
|
+
if (records.length > 0) {
|
25
|
+
return records[history.position];
|
26
|
+
}
|
27
|
+
return null;
|
28
|
+
}
|
29
|
+
function pushRecord(rec) {
|
30
|
+
var records = history.records;
|
31
|
+
var position = history.position;
|
32
|
+
records = Array.prototype.slice.call(records, 0, position + 1);
|
33
|
+
records.push(rec);
|
34
|
+
history.records = records;
|
35
|
+
history.position = records.length - 1;
|
36
|
+
saveSettings();
|
37
|
+
}
|
38
|
+
function saveSettings() {
|
39
|
+
settings.setHistory(history);
|
40
|
+
}
|
41
|
+
function updatePageInfo() {
|
42
|
+
var currentRecord = getCurrentRecord();
|
43
|
+
if (currentRecord) {
|
44
|
+
currentRecord.pageNumber = controller.getCurrentPageNumber();
|
45
|
+
currentRecord.viewMode = controller.getViewMode();
|
46
|
+
currentRecord.reportDocumentId = controller.getReportDocumentId();
|
47
|
+
saveSettings();
|
48
|
+
}
|
49
|
+
}
|
50
|
+
function addToHistory(temp) {
|
51
|
+
removeTempRecordsFromHistory();
|
52
|
+
var currentRecord = getCurrentRecord();
|
53
|
+
var rs = controller.getReportSource();
|
54
|
+
if (!currentRecord || !reportSourcesAreEqual(currentRecord.reportSource, rs)) {
|
55
|
+
pushRecord({
|
56
|
+
reportSource: rs,
|
57
|
+
pageNumber: 1,
|
58
|
+
temp
|
59
|
+
});
|
60
|
+
}
|
61
|
+
}
|
62
|
+
function exec(currentRecord) {
|
63
|
+
controller.setReportDocumentId(currentRecord.reportDocumentId);
|
64
|
+
controller.setViewMode(currentRecord.viewMode);
|
65
|
+
controller.setReportSource(currentRecord.reportSource);
|
66
|
+
controller.refreshReport(false, currentRecord.reportDocumentId);
|
67
|
+
controller.navigateToPage(currentRecord.pageNumber);
|
68
|
+
}
|
69
|
+
function canMove(step) {
|
70
|
+
var position = history.position;
|
71
|
+
var length = history.records.length;
|
72
|
+
var newPos = position + step;
|
73
|
+
return 0 <= newPos && newPos < length;
|
74
|
+
}
|
75
|
+
function move(step) {
|
76
|
+
var position = history.position;
|
77
|
+
var length = history.records.length;
|
78
|
+
var newPos = position + step;
|
79
|
+
if (newPos < 0) {
|
80
|
+
newPos = 0;
|
81
|
+
} else if (newPos >= length) {
|
82
|
+
newPos = length - 1;
|
83
|
+
}
|
84
|
+
if (newPos != position) {
|
85
|
+
history.position = newPos;
|
86
|
+
saveSettings();
|
87
|
+
exec(getCurrentRecord());
|
88
|
+
}
|
89
|
+
}
|
90
|
+
function removeTempRecordsFromHistory() {
|
91
|
+
var lastIndex = history.records.length - 1;
|
92
|
+
while (lastIndex >= 0) {
|
93
|
+
if (history.records[lastIndex].temp === true) {
|
94
|
+
history.records.splice(lastIndex, 1);
|
95
|
+
if (history.position >= lastIndex) {
|
96
|
+
history.position--;
|
97
|
+
}
|
98
|
+
} else {
|
99
|
+
break;
|
100
|
+
}
|
101
|
+
lastIndex--;
|
102
|
+
}
|
103
|
+
}
|
104
|
+
return {
|
105
|
+
back: function() {
|
106
|
+
move(-1);
|
107
|
+
},
|
108
|
+
forward: function() {
|
109
|
+
move(1);
|
110
|
+
},
|
111
|
+
canMoveBack: function() {
|
112
|
+
return canMove(-1);
|
113
|
+
},
|
114
|
+
canMoveForward: function() {
|
115
|
+
return canMove(1);
|
116
|
+
},
|
117
|
+
loadCurrent: function() {
|
118
|
+
var rec = getCurrentRecord();
|
119
|
+
if (rec) {
|
120
|
+
exec(rec);
|
121
|
+
}
|
122
|
+
return Boolean(rec);
|
123
|
+
}
|
124
|
+
};
|
125
|
+
}
|
126
|
+
|
127
|
+
export { HistoryManager };
|
package/dist/es/index.js
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
import * as domUtils from './domUtils.js';
|
2
|
+
export { domUtils };
|
3
|
+
import * as utils from './utils.js';
|
4
|
+
export { utils };
|
5
|
+
export { Accessibility } from './accessibility.js';
|
6
|
+
export { Binder } from './binder.js';
|
7
|
+
export { CommandSet } from './commandSet.js';
|
8
|
+
export { ReportViewerController } from './controller.js';
|
9
|
+
export { DocumentMapAreaPositions, PageModes, ParameterEditorTypes, ParameterTypes, ParametersAreaPositions, PrintModes, ScaleModes, ViewModes } from './enums.js';
|
10
|
+
export { Events } from './events.js';
|
11
|
+
export { GlobalSettings } from './globalSettings.js';
|
12
|
+
export { HistoryManager } from './history.js';
|
13
|
+
export { PagesArea } from './pagesArea.js';
|
14
|
+
export { ParameterEditors, parameterEditorsMatch } from './parameters.js';
|
15
|
+
export { ParameterValidators } from './parameterValidators.js';
|
16
|
+
export { PerspectiveManager } from './perspectives.js';
|
17
|
+
export { PrintManager } from './print.js';
|
18
|
+
export { ReportViewer } from './reportViewer.js';
|
19
|
+
export { Scroll } from './scroll.js';
|
20
|
+
export { ServiceClient } from './serviceClient.js';
|
21
|
+
import './sr.js';
|
22
|
+
export { TouchBehavior } from './touch.js';
|
23
|
+
export { UIController } from './uiController.js';
|
24
|
+
export { UIFreezeCoordinator } from './uiFreezeCoordinator.js';
|
@@ -0,0 +1,46 @@
|
|
1
|
+
/*!
|
2
|
+
* jQuery throttle / debounce - v1.1 - 3/7/2010
|
3
|
+
* http://benalman.com/projects/jquery-throttle-debounce-plugin/
|
4
|
+
*
|
5
|
+
* Copyright (c) 2010 "Cowboy" Ben Alman
|
6
|
+
* Dual licensed under the MIT and GPL licenses.
|
7
|
+
* http://benalman.com/about/license/
|
8
|
+
*/
|
9
|
+
(function(window2, undefined$1) {
|
10
|
+
"$:nomunge";
|
11
|
+
var $ = window2.Cowboy || (window2.Cowboy = {}), jq_throttle;
|
12
|
+
$.throttle = jq_throttle = function(delay, no_trailing, callback, debounce_mode) {
|
13
|
+
var timeout_id, last_exec = 0;
|
14
|
+
if (typeof no_trailing !== "boolean") {
|
15
|
+
debounce_mode = callback;
|
16
|
+
callback = no_trailing;
|
17
|
+
no_trailing = undefined$1;
|
18
|
+
}
|
19
|
+
function wrapper() {
|
20
|
+
var that = this, elapsed = +/* @__PURE__ */ new Date() - last_exec, args = arguments;
|
21
|
+
function exec() {
|
22
|
+
last_exec = +/* @__PURE__ */ new Date();
|
23
|
+
callback.apply(that, args);
|
24
|
+
}
|
25
|
+
function clear() {
|
26
|
+
timeout_id = undefined$1;
|
27
|
+
}
|
28
|
+
if (debounce_mode && !timeout_id) {
|
29
|
+
exec();
|
30
|
+
}
|
31
|
+
timeout_id && clearTimeout(timeout_id);
|
32
|
+
if (debounce_mode === undefined$1 && elapsed > delay) {
|
33
|
+
exec();
|
34
|
+
} else if (no_trailing !== true) {
|
35
|
+
timeout_id = setTimeout(debounce_mode ? clear : exec, debounce_mode === undefined$1 ? delay - elapsed : delay);
|
36
|
+
}
|
37
|
+
}
|
38
|
+
if ($.guid) {
|
39
|
+
wrapper.guid = callback.guid = callback.guid || $.guid++;
|
40
|
+
}
|
41
|
+
return wrapper;
|
42
|
+
};
|
43
|
+
$.debounce = function(delay, at_begin, callback) {
|
44
|
+
return callback === undefined$1 ? jq_throttle(delay, at_begin, false) : jq_throttle(delay, callback, at_begin !== false);
|
45
|
+
};
|
46
|
+
})(window);
|
@@ -0,0 +1 @@
|
|
1
|
+
import 'kendo-ui-core/esm/kendo.ui.core';
|