igniteui-react-core
Version:
Ignite UI React Core.
101 lines (100 loc) • 3.05 kB
JavaScript
/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { __extends } from "tslib";
import { Base, markType } from "./type";
/**
* @hidden
*/
var SummaryParser = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(SummaryParser, _super);
function SummaryParser() {
return _super !== null && _super.apply(this, arguments) || this;
}
SummaryParser.prototype.a = function (a, b) {
if (a == null) {
return;
}
var c = a.split(',');
for (var d = 0; d < c.length; d++) {
var e = c[d].trim();
var f = "";
var g = 0;
for (g = 0; g < e.length; g++) {
var h = e.charAt(g);
if (h != '(') {
f += h;
}
else {
break;
}
}
if (g == e.length) {
continue;
}
f = f.trim().toLowerCase();
var i = 4;
switch (f) {
case "avg":
i = 3;
break;
case "sum":
i = 2;
break;
case "min":
i = 0;
break;
case "max":
i = 1;
break;
case "count":
i = 4;
break;
default: continue;
}
g++;
var j = "";
for (; g < e.length; g++) {
var k = e.charAt(g);
if (k != ')') {
j += k;
}
else {
break;
}
}
if (j.length == 0) {
continue;
}
if (e.charAt(g) != ')') {
continue;
}
g++;
var l = null;
if (g < e.length) {
if (e.charAt(g) != ' ') {
continue;
}
g++;
if (e.substr(g, 2) != "as") {
continue;
}
g += 2;
if (e.charAt(g) != ' ') {
continue;
}
g++;
l = e.substr(g, e.length - g);
}
if (b != null) {
b(j, i, l);
}
}
};
SummaryParser.$t = markType(SummaryParser, 'SummaryParser');
return SummaryParser;
}(Base));
export { SummaryParser };