igniteui-react-grids
Version:
Ignite UI React grid components.
101 lines (100 loc) • 3.69 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 { Base, String_$type, markType } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { stringContains, stringReplace, stringIsNullOrEmpty } from "igniteui-react-core";
import { tryParseNumber } from "igniteui-react-core";
/**
* @hidden
*/
export let ColumnWidth = /*@__PURE__*/ (() => {
class ColumnWidth extends Base {
get e() {
return this.d;
}
set e(a) {
this.d = a;
}
static get a() {
return ((() => {
let $ret = new ColumnWidth();
$ret.c = true;
$ret.e = 0;
$ret.f = 1;
return $ret;
})());
}
static parse(a) {
if (a == null) {
return new ColumnWidth();
}
a = a.trim();
let b = stringContains(a, "*");
if (b || stringContains(a, "min=") || stringContains(a, "Min=") || stringContains(a, ",")) {
let c = new ColumnWidth();
c.c = b;
a = stringReplace(a, " ", "");
a = stringReplace(a, "min=", ",");
a = stringReplace(a, "Min=", ",");
a = stringReplace(a, "*,,", "*");
a = stringReplace(a, "*,", "*");
a = stringReplace(a, ",,", ",");
let d = a.split('*');
let e = new List$1(String_$type, 0);
for (let f = 0; f < d.length; f++) {
let g = d[f].split(',');
for (let h = 0; h < g.length; h++) {
e.add(g[h]);
}
}
let i = e._inner[0];
if (i != null) {
i = i.trim();
}
let j;
if (stringIsNullOrEmpty(i)) {
j = 1;
}
else {
if (!((() => { let k = tryParseNumber(i, j); j = k.p1; return k.ret; })())) {
return new ColumnWidth();
}
}
c.f = j;
if (e.count > 1 && e._inner[1] != null) {
e._inner[1] = stringReplace(e._inner[1], ">", "");
let k;
if (((() => { let l = tryParseNumber(e._inner[1], k); k = l.p1; return l.ret; })())) {
c.e = k;
}
}
return c;
}
else {
let l = new ColumnWidth();
l.c = false;
let m;
if (!((() => { let n = tryParseNumber(a, m); m = n.p1; return n.ret; })())) {
return new ColumnWidth();
}
l.f = m;
return l;
}
}
constructor() {
super();
this.g = null;
this.c = false;
this.f = 0;
this.d = 0;
this.c = true;
this.f = 1;
}
}
ColumnWidth.$t = /*@__PURE__*/ markType(ColumnWidth, 'ColumnWidth');
return ColumnWidth;
})();