igniteui-angular-core
Version:
Ignite UI Angular Core logic used in multiple UI components.
168 lines (167 loc) • 6.53 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, IEnumerable_$type, typeCast, Date_$type, Boolean_$type, Array_$type, markType } from "./type";
import { DataSourceLocalDataProvider } from "./DataSourceLocalDataProvider";
import { stringStartsWith } from "./string";
/**
* @hidden
*/
export let ComponentRendererSerializationProvider = /*@__PURE__*/ (() => {
class ComponentRendererSerializationProvider extends Base {
constructor() {
super();
}
c(a) {
if (typeof a === 'string') {
return true;
}
if (typeof a === 'number' || typeof a === 'number' || typeof a === 'number' || typeof a === 'number' || typeof a === 'number' || typeof a === 'number' || typeof a === 'number') {
return true;
}
if (typeCast(Date_$type, a) !== null) {
return true;
}
if (typeCast(Boolean_$type, a) !== null) {
return true;
}
return false;
}
b(a) {
if (typeCast(Array_$type, a) !== null) {
return true;
}
if (typeCast(IEnumerable_$type, a) !== null) {
return true;
}
return false;
}
e(a, b, c) {
a.append("\"" + b + "\": ");
this.f(a, c);
}
f(a, b) {
if (this.c(b)) {
if (typeof b === 'string') {
a.append(b == null ? "null" : "\"" + b.toString() + "\"");
}
else if (typeof b === 'number') {
a.append(b == null ? "null" : b.toString());
}
else if (typeof b === 'number') {
a.append(b == null ? "null" : b.toString());
}
else if (typeof b === 'number') {
a.append(b == null ? "null" : b.toString());
}
else if (typeof b === 'number') {
a.append(b == null ? "null" : b.toString());
}
else if (typeof b === 'number') {
a.append(b == null ? "null" : b.toString());
}
else if (typeof b === 'number') {
a.append(b == null ? "null" : b.toString());
}
else if (typeof b === 'number') {
a.append(b == null ? "null" : b.toString());
}
else if (typeCast(Date_$type, b) !== null) {
let v_ = b;
a.append("\"" + (v_.toJSON()) + "\"");
}
else if (typeCast(Boolean_$type, b) !== null) {
a.append(b == null ? "null" : b.toString().toLowerCase());
}
else {
a.append("null");
}
}
else {
if (b == null) {
a.append("null");
return;
}
if (this.b(b)) {
a.appendLine("[");
a.increaseTabLevel();
let c = new DataSourceLocalDataProvider();
c.dataSource = b;
for (let d = 0; d < c.actualCount; d++) {
if (d > 0) {
a.appendLine(",");
}
this.d(a, c, d);
}
a.appendLine("");
a.decreaseTabLevel();
a.append("]");
}
else {
let e = [b];
let f = new DataSourceLocalDataProvider();
f.dataSource = e;
this.d(a, f, 0);
}
}
}
d(a, b, c) {
a.appendLine("{");
a.increaseTabLevel();
let d = b.actualSchema;
for (let e = 0; e < d.propertyNames.length; e++) {
if (e > 0) {
a.appendLine(",");
}
let f = d.propertyNames[e];
if (stringStartsWith(f, "[")) {
f = f.substr(1, f.length - 2);
}
a.append("\"" + f + "\"");
a.append(": ");
let g = b.getItemValue(b.getItemAtIndex(c), d.propertyNames[e]);
switch (d.propertyTypes[e]) {
case 0:
a.append(g == null ? "null" : "\"" + g.toString() + "\"");
break;
case 2:
a.append(g == null ? "null" : "\"" + g.toString() + "\"");
break;
case 10:
case 6:
case 5:
case 1:
case 3:
case 4:
case 7:
a.append(g == null ? "null" : g.toString());
break;
case 8:
let v_ = g;
a.append("\"" + (v_.toJSON()) + "\"");
break;
case 11:
this.f(a, g);
break;
}
}
a.decreaseTabLevel();
a.appendLine("}");
}
a(a, b) {
if (b == null) {
return true;
}
let v_ = b;
if ((typeof v_ === 'function')) {
return false;
}
return true;
}
}
ComponentRendererSerializationProvider.$t = markType(ComponentRendererSerializationProvider, 'ComponentRendererSerializationProvider');
return ComponentRendererSerializationProvider;
})();