igniteui-react-core
Version:
Ignite UI React Core.
90 lines (89 loc) • 2.84 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";
import { stringIsNullOrEmpty } from "./string";
/**
* @hidden
*/
var SortGroupParser = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(SortGroupParser, _super);
function SortGroupParser() {
return _super !== null && _super.apply(this, arguments) || this;
}
SortGroupParser.prototype.b = function (a, b) {
if (a == null) {
return;
}
var c = a.split(',');
for (var d = 0; d < c.length; d++) {
var e = c[d].trim();
if (stringIsNullOrEmpty(e)) {
continue;
}
var f = "";
var g = 0;
for (; g < e.length; g++) {
if (e.charAt(g) == ' ') {
break;
}
f += e.charAt(g);
}
g++;
var h = "";
for (; g < e.length; g++) {
if (e.charAt(g) == ' ') {
break;
}
h += e.charAt(g);
}
h = h.toLowerCase();
var i = h == "desc" ? 1 : 0;
var j = "";
if (h == "as") {
g++;
j = this.a(e, g);
}
else {
g++;
var k = "";
for (; g < e.length; g++) {
if (e.charAt(g) == ' ') {
break;
}
k += e.charAt(g);
}
if (k.toLowerCase() == "as") {
g++;
j = this.a(e, g);
}
}
if (b != null) {
b(f, i, j == "" ? null : j);
}
}
};
SortGroupParser.prototype.a = function (a, b) {
var c = "";
var d = false;
for (; b < a.length; b++) {
if (d && a.charAt(b) == '\'') {
break;
}
if (d) {
c += a.charAt(b);
}
if (!d && a.charAt(b) == '\'') {
d = true;
}
}
return c;
};
SortGroupParser.$t = markType(SortGroupParser, 'SortGroupParser');
return SortGroupParser;
}(Base));
export { SortGroupParser };