@progress/telerik-jquery-report-viewer 21.24.130 → 22.24.514

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/accessibility.js +218 -0
  3. package/dist/cjs/binder.js +172 -0
  4. package/dist/cjs/command.js +32 -0
  5. package/dist/cjs/commandSet.js +167 -0
  6. package/dist/cjs/controller.js +1207 -0
  7. package/dist/cjs/documentMapArea.js +168 -0
  8. package/dist/cjs/domUtils.js +50 -0
  9. package/dist/cjs/enums.js +52 -0
  10. package/dist/cjs/event-emitter.js +17 -0
  11. package/dist/cjs/events.js +23 -0
  12. package/dist/cjs/globalSettings.js +9 -0
  13. package/dist/cjs/history.js +131 -0
  14. package/dist/cjs/index.js +58 -0
  15. package/dist/cjs/jqueryThrottleDebounce.js +48 -0
  16. package/dist/cjs/kendo-jquery.js +4 -0
  17. package/dist/cjs/mainMenu.js +332 -0
  18. package/dist/cjs/mem-storage.js +44 -0
  19. package/dist/cjs/pagesArea.js +641 -0
  20. package/dist/cjs/parameterValidators.js +167 -0
  21. package/dist/cjs/parameters.js +921 -0
  22. package/dist/cjs/parametersArea.js +502 -0
  23. package/dist/cjs/perspectives.js +138 -0
  24. package/dist/cjs/print.js +166 -0
  25. package/dist/cjs/report-viewer/report-viewer-settings.js +138 -0
  26. package/dist/cjs/reportViewer.js +654 -0
  27. package/dist/cjs/scroll.js +537 -0
  28. package/dist/cjs/search.js +634 -0
  29. package/dist/cjs/sendEmail.js +435 -0
  30. package/dist/cjs/service-client-sentinel.js +52 -0
  31. package/dist/cjs/serviceClient.js +405 -0
  32. package/dist/cjs/sideMenu.js +225 -0
  33. package/dist/cjs/sr.js +164 -0
  34. package/dist/cjs/stringResources.js +11 -0
  35. package/dist/cjs/telerikReportViewer.kendo.js +60196 -0
  36. package/dist/cjs/telerikReportViewer.kendo.min.js +19776 -0
  37. package/dist/cjs/template-cache.js +39 -0
  38. package/dist/cjs/touch.js +86 -0
  39. package/dist/cjs/uiController.js +142 -0
  40. package/dist/cjs/uiFreezeCoordinator.js +281 -0
  41. package/dist/cjs/utils.js +492 -0
  42. package/dist/es/accessibility.js +214 -0
  43. package/dist/es/binder.js +168 -0
  44. package/dist/es/command.js +28 -0
  45. package/dist/es/commandSet.js +163 -0
  46. package/dist/es/controller.js +1203 -0
  47. package/dist/es/documentMapArea.js +164 -0
  48. package/dist/es/domUtils.js +43 -0
  49. package/dist/es/enums.js +41 -0
  50. package/dist/es/event-emitter.js +13 -0
  51. package/dist/es/events.js +19 -0
  52. package/dist/es/globalSettings.js +5 -0
  53. package/dist/es/history.js +127 -0
  54. package/dist/es/index.js +24 -0
  55. package/dist/es/jqueryThrottleDebounce.js +46 -0
  56. package/dist/es/kendo-jquery.js +1 -0
  57. package/dist/es/mainMenu.js +328 -0
  58. package/dist/es/mem-storage.js +40 -0
  59. package/dist/es/pagesArea.js +637 -0
  60. package/dist/es/parameterValidators.js +163 -0
  61. package/dist/es/parameters.js +916 -0
  62. package/dist/es/parametersArea.js +498 -0
  63. package/dist/es/perspectives.js +134 -0
  64. package/dist/es/print.js +162 -0
  65. package/dist/es/report-viewer/report-viewer-settings.js +134 -0
  66. package/dist/es/reportViewer.js +650 -0
  67. package/dist/es/scroll.js +533 -0
  68. package/dist/es/search.js +630 -0
  69. package/dist/es/sendEmail.js +431 -0
  70. package/dist/es/service-client-sentinel.js +48 -0
  71. package/dist/es/serviceClient.js +401 -0
  72. package/dist/es/sideMenu.js +221 -0
  73. package/dist/es/sr.js +162 -0
  74. package/dist/es/stringResources.js +7 -0
  75. package/dist/es/telerikReportViewer.kendo.js +60194 -0
  76. package/dist/es/telerikReportViewer.kendo.min.js +19774 -0
  77. package/dist/es/template-cache.js +35 -0
  78. package/dist/es/touch.js +82 -0
  79. package/dist/es/uiController.js +138 -0
  80. package/dist/es/uiFreezeCoordinator.js +277 -0
  81. package/dist/es/utils.js +447 -0
  82. package/dist/font/font-icons.css +4 -4
  83. package/dist/font/font-icons.min.css +3 -3
  84. package/dist/js/telerikReportViewer.js +8574 -8249
  85. package/dist/js/telerikReportViewer.min.js +1 -17
  86. package/dist/js/telerikReportViewer.stringResources.js +166 -173
  87. package/dist/styles/telerikReportViewer.css +1 -1
  88. package/dist/styles/telerikReportViewer.min.css +1 -1
  89. package/dist/templates/telerikReportViewerTemplate-FA.html +3 -3
  90. package/dist/templates/telerikReportViewerTemplate.html +3 -3
  91. package/package.json +13 -7
  92. /package/dist/font/{ReportingIcons-18.0.24.130.ttf → ReportingIcons-18.1.24.514.ttf} +0 -0
@@ -0,0 +1,168 @@
1
+ import { each, tryParseInt, isSpecialKey } from './utils.js';
2
+ import { GlobalSettings } from './globalSettings.js';
3
+
4
+ var Binder = {
5
+ bind: function($element) {
6
+ var args = Array.prototype.slice.call(arguments, 1);
7
+ attachCommands($element, args);
8
+ var result = $element.find('[data-role^="telerik_ReportViewer_"]');
9
+ each(result, function() {
10
+ var $this = $(this);
11
+ var f = $.fn[$this.attr("data-role")];
12
+ if (typeof f === "function") {
13
+ f.apply($this, args);
14
+ }
15
+ });
16
+ }
17
+ };
18
+ function attachCommands($element, args) {
19
+ var commands = args[0].commands;
20
+ var viewerOptions = args[1];
21
+ var elementSelector = '[data-command^="telerik_ReportViewer_"]';
22
+ var customElementSelector = "[data-target-report-viewer]" + elementSelector;
23
+ $element.on("click", elementSelector, commandHandler);
24
+ if (!GlobalSettings.CommandHandlerAttached) {
25
+ $(document.body).on("click", customElementSelector, customCommandHandler);
26
+ GlobalSettings.CommandHandlerAttached = true;
27
+ }
28
+ each(commands, function(key, command) {
29
+ attachCommand(key, command, viewerOptions, $element);
30
+ });
31
+ function commandHandler(e) {
32
+ var prefixedDataCommand = $(this).attr("data-command");
33
+ if (prefixedDataCommand) {
34
+ var dataCommand = prefixedDataCommand.substring("telerik_ReportViewer_".length);
35
+ var cmd = commands[dataCommand];
36
+ if (cmd && cmd.enabled()) {
37
+ cmd.exec($(this).attr("data-command-parameter"));
38
+ }
39
+ e.preventDefault();
40
+ }
41
+ }
42
+ function customCommandHandler(e) {
43
+ var $this = $(this);
44
+ var prefixedDataCommand = $this.attr("data-command");
45
+ var reportViewerTarget = $this.attr("data-target-report-viewer");
46
+ if (prefixedDataCommand && reportViewerTarget) {
47
+ var dataCommand = prefixedDataCommand.substring("telerik_ReportViewer_".length);
48
+ var reportViewer = $(reportViewerTarget).data("telerik_ReportViewer");
49
+ var cmd = reportViewer.commands[dataCommand];
50
+ if (cmd.enabled()) {
51
+ cmd.exec($(this).attr("data-command-parameter"));
52
+ }
53
+ e.preventDefault();
54
+ }
55
+ }
56
+ }
57
+ function attachCommand(dataCommand, cmd, viewerOptions, $element) {
58
+ if (cmd) {
59
+ var elementSelector = '[data-command="telerik_ReportViewer_' + dataCommand + '"]';
60
+ var customElementSelector = '[data-target-report-viewer="' + viewerOptions.selector + '"]' + elementSelector;
61
+ var $defaultElement = $element.find(elementSelector);
62
+ var $customElement = $(customElementSelector);
63
+ $(cmd).on("enabledChanged", function(e) {
64
+ (cmd.enabled() ? $.fn.removeClass : $.fn.addClass).call($defaultElement.parent("li"), "k-disabled");
65
+ (cmd.enabled() ? $.fn.removeClass : $.fn.addClass).call($customElement, viewerOptions.disabledButtonClass);
66
+ }).on("checkedChanged", function(e) {
67
+ var defaultTarget = $defaultElement.parent("li");
68
+ (cmd.checked() ? $.fn.addClass : $.fn.removeClass).call(defaultTarget, getSelectedClassName(defaultTarget));
69
+ (cmd.checked() ? $.fn.addClass : $.fn.removeClass).call($customElement, viewerOptions.checkedButtonClass);
70
+ });
71
+ }
72
+ }
73
+ function getSelectedClassName($element) {
74
+ return $element.hasClass("trv-menu-toggleable") ? "k-selected !k-bg-primary" : "k-selected";
75
+ }
76
+ function LinkButton(dom, options) {
77
+ var cmd;
78
+ var $element = $(dom);
79
+ var dataCommand = $element.attr("data-command");
80
+ if (dataCommand) {
81
+ cmd = options.commands[dataCommand];
82
+ }
83
+ if (cmd) {
84
+ $element.click(function(e) {
85
+ if (cmd.enabled()) {
86
+ cmd.exec($(this).attr("data-command-parameter"));
87
+ } else {
88
+ e.preventDefault();
89
+ }
90
+ });
91
+ $(cmd).on("enabledChanged", function(e) {
92
+ (cmd.enabled() ? $.fn.removeClass : $.fn.addClass).call($element, "disabled");
93
+ }).on("checkedChanged", function(e) {
94
+ (cmd.checked() ? $.fn.addClass : $.fn.removeClass).call($element, "checked");
95
+ });
96
+ }
97
+ }
98
+ var linkButton_pluginName = "telerik_ReportViewer_LinkButton";
99
+ $.fn[linkButton_pluginName] = function(options) {
100
+ return each(this, function() {
101
+ if (!$.data(this, linkButton_pluginName)) {
102
+ $.data(this, linkButton_pluginName, new LinkButton(this, options));
103
+ }
104
+ });
105
+ };
106
+ function PageNumberInput(dom, options) {
107
+ var $element = $(dom);
108
+ var oldValue = 0;
109
+ var cmd = options.commands["goToPage"];
110
+ function setPageNumber(value) {
111
+ if (oldValue !== value || !$element.is(":focus")) {
112
+ $element.val(value);
113
+ oldValue = value;
114
+ }
115
+ }
116
+ options.controller.pageNumberChange(function(e, value) {
117
+ setPageNumber(value);
118
+ });
119
+ $element.change(function() {
120
+ var val = $(this).val();
121
+ var num = tryParseInt(val);
122
+ if (!isNaN(num)) {
123
+ var result = cmd.exec(num);
124
+ setPageNumber(result);
125
+ }
126
+ });
127
+ $element.keydown(function(e) {
128
+ if (e.which == 13) {
129
+ $(this).change();
130
+ return e.preventDefault();
131
+ }
132
+ });
133
+ function validateValue(value) {
134
+ return /^([0-9]+)$/.test(value);
135
+ }
136
+ $element.keypress(function(event) {
137
+ if (isSpecialKey(event.keyCode)) {
138
+ return true;
139
+ }
140
+ var newValue = $element.val() + String.fromCharCode(event.charCode);
141
+ return validateValue(newValue);
142
+ }).on("paste", function(event) {
143
+ });
144
+ }
145
+ var pageNumberInput_pluginName = "telerik_ReportViewer_PageNumberInput";
146
+ $.fn[pageNumberInput_pluginName] = function(options) {
147
+ return each(this, function() {
148
+ if (!$.data(this, pageNumberInput_pluginName)) {
149
+ $.data(this, pageNumberInput_pluginName, new PageNumberInput(this, options));
150
+ }
151
+ });
152
+ };
153
+ function PageCountLabel(dom, options) {
154
+ var $element = $(dom);
155
+ options.controller.pageCountChange(function(e, value) {
156
+ $element.text(value);
157
+ });
158
+ }
159
+ var pageCountLabel_pluginName = "telerik_ReportViewer_PageCountLabel";
160
+ $.fn[pageCountLabel_pluginName] = function(options) {
161
+ return each(this, function() {
162
+ if (!$.data(this, pageCountLabel_pluginName)) {
163
+ $.data(this, pageCountLabel_pluginName, new PageCountLabel(this, options));
164
+ }
165
+ });
166
+ };
167
+
168
+ 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 };