@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.
- package/README.md +1 -1
- package/dist/cjs/accessibility.js +218 -0
- package/dist/cjs/binder.js +172 -0
- package/dist/cjs/command.js +32 -0
- package/dist/cjs/commandSet.js +167 -0
- package/dist/cjs/controller.js +1207 -0
- package/dist/cjs/documentMapArea.js +168 -0
- package/dist/cjs/domUtils.js +50 -0
- package/dist/cjs/enums.js +52 -0
- package/dist/cjs/event-emitter.js +17 -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 +332 -0
- package/dist/cjs/mem-storage.js +44 -0
- package/dist/cjs/pagesArea.js +641 -0
- package/dist/cjs/parameterValidators.js +167 -0
- package/dist/cjs/parameters.js +921 -0
- package/dist/cjs/parametersArea.js +502 -0
- package/dist/cjs/perspectives.js +138 -0
- package/dist/cjs/print.js +166 -0
- package/dist/cjs/report-viewer/report-viewer-settings.js +138 -0
- package/dist/cjs/reportViewer.js +654 -0
- package/dist/cjs/scroll.js +537 -0
- package/dist/cjs/search.js +634 -0
- package/dist/cjs/sendEmail.js +435 -0
- package/dist/cjs/service-client-sentinel.js +52 -0
- package/dist/cjs/serviceClient.js +405 -0
- package/dist/cjs/sideMenu.js +225 -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/touch.js +86 -0
- package/dist/cjs/uiController.js +142 -0
- package/dist/cjs/uiFreezeCoordinator.js +281 -0
- package/dist/cjs/utils.js +492 -0
- package/dist/es/accessibility.js +214 -0
- package/dist/es/binder.js +168 -0
- package/dist/es/command.js +28 -0
- package/dist/es/commandSet.js +163 -0
- package/dist/es/controller.js +1203 -0
- package/dist/es/documentMapArea.js +164 -0
- package/dist/es/domUtils.js +43 -0
- package/dist/es/enums.js +41 -0
- package/dist/es/event-emitter.js +13 -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 +328 -0
- package/dist/es/mem-storage.js +40 -0
- package/dist/es/pagesArea.js +637 -0
- package/dist/es/parameterValidators.js +163 -0
- package/dist/es/parameters.js +916 -0
- package/dist/es/parametersArea.js +498 -0
- package/dist/es/perspectives.js +134 -0
- package/dist/es/print.js +162 -0
- package/dist/es/report-viewer/report-viewer-settings.js +134 -0
- package/dist/es/reportViewer.js +650 -0
- package/dist/es/scroll.js +533 -0
- package/dist/es/search.js +630 -0
- package/dist/es/sendEmail.js +431 -0
- package/dist/es/service-client-sentinel.js +48 -0
- package/dist/es/serviceClient.js +401 -0
- package/dist/es/sideMenu.js +221 -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/touch.js +82 -0
- package/dist/es/uiController.js +138 -0
- package/dist/es/uiFreezeCoordinator.js +277 -0
- package/dist/es/utils.js +447 -0
- package/dist/font/font-icons.css +4 -4
- package/dist/font/font-icons.min.css +3 -3
- package/dist/js/telerikReportViewer.js +8574 -8249
- package/dist/js/telerikReportViewer.min.js +1 -17
- package/dist/js/telerikReportViewer.stringResources.js +166 -173
- package/dist/styles/telerikReportViewer.css +1 -1
- package/dist/styles/telerikReportViewer.min.css +1 -1
- package/dist/templates/telerikReportViewerTemplate-FA.html +3 -3
- package/dist/templates/telerikReportViewerTemplate.html +3 -3
- package/package.json +13 -7
- /package/dist/font/{ReportingIcons-18.0.24.130.ttf → ReportingIcons-18.1.24.514.ttf} +0 -0
@@ -0,0 +1,163 @@
|
|
1
|
+
import { stringFormat, each, tryParseFloat, tryParseInt, parseToLocalDate } from './utils.js';
|
2
|
+
import { stringResources } from './stringResources.js';
|
3
|
+
import { ParameterTypes } from './enums.js';
|
4
|
+
|
5
|
+
var ParameterValidators = function() {
|
6
|
+
var validators = {};
|
7
|
+
function validateParameter(parameter, value, validatorFunc, compareFunc) {
|
8
|
+
var values = [].concat(value).map(function(value1) {
|
9
|
+
return checkAvailableValues(parameter, validatorFunc(value1), compareFunc);
|
10
|
+
});
|
11
|
+
if (parameter.multivalue) {
|
12
|
+
if (value == null || value.length == 0) {
|
13
|
+
if (parameter.allowNull) {
|
14
|
+
return value;
|
15
|
+
} else {
|
16
|
+
throw stringResources.invalidParameter;
|
17
|
+
}
|
18
|
+
}
|
19
|
+
return values;
|
20
|
+
}
|
21
|
+
return values[0];
|
22
|
+
}
|
23
|
+
function isNull(parameter, value) {
|
24
|
+
return parameter.allowNull && -1 != [null, "", void 0].indexOf(value);
|
25
|
+
}
|
26
|
+
function checkAvailableValues(parameter, value, compareFunc) {
|
27
|
+
if (parameter.availableValues) {
|
28
|
+
var found = false;
|
29
|
+
each(parameter.availableValues, function(i, av) {
|
30
|
+
found = compareFunc(value, av.value);
|
31
|
+
return !found;
|
32
|
+
});
|
33
|
+
if (!found) {
|
34
|
+
if (parameter.allowNull && !value) {
|
35
|
+
return value;
|
36
|
+
}
|
37
|
+
throw stringResources.invalidParameter;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
return value;
|
41
|
+
}
|
42
|
+
validators[ParameterTypes.STRING] = {
|
43
|
+
validate: function(parameter, value) {
|
44
|
+
return validateParameter(
|
45
|
+
parameter,
|
46
|
+
value,
|
47
|
+
function(value2) {
|
48
|
+
if (!value2) {
|
49
|
+
if (parameter.allowNull) {
|
50
|
+
return null;
|
51
|
+
}
|
52
|
+
if (parameter.allowBlank) {
|
53
|
+
return "";
|
54
|
+
}
|
55
|
+
throw stringResources.parameterIsEmpty;
|
56
|
+
}
|
57
|
+
return value2;
|
58
|
+
},
|
59
|
+
function(s1, s2) {
|
60
|
+
return s1 == s2;
|
61
|
+
}
|
62
|
+
);
|
63
|
+
}
|
64
|
+
};
|
65
|
+
validators[ParameterTypes.FLOAT] = {
|
66
|
+
validate: function(parameter, value) {
|
67
|
+
return validateParameter(
|
68
|
+
parameter,
|
69
|
+
value,
|
70
|
+
function(value2) {
|
71
|
+
var num = tryParseFloat(value2);
|
72
|
+
if (isNaN(num)) {
|
73
|
+
if (isNull(parameter, value2)) {
|
74
|
+
return null;
|
75
|
+
}
|
76
|
+
throw stringResources.parameterIsEmpty;
|
77
|
+
}
|
78
|
+
return num;
|
79
|
+
},
|
80
|
+
function(f1, f2) {
|
81
|
+
return tryParseFloat(f1) == tryParseFloat(f2);
|
82
|
+
}
|
83
|
+
);
|
84
|
+
}
|
85
|
+
};
|
86
|
+
validators[ParameterTypes.INTEGER] = {
|
87
|
+
validate: function(parameter, value) {
|
88
|
+
return validateParameter(
|
89
|
+
parameter,
|
90
|
+
value,
|
91
|
+
function(value2) {
|
92
|
+
var num = tryParseInt(value2);
|
93
|
+
if (isNaN(num)) {
|
94
|
+
if (isNull(parameter, value2)) {
|
95
|
+
return null;
|
96
|
+
}
|
97
|
+
throw stringResources.parameterIsEmpty;
|
98
|
+
}
|
99
|
+
return num;
|
100
|
+
},
|
101
|
+
function(n1, n2) {
|
102
|
+
return tryParseInt(n1) == tryParseFloat(n2);
|
103
|
+
}
|
104
|
+
);
|
105
|
+
}
|
106
|
+
};
|
107
|
+
validators[ParameterTypes.DATETIME] = {
|
108
|
+
validate: function(parameter, value) {
|
109
|
+
return validateParameter(
|
110
|
+
parameter,
|
111
|
+
value,
|
112
|
+
function(value2) {
|
113
|
+
if (parameter.allowNull && (value2 === null || value2 === "" || value2 === void 0)) {
|
114
|
+
return null;
|
115
|
+
}
|
116
|
+
if (!isNaN(Date.parse(value2))) {
|
117
|
+
if (parameter.availableValues) {
|
118
|
+
return value2;
|
119
|
+
}
|
120
|
+
return parseToLocalDate(value2);
|
121
|
+
}
|
122
|
+
throw stringResources.invalidDateTimeValue;
|
123
|
+
},
|
124
|
+
function(d1, d2) {
|
125
|
+
d1 = parseToLocalDate(d1);
|
126
|
+
d2 = parseToLocalDate(d2);
|
127
|
+
return d1.getTime() == d2.getTime();
|
128
|
+
}
|
129
|
+
);
|
130
|
+
}
|
131
|
+
};
|
132
|
+
validators[ParameterTypes.BOOLEAN] = {
|
133
|
+
validate: function(parameter, value) {
|
134
|
+
return validateParameter(
|
135
|
+
parameter,
|
136
|
+
value,
|
137
|
+
function(value2) {
|
138
|
+
if (-1 != ["true", "false"].indexOf(("" + value2).toLowerCase())) {
|
139
|
+
return Boolean(value2);
|
140
|
+
}
|
141
|
+
if (isNull(parameter, value2)) {
|
142
|
+
return null;
|
143
|
+
}
|
144
|
+
throw stringResources.parameterIsEmpty;
|
145
|
+
},
|
146
|
+
function(b1, b2) {
|
147
|
+
return Boolean(b1) == Boolean(b2);
|
148
|
+
}
|
149
|
+
);
|
150
|
+
}
|
151
|
+
};
|
152
|
+
return {
|
153
|
+
validate: function(parameter, value) {
|
154
|
+
var v = validators[parameter.type];
|
155
|
+
if (!v) {
|
156
|
+
throw stringFormat(stringResources.cannotValidateType, parameter);
|
157
|
+
}
|
158
|
+
return v.validate(parameter, value);
|
159
|
+
}
|
160
|
+
};
|
161
|
+
}();
|
162
|
+
|
163
|
+
export { ParameterValidators };
|