UNPKG

igniteui-react-core

Version:
86 lines (85 loc) 2.86 kB
/* 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 { Base, markType } from "./type"; import { stringIsNullOrEmpty } from "./string"; /** * @hidden */ export let SortGroupParser = /*@__PURE__*/ (() => { class SortGroupParser extends Base { b(a, b) { if (a == null) { return; } let c = a.split(','); for (let d = 0; d < c.length; d++) { let e = c[d].trim(); if (stringIsNullOrEmpty(e)) { continue; } let f = ""; let g = 0; for (; g < e.length; g++) { if (e.charAt(g) == ' ') { break; } f += e.charAt(g); } g++; let h = ""; for (; g < e.length; g++) { if (e.charAt(g) == ' ') { break; } h += e.charAt(g); } h = h.toLowerCase(); let i = h == "desc" ? 1 : 0; let j = ""; if (h == "as") { g++; j = this.a(e, g); } else { g++; let 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); } } } a(a, b) { let c = ""; let 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 = /*@__PURE__*/ markType(SortGroupParser, 'SortGroupParser'); return SortGroupParser; })();