igniteui-angular-core
Version:
Ignite UI Angular Core logic used in multiple UI components.
1,330 lines (1,329 loc) • 166 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, __values } from "tslib";
import { Base, IEnumerable_$type, fromEnum, typeCast, Date_$type, Boolean_$type, Array_$type, String_$type, typeGetValue, Delegate_$type, runOn, Number_$type, EnumUtil, fromEn, markType, getInstanceType } from "./type";
import { TypeDescriptionContext } from "./TypeDescriptionContext";
import { Dictionary$2 } from "./Dictionary$2";
import { List$1 } from "./List$1";
import { DateColumnCache } from "./DateColumnCache";
import { ComponentRendererReferenceResolverEventArgs } from "./ComponentRendererReferenceResolverEventArgs";
import { Description } from "./Description";
import { DescriptionTreeNode } from "./DescriptionTreeNode";
import { Queue$1 } from "./Queue$1";
import { DescriptionTreeAction } from "./DescriptionTreeAction";
import { DescriptionRef } from "./DescriptionRef";
import { TypeDescriptionPropretyTransforms } from "./TypeDescriptionPropretyTransforms";
import { DescriptionSerializerBuilder } from "./DescriptionSerializerBuilder";
import { DescriptionSerializer } from "./DescriptionSerializer";
import { JsonDictionaryParser } from "./JsonDictionaryParser";
import { DescriptionTreeBuilder } from "./DescriptionTreeBuilder";
import { JsonDictionaryObject } from "./JsonDictionaryObject";
import { JsonDictionaryValue } from "./JsonDictionaryValue";
import { JsonDictionaryArray } from "./JsonDictionaryArray";
import { NotImplementedException } from "./NotImplementedException";
import { ComponentRendererMethodHelper } from "./ComponentRendererMethodHelper";
import { EmbeddedRefDescription } from "./EmbeddedRefDescription";
import { Guid } from "./Guid";
import { TypeDescriptionMetadata } from "./TypeDescriptionMetadata";
import { Convert } from "./Convert";
import { DescriptionTreeReconciler } from "./DescriptionTreeReconciler";
import { HashSet$1 } from "./HashSet$1";
import { GlobalAnimationState } from "./GlobalAnimationState";
import { TypeDescriptionWellKnownType_$type } from "./TypeDescriptionWellKnownType";
import { FastReflectionHelper } from "./FastReflectionHelper";
import { CSSColorUtil } from "./CSSColorUtil";
import { StringDescription } from "./StringDescription";
import { NumberDescription } from "./NumberDescription";
import { PlatformAPIHelper } from "./PlatformAPIHelper";
import { PointDescription } from "./PointDescription";
import { SizeDescription } from "./SizeDescription";
import { RectDescription } from "./RectDescription";
import { BrushDescription } from "./BrushDescription";
import { ColorDescription } from "./ColorDescription";
import { TypeDescriptionPropretyTransformsMultipleSets } from "./TypeDescriptionPropretyTransformsMultipleSets";
import { Tuple$2 } from "./Tuple$2";
import { DescriptionRefTargetInfo } from "./DescriptionRefTargetInfo";
import { FontRegistry } from "./FontRegistry";
import { truncate } from "./number";
import { ComponentRendererAdapter } from "./ComponentRendererAdapter";
import { stringIsNullOrEmpty, stringEndsWith, stringStartsWith, stringReplace } from "./string";
import { dateTryParse, dateParse } from "./dateExtended";
/**
* @hidden
*/
var ComponentRenderer = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(ComponentRenderer, _super);
function ComponentRenderer() {
var _this = _super.call(this) || this;
_this._adapter = null;
_this._context = null;
_this._isProceedOnErrorEnabled = false;
_this.v = null;
_this.w = null;
_this.t = null;
_this._preserveKeyOrder = false;
_this._allowNullForRemove = false;
_this._cleanupUnusedOnRender = false;
_this._skipSystemRefsClean = 0;
_this.bz = new List$1(String_$type, 0);
_this.bg = new Dictionary$2(String_$type, DateColumnCache.$, 0);
_this.bi = new Dictionary$2(String_$type, Dictionary$2.$.specialize(String_$type, Base.$), 0);
_this.bs = new Dictionary$2(String_$type, Dictionary$2.$.specialize(Base.$, String_$type), 0);
_this.b1 = new List$1(Delegate_$type, 0);
_this.b3 = new List$1(Delegate_$type, 0);
_this.bm = new Dictionary$2(Base.$, Description.$, 0);
_this.bn = new Dictionary$2(Base.$, Boolean_$type, 0);
_this.bo = new Dictionary$2(Base.$, Boolean_$type, 0);
_this.bl = new Dictionary$2(Base.$, Boolean_$type, 0);
_this.bj = new Dictionary$2(Base.$, String_$type, 0);
_this.bk = new Dictionary$2(Base.$, Number_$type, 0);
_this.bf = new Dictionary$2(Base.$, DescriptionTreeNode.$, 0);
_this.bt = new Dictionary$2(Base.$, ContainerState.$, 0);
_this.bp = new Dictionary$2(Base.$, Queue$1.$.specialize(Queue$1.$.specialize(DescriptionTreeAction.$)), 0);
_this.bh = new Dictionary$2(Base.$, List$1.$.specialize(Delegate_$type), 0);
_this.bd = new Dictionary$2(Base.$, Boolean_$type, 0);
_this.br = new Dictionary$2(String_$type, DescriptionRef.$, 0);
_this.bu = new Dictionary$2(String_$type, Base.$, 0);
_this.bw = new Dictionary$2(String_$type, Base.$, 0);
_this.bq = new Dictionary$2(Base.$, String_$type, 0);
_this.be = new Dictionary$2(String_$type, Delegate_$type, 0);
_this.cd = null;
_this.b5 = new List$1(Delegate_$type, 0);
_this.bv = new Dictionary$2(String_$type, List$1.$.specialize(Delegate_$type), 0);
_this.b0 = new List$1(Delegate_$type, 0);
_this.b4 = new List$1(Delegate_$type, 0);
_this.b2 = new List$1(Delegate_$type, 0);
_this.by = null;
_this.o = null;
_this._shouldNamespaceSystemRefValues = false;
_this.z = false;
var a = _this.s();
_this.adapter = a;
var adapter_ = _this.adapter;
var b = (adapter_._platform);
if (b == "Igc") {
ComponentRenderer.platform = 4;
}
else if (b == "Igr") {
ComponentRenderer.platform = 2;
}
_this.context = new TypeDescriptionContext(_this.adapter, ComponentRenderer.platform);
_this.v = new TypeDescriptionPropretyTransforms();
_this.w = new TypeDescriptionCleanups(_this);
return _this;
}
Object.defineProperty(ComponentRenderer, "defaultInstance", {
get: function () {
return ComponentRenderer._defaultInstance;
},
set: function (a) {
ComponentRenderer._defaultInstance = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ComponentRenderer.prototype, "adapter", {
get: function () {
return this._adapter;
},
set: function (a) {
this._adapter = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ComponentRenderer.prototype, "context", {
get: function () {
return this._context;
},
set: function (a) {
this._context = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ComponentRenderer.prototype, "isProceedOnErrorEnabled", {
get: function () {
return this._isProceedOnErrorEnabled;
},
set: function (a) {
this._isProceedOnErrorEnabled = a;
},
enumerable: false,
configurable: true
});
ComponentRenderer.prototype.s = function () {
return (new ComponentRendererAdapter());
};
Object.defineProperty(ComponentRenderer.prototype, "serializationProvider", {
get: function () {
return this.t;
},
set: function (a) {
this.t = a;
},
enumerable: false,
configurable: true
});
ComponentRenderer.prototype.toJson = function (a) {
var e_1, _a, e_2, _b;
if (this.t == null) {
this.bz.add("No serialization provider available");
return null;
}
var b = new DescriptionSerializerBuilder();
var c = new DescriptionSerializer();
b.appendLine("{");
b.increaseTabLevel();
b.appendLine("\"descriptions\": {");
b.increaseTabLevel();
var d = true;
try {
for (var _c = __values(fromEnum(this.bf.keys)), _d = _c.next(); !_d.done; _d = _c.next()) {
var e = _d.value;
if (d) {
d = false;
}
else {
b.appendLine(",");
}
var f = e;
var g = this.bf.item(e);
var h = "root";
h = a(f);
if (stringIsNullOrEmpty(h)) {
h = "root";
}
b.append("\"" + h + "\"");
b.append(": ");
c.y(this.context, g, b);
}
}
catch (e_1_1) {
e_1 = { error: e_1_1 };
}
finally {
try {
if (_d && !_d.done && (_a = _c.return))
_a.call(_c);
}
finally {
if (e_1)
throw e_1.error;
}
}
b.appendLine("");
b.decreaseTabLevel();
b.append("}");
if (this.bw.count > 0) {
b.append(",");
}
b.appendLine("");
if (this.bw.count > 0) {
d = true;
b.appendLine("refs: {");
b.increaseTabLevel();
try {
for (var _e = __values(fromEnum(this.bw.keys)), _f = _e.next(); !_f.done; _f = _e.next()) {
var i = _f.value;
if (!this.t.canSerializeRef(i, this.bw.item(i))) {
continue;
}
if (d) {
d = false;
}
else {
b.appendLine(",");
}
this.t.serializeRef(b, i, this.bw.item(i));
}
}
catch (e_2_1) {
e_2 = { error: e_2_1 };
}
finally {
try {
if (_f && !_f.done && (_b = _e.return))
_b.call(_e);
}
finally {
if (e_2)
throw e_2.error;
}
}
b.appendLine("");
b.decreaseTabLevel();
b.appendLine("}");
}
b.decreaseTabLevel();
b.appendLine("}");
return b.toString();
};
ComponentRenderer.prototype.createObjectFromJson = function (a, b) {
var c = new JsonDictionaryParser();
var d = c.parse(a);
var e = new DescriptionSerializer();
var f = false;
var g = e.d(this.context, d, f, null, false);
if (g.result == null) {
return null;
}
var h = DescriptionTreeBuilder.createTree(this.context, g.result);
var i = this.bt.item(b);
if (h.c("Type")) {
var j = h.a("Type").b;
return this.c5(j, h, b, i, true, -1, null);
}
else {
return this.c1(typeCast(JsonDictionaryObject.$, d), null, null);
}
};
ComponentRenderer.prototype.ap = function (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;
};
ComponentRenderer.prototype.am = function (a) {
if (typeCast(Array_$type, a) !== null) {
return true;
}
if (typeCast(IEnumerable_$type, a) !== null) {
return true;
}
return false;
};
ComponentRenderer.prototype.loadJson = function (a, b) {
this.fb(a, b, null, false, false, false);
};
ComponentRenderer.prototype.loadJsonOverlay = function (a, b, c) {
this.fb(a, b, c, true, false, true);
};
ComponentRenderer.prototype.loadJsonDelta = function (a, b, c) {
this.fb(a, b, null, true, c, false);
};
Object.defineProperty(ComponentRenderer.prototype, "preserveKeyOrder", {
get: function () {
return this._preserveKeyOrder;
},
set: function (a) {
this._preserveKeyOrder = a;
},
enumerable: false,
configurable: true
});
ComponentRenderer.prototype.a9 = function () {
return false;
};
ComponentRenderer.prototype.fk = function (a) {
};
Object.defineProperty(ComponentRenderer.prototype, "allowNullForRemove", {
get: function () {
return this._allowNullForRemove;
},
set: function (a) {
this._allowNullForRemove = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ComponentRenderer.prototype, "cleanupUnusedOnRender", {
get: function () {
return this._cleanupUnusedOnRender;
},
set: function (a) {
this._cleanupUnusedOnRender = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ComponentRenderer.prototype, "skipSystemRefsClean", {
get: function () {
return this._skipSystemRefsClean;
},
set: function (a) {
this._skipSystemRefsClean = a;
},
enumerable: false,
configurable: true
});
ComponentRenderer.prototype.fd = function (a) {
this.bz.add(a);
};
ComponentRenderer.prototype.hasErrors = function () {
return this.bz.count > 0;
};
ComponentRenderer.prototype.getErrors = function () {
return this.bz.toArray();
};
ComponentRenderer.prototype.clearErrors = function () {
this.bz.clear();
};
ComponentRenderer.prototype.fb = function (a, b, c, d, e, f) {
var g = new JsonDictionaryParser();
var h = g.parse(a);
var i = new DescriptionSerializer();
i.i = this.isProceedOnErrorEnabled;
i.g = this.a9();
var j = null;
if (typeCast(JsonDictionaryObject.$, h) !== null) {
var k = h;
if (k.g("skipAlterDataCasing")) {
var l = k.item("skipAlterDataCasing");
if (l.value) {
this.fk(true);
}
}
else {
this.fk(false);
}
var m = null;
if (k.g("animationIdleRef") || k.g("hasAnimations")) {
m = "AnimationIdleHandler";
if (k.g("animationIdleRef")) {
m = k.item("animationIdleRef").value;
}
}
var n = 0;
if (k.g("animationIdleTimeout")) {
n = truncate(k.item("animationIdleTimeout").value);
}
if (k.g("descriptions")) {
var o = k.item("descriptions");
if (typeCast(JsonDictionaryObject.$, o) !== null) {
var p = o;
var q = p.e();
for (var r = 0; r < q.length; r++) {
var s = q[r];
var t = p.item(s);
var u = b(s);
if (u == null) {
continue;
}
j = u;
var v = false;
var w = this.cb();
if (w != null) {
v = true;
}
var x = null;
if (this.isProceedOnErrorEnabled) {
try {
x = i.d(this.context, t, v, w, false);
}
catch (y) {
this.fd("error deserializing item: " + y.toString());
return;
}
}
else {
x = i.d(this.context, t, v, w, false);
}
if (x.result == null && !this.allowNullForRemove) {
continue;
}
if (f) {
if (!this.bx.containsKey(u)) {
var z = null;
if (this.isProceedOnErrorEnabled) {
try {
z = i.d(this.context, t, v, w, true);
}
catch (aa) {
this.fd("error deserializing item: " + aa.toString());
return;
}
}
else {
z = i.d(this.context, t, v, w, true);
}
this.gc(z.result, u, d, true, this.cleanupUnusedOnRender, m, n);
m = null;
var ab = c(s);
var ac = this.bx.item(u);
this.e2(this.bf.item(u), ab, ac, u);
}
}
this.gc(x.result, u, d, e, this.cleanupUnusedOnRender, m, n);
m = null;
}
}
}
if (k.g("refs") && j != null) {
var ad = k.item("refs");
var ae = this.az(ad);
if (!ae && typeCast(JsonDictionaryObject.$, ad) !== null) {
var af = ad;
var ag = af.e();
for (var ah = 0; ah < ag.length; ah++) {
var ai = ag[ah];
var aj = af.item(ai);
if (typeCast(JsonDictionaryValue.$, aj) !== null) {
var ak = aj;
this.provideRefValue(j, ai, ak.value);
}
else if (typeCast(JsonDictionaryArray.$, aj) !== null) {
var al = aj;
var am = this.a(al, null, null);
this.provideRefValue(j, ai, am);
}
else {
var an = this.c1(aj, null, null);
this.provideRefValue(j, ai, an);
}
}
}
}
if (k.g("refMessages") && j != null) {
var ao = k.item("refMessages");
var ap = this.az(ao);
if (!ap && typeCast(JsonDictionaryArray.$, ao) !== null) {
var aq = ao;
if (aq.items != null && aq.items.length > 0) {
for (var ar = 0; ar < aq.items.length; ar++) {
var as = j;
var at = aq.items[ar];
if (typeCast(JsonDictionaryObject.$, at) !== null && at.g("descriptionKey")) {
as = b(at.item("descriptionKey").value.toString());
}
this.fp(as, at);
}
}
}
}
if (k.g("modules") && j != null) {
var au = k.item("modules");
this.av(au);
}
if (k.g("strings") && j != null) {
var av = k.item("strings");
this.a3(av);
}
if (k.g("onInit") && j != null) {
var aw = k.item("onInit");
this.aw(aw);
}
if (k.g("onViewInit") && j != null) {
var ax = k.item("onViewInit");
this.ax(ax);
}
}
};
ComponentRenderer.prototype.fp = function (a, b) {
if (typeCast(JsonDictionaryObject.$, b) !== null) {
var c = b;
if (c.g("type")) {
var d = c.item("type").value;
switch (d) {
case "refChanged":
this.fe(a, c);
break;
case "refClearItems":
this.ff(a, c);
break;
case "refNotifyInsertItem":
this.fg(a, c);
break;
case "refNotifyRemoveItem":
this.fh(a, c);
break;
case "refNotifySetItem":
this.fi(a, c);
break;
case "refNotifyUpdateItem":
this.fj(a, c);
break;
}
}
}
};
ComponentRenderer.prototype.fj = function (a, b) {
throw new NotImplementedException(0);
};
ComponentRenderer.prototype.fi = function (a, b) {
if (!b.g("refName")) {
return;
}
var c = b.item("refName");
if (!(typeCast(JsonDictionaryValue.$, c) !== null)) {
return;
}
var d = c.value;
var e = -1;
if (b.g("index")) {
var f = b.item("index");
if (typeCast(JsonDictionaryValue.$, f) !== null) {
if (typeof f.value === 'number') {
e = typeGetValue(f.value);
}
if (typeof f.value === 'number') {
e = truncate(Math.round(f.value));
}
}
}
if (e == -1) {
return;
}
var g = null;
var h = null;
var i = this.h(b, d);
if (b.g("oldItem")) {
g = this.c1(b.item("oldItem"), i, null);
}
if (b.g("newItem")) {
h = this.c1(b.item("newItem"), i, null);
}
var j = null;
var k = null;
if (g != null) {
j = this.d5(g);
}
if (h != null) {
k = this.d5(h);
}
var l = this.di(a, d);
if (l == null) {
return;
}
if (this.bi.containsKey(d)) {
var m = this.bi.item(d);
if (k != null) {
m.item(k, h);
}
}
if (this.bs.containsKey(d)) {
var n = this.bs.item(d);
if (k != null && h != null) {
n.item(h, k);
}
}
this.gi(l, e, h);
if (this.ai) {
if (this.d9(a) == "DataGrid") {
var o = ComponentRendererMethodHelper.call("notifySetItem").argument().asInt(e).argument().asEmbeddedRef(((function () {
var $ret = new EmbeddedRefDescription();
$ret.refType = "uuid";
$ret.value = j;
return $ret;
})())).argument().asEmbeddedRef(((function () {
var $ret = new EmbeddedRefDescription();
$ret.refType = "uuid";
$ret.value = k;
return $ret;
})())).$return().asVoid().build();
this.executeMethod(a, o, function (p) {
});
}
else {
var p = ComponentRendererMethodHelper.call("notifySetItem").argument().asEmbeddedRef(((function () {
var $ret = new EmbeddedRefDescription();
$ret.refType = "name";
$ret.value = d;
return $ret;
})())).argument().asInt(e).argument().asEmbeddedRef(((function () {
var $ret = new EmbeddedRefDescription();
$ret.refType = "uuid";
$ret.value = j;
return $ret;
})())).argument().asEmbeddedRef(((function () {
var $ret = new EmbeddedRefDescription();
$ret.refType = "uuid";
$ret.value = k;
return $ret;
})())).$return().asVoid().build();
this.executeMethod(a, p, function (q) {
});
}
}
if (this.bi.containsKey(d)) {
var q = this.bi.item(d);
var r = this.bs.item(d);
var s = null;
if (j != null && q.containsKey(j)) {
s = q.item(j);
}
if (s != null && r.containsKey(s)) {
r.removeItem(s);
}
if (j != null && q.containsKey(j)) {
q.removeItem(j);
}
}
};
ComponentRenderer.prototype.fh = function (a, b) {
if (!b.g("refName")) {
return;
}
var c = b.item("refName");
if (!(typeCast(JsonDictionaryValue.$, c) !== null)) {
return;
}
var d = c.value;
var e = -1;
if (b.g("index")) {
var f = b.item("index");
if (typeCast(JsonDictionaryValue.$, f) !== null) {
if (typeof f.value === 'number') {
e = typeGetValue(f.value);
}
if (typeof f.value === 'number') {
e = truncate(Math.round(f.value));
}
}
}
if (e == -1) {
return;
}
var g = null;
var h = this.h(b, d);
if (b.g("oldItem")) {
g = this.c1(b.item("oldItem"), h, null);
}
var i = null;
var j = null;
if (g != null) {
i = this.d5(g);
}
var k = this.di(a, d);
if (k == null) {
return;
}
this.fw(k, e);
if (this.ai) {
if (this.d9(a) == "DataGrid") {
var l = ComponentRendererMethodHelper.call("notifyRemoveItem").argument().asInt(e).argument().asEmbeddedRef(((function () {
var $ret = new EmbeddedRefDescription();
$ret.refType = "uuid";
$ret.value = i;
return $ret;
})())).$return().asVoid().build();
this.executeMethod(a, l, function (m) {
});
}
else {
var m = ComponentRendererMethodHelper.call("notifyRemoveItem").argument().asEmbeddedRef(((function () {
var $ret = new EmbeddedRefDescription();
$ret.refType = "name";
$ret.value = d;
return $ret;
})())).argument().asInt(e).argument().asEmbeddedRef(((function () {
var $ret = new EmbeddedRefDescription();
$ret.refType = "uuid";
$ret.value = i;
return $ret;
})())).$return().asVoid().build();
this.executeMethod(a, m, function (n) {
});
}
}
if (this.bi.containsKey(d)) {
var n = this.bi.item(d);
var o = this.bs.item(d);
var p = null;
if (i != null && n.containsKey(i)) {
p = n.item(i);
}
if (p != null && o.containsKey(p)) {
o.removeItem(p);
}
if (i != null && n.containsKey(i)) {
n.removeItem(i);
}
}
};
ComponentRenderer.prototype.fg = function (a, b) {
if (!b.g("refName")) {
return;
}
var c = b.item("refName");
if (!(typeCast(JsonDictionaryValue.$, c) !== null)) {
return;
}
var d = c.value;
var e = -1;
if (b.g("index")) {
var f = b.item("index");
if (typeCast(JsonDictionaryValue.$, f) !== null) {
if (typeof f.value === 'number') {
e = typeGetValue(f.value);
}
if (typeof f.value === 'number') {
e = truncate(Math.round(f.value));
}
}
}
if (e == -1) {
return;
}
var g = null;
var h = this.h(b, d);
if (b.g("newItem")) {
g = this.c1(b.item("newItem"), h, null);
}
var i = null;
if (g != null) {
i = this.d5(g);
}
var j = this.di(a, d);
if (j == null) {
return;
}
if (this.bi.containsKey(d)) {
var k = this.bi.item(d);
if (i != null) {
k.item(i, g);
}
}
if (this.bs.containsKey(d)) {
var l = this.bs.item(d);
if (g != null && i != null) {
l.item(g, i);
}
}
this.e8(j, e, g);
if (this.ai) {
if (this.d9(a) == "DataGrid") {
var m = ComponentRendererMethodHelper.call("notifyInsertItem").argument().asInt(e).argument().asEmbeddedRef(((function () {
var $ret = new EmbeddedRefDescription();
$ret.refType = "uuid";
$ret.value = i;
return $ret;
})())).$return().asVoid().build();
this.executeMethod(a, m, function (n) {
});
}
else {
var n = ComponentRendererMethodHelper.call("notifyInsertItem").argument().asEmbeddedRef(((function () {
var $ret = new EmbeddedRefDescription();
$ret.refType = "name";
$ret.value = d;
return $ret;
})())).argument().asInt(e).argument().asEmbeddedRef(((function () {
var $ret = new EmbeddedRefDescription();
$ret.refType = "uuid";
$ret.value = i;
return $ret;
})())).$return().asVoid().build();
this.executeMethod(a, n, function (o) {
});
}
}
};
Object.defineProperty(ComponentRenderer.prototype, "ai", {
get: function () {
return true;
},
enumerable: false,
configurable: true
});
ComponentRenderer.prototype.d5 = function (a) {
if (a == null) {
return null;
}
if (this.ag(a, "___id")) {
return this.db(a, "___id").toString();
}
var b = Guid.newGuid().toString();
this.gj(a, "___id", b);
return b;
};
ComponentRenderer.prototype.h = function (a, b) {
if (this.bg.containsKey(b)) {
return this.bg.item(b);
}
if (a.g("dateCache")) {
var c = a.item("dateCache");
if (typeCast(JsonDictionaryArray.$, c) !== null) {
var d = c;
if (d.items != null && d.items.length > 0) {
var e = new DateColumnCache();
this.bg.item(b, e);
this.e7(d, e);
return e;
}
}
}
return null;
};
ComponentRenderer.prototype.e7 = function (a, b) {
for (var c = 0; c < a.items.length; c++) {
var d = a.items[c];
if (typeCast(JsonDictionaryValue.$, d) !== null) {
if (typeof d.value === 'string') {
b.f(d.value);
}
}
else if (typeCast(JsonDictionaryArray.$, d) !== null) {
var e = b.a(c);
this.e7(d, e);
}
}
};
ComponentRenderer.prototype.ff = function (a, b) {
if (!b.g("refName")) {
return;
}
var c = b.item("refName");
if (!(typeCast(JsonDictionaryValue.$, c) !== null)) {
return;
}
var d = c.value;
var e = b.item("refValue");
this.bi.item(d, new Dictionary$2(String_$type, Base.$, 0));
this.bs.item(d, new Dictionary$2(Base.$, String_$type, 0));
var f = this.bi.item(d);
var g = this.bs.item(d);
var h = null;
if (b.g("dateCache")) {
h = this.h(b, d);
}
var i = null;
var j = null;
if (typeCast(JsonDictionaryArray.$, e) !== null) {
j = e;
if (j.items != null && j.items.length > 0) {
var k = this.a(e, null, h);
i = k;
for (var l = 0; l < j.items.length; l++) {
var m = k[l];
var n = j.items[l];
if (typeCast(JsonDictionaryObject.$, n) !== null && n.g("___id")) {
var o = n;
var p = o.item("___id");
if (typeCast(JsonDictionaryValue.$, p) !== null) {
f.item(p.value, m);
if (m != null) {
g.item(m, p.value);
}
}
}
}
}
}
if (b.g("dataIntents")) {
this.fo(b.item("dataIntents"), d, e, j);
}
var q = this.di(a, d);
if (q != null) {
this.ge(q, j.items.length);
for (var r = 0; r < j.items.length; r++) {
var s = this.da(i, r);
this.gi(q, r, s);
}
}
if (this.ai) {
if (this.d9(a) == "DataGrid") {
var t = ComponentRendererMethodHelper.call("notifyClearItems").$return().asVoid().build();
this.executeMethod(a, t, function (u) {
});
}
else {
var u = ComponentRendererMethodHelper.call("notifyClearItems").argument().asEmbeddedRef(((function () {
var $ret = new EmbeddedRefDescription();
$ret.refType = "name";
$ret.value = d;
return $ret;
})())).$return().asVoid().build();
this.executeMethod(a, u, function (v) {
});
}
}
};
ComponentRenderer.prototype.fe = function (a, b) {
if (!b.g("refName")) {
return;
}
var c = b.item("refName");
if (!(typeCast(JsonDictionaryValue.$, c) !== null)) {
return;
}
var d = c.value;
var e = b.item("refValue");
this.bi.item(d, new Dictionary$2(String_$type, Base.$, 0));
this.bs.item(d, new Dictionary$2(Base.$, String_$type, 0));
var f = this.bi.item(d);
var g = this.bs.item(d);
var h = null;
if (b.g("dateCache")) {
h = this.h(b, d);
}
var i = null;
var j = null;
if (typeCast(JsonDictionaryArray.$, e) !== null) {
j = e;
i = this.c8(d, j, f, g, h);
}
i = this.d3(i);
if (b.g("dataIntents")) {
this.fo(b.item("dataIntents"), d, i, j);
}
if (i != null) {
this.z = true;
}
this.provideRefValue(a, d, i);
if (i != null) {
this.z = false;
}
};
ComponentRenderer.prototype.c8 = function (a, b, c, d, e) {
var f = null;
if (b.items != null && b.items.length > 0) {
var g = this.a(b, null, e);
f = g;
this.ep(a, b, g, c, d);
}
return f;
};
ComponentRenderer.prototype.ep = function (a, b, c, d, e) {
for (var f = 0; f < b.items.length; f++) {
var g = c[f];
var h = b.items[f];
if (typeCast(JsonDictionaryArray.$, h) !== null) {
this.ep(a, h, g, d, e);
}
else {
var i = this.d5(g);
if (i != null) {
d.item(i, g);
if (g != null) {
e.item(g, i);
}
}
}
}
};
ComponentRenderer.prototype.fo = function (a, b, c, d) {
if (a != null && a.g("subProps") && a.item("subProps").value) {
if (d.items != null && d.items.length > 0 && d.items[0] != null) {
if (typeCast(JsonDictionaryArray.$, d.items[0]) !== null) {
for (var e = 0; e < d.items.length; e++) {
this.fo(a.item("subIntents"), b, this.da(c, 0), d.items[e]);
}
}
else {
this.fo(a.item("subIntents"), b, this.da(c, 0), d.items[0]);
}
}
return;
}
var f = new Dictionary$2(String_$type, Array_$type, 0);
var i = a.e();
for (var h = 0; h < i.length; h++) {
var g = i[h];
if (a.g(g) && a.item(g).g("subProps") && a.item(g).item("subProps").value) {
if (d.items != null && d.items.length > 0 && d.items[0].g(g)) {
this.fo(a.item("subIntents"), b, this.db(this.da(c, 0), g), d.items[0].item(g));
}
}
else {
var j = a.item(g);
var k = null;
if (j != null && j.items != null && j.items.length > 0) {
k = new Array(j.items.length);
for (var l = 0; l < j.items.length; l++) {
k[l] = j.items[l].value.toString();
}
}
f.item(g, k);
}
}
};
ComponentRenderer.prototype.provideRefValueFromJson = function (a, b, c) {
var d = b;
var e = new JsonDictionaryParser();
var f = e.parse(c);
if (typeCast(JsonDictionaryValue.$, f) !== null) {
var g = f;
this.provideRefValue(a, d, g.value);
}
else if (typeCast(JsonDictionaryArray.$, f) !== null) {
var h = f;
var i = this.a(h, null, null);
this.provideRefValue(a, d, i);
}
else {
var j = this.c1(f, null, null);
this.provideRefValue(a, d, j);
}
};
ComponentRenderer.prototype.addMemberPathTransformer = function (a) {
this.b1.add(a);
};
ComponentRenderer.prototype.removeMemberPathTransformer = function (a) {
this.b1.remove(a);
};
ComponentRenderer.prototype.addReferenceResolver = function (a) {
this.b3.add(a);
};
ComponentRenderer.prototype.removeReferenceResolver = function (a) {
this.b3.remove(a);
};
ComponentRenderer.prototype.f = function (a) {
if (this.b3.count == 0) {
return null;
}
var b = new ComponentRendererReferenceResolverEventArgs();
for (var c = 0; c < this.b3.count; c++) {
this.b3._inner[c](a, b);
}
return b;
};
ComponentRenderer.prototype.cb = function () {
var _this = this;
if (this.b1.count > 0) {
return function (a) {
var b = a;
for (var c = 0; c < _this.b1.count; c++) {
b = _this.b1._inner[c](b);
}
return b;
};
}
return null;
};
ComponentRenderer.prototype.az = function (a) {
return false;
};
ComponentRenderer.prototype.ay = function (a) {
return false;
};
ComponentRenderer.prototype.av = function (a) {
return false;
};
ComponentRenderer.prototype.a3 = function (a) {
return false;
};
ComponentRenderer.prototype.aw = function (a) {
return false;
};
ComponentRenderer.prototype.ax = function (a) {
return false;
};
ComponentRenderer.prototype.d7 = function (a, b, c) {
var d = a;
if (c != null) {
d = c.k(b);
}
else {
if (TypeDescriptionMetadata.shouldCamelize(b)) {
d = TypeDescriptionMetadata.camelize(d);
}
}
if (stringEndsWith(d, "Ref")) {
d = d.substr(0, d.length - ("Ref").length);
}
return d;
};
ComponentRenderer.prototype.e2 = function (a, b, c, d) {
var e_3, _a;
if (!c.b(b)) {
c.k(d, this.bf.item(d).g, b, this.bf.item(d), runOn(this, this.fr), -1);
}
try {
for (var _b = __values(fromEnum(a.f())), _c = _b.next(); !_c.done; _c = _b.next()) {
var e = _c.value;
this.e3(this.d7(e.c, ComponentRenderer.platform, e.a), e.b, b, c, d, a.g);
}
}
catch (e_3_1) {
e_3 = { error: e_3_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_3)
throw e_3.error;
}
}
};
ComponentRenderer.prototype.e3 = function (a, b, c, d, e, f) {
var e_4, _a;
var _this = this;
if (typeCast(DescriptionTreeNode.$, b) !== null) {
var g = b;
var h = this.adapter.getPropertyValue(c, a);
if (!d.b(h) && !d.a(g.g)) {
d.k(e, g.g, h, g, runOn(this, this.fr), f);
}
try {
for (var _b = __values(fromEnum(g.f())), _c = _b.next(); !_c.done; _c = _b.next()) {
var i = _c.value;
this.e3(a + "." + this.d7(i.c, ComponentRenderer.platform, i.a), i.b, c, d, e, g.g);
}
}
catch (e_4_1) {
e_4 = { error: e_4_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_4)
throw e_4.error;
}
}
}
if (typeCast(Array_$type, b) !== null) {
var j_1 = new Dictionary$2(Number_$type, DescriptionTreeNode.$, 0);
var k_1 = 0;
var l = b.length;
var m = b;
for (var o = 0; o < m.length; o++) {
var n = m[o];
if (typeCast(DescriptionTreeNode.$, n) !== null) {
var p = n;
j_1.item(k_1, p);
}
k_1++;
}
var q = this.adapter.getPropertyValue(c, a);
k_1 = 0;
this.adapter.forPropertyValueItem(c, a, function (r) {
var e_5, _a;
if (j_1.containsKey(k_1)) {
var s = j_1.item(k_1);
if (!d.b(r) && !d.a(s.g)) {
d.k(e, s.g, r, s, runOn(_this, _this.fr), f);
}
try {
for (var _b = __values(fromEnum(s.f())), _c = _b.next(); !_c.done; _c = _b.next()) {
var t = _c.value;
_this.e3(a + "." + t.c, t.b, c, d, e, s.g);
}
}
catch (e_5_1) {
e_5 = { error: e_5_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_5)
throw e_5.error;
}
}
}
k_1++;
});
if (l > 0 && k_1 == 0) {
var r_1 = this.ed(a);
this.adapter.forPropertyValueItem(c, r_1, function (s) {
var e_6, _a;
if (j_1.containsKey(k_1)) {
var t = j_1.item(k_1);
if (!d.b(s) && !d.a(t.g)) {
d.k(e, t.g, s, t, runOn(_this, _this.fr), f);
}
try {
for (var _b = __values(fromEnum(t.f())), _c = _b.next(); !_c.done; _c = _b.next()) {
var u = _c.value;
_this.e3(r_1 + "." + u.c, u.b, c, d, e, t.g);
}
}
catch (e_6_1) {
e_6 = { error: e_6_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_6)
throw e_6.error;
}
}
}
k_1++;
});
}
}
};
ComponentRenderer.prototype.ed = function (a) {
var b = a.lastIndexOf('.');
var c = null;
var d = a;
if (b > 0) {
c = a.substr(0, b);
d = a.substr(b + 1);
}
d = "actual" + this.ea(d);
if (c != null) {
return c + "." + d;
}
return d;
};
ComponentRenderer.prototype.ea = function (a) {
return a.substr(0, 1).toUpperCase() + a.substr(1);
};
ComponentRenderer.prototype.a = function (a, b, c) {
var d = new Array(a.items.length);
var e = c;
if (a.items.length > 0 && e == null) {
var f = a.items[0];
if (f != null && typeCast(JsonDictionaryObject.$, f) !== null) {
var g = f;
if (g.g("___dateColumnsCache")) {
var h = g.item("___dateColumnsCache");
if (typeCast(JsonDictionaryArray.$, h) !== null) {
var i = h;
if (i.items != null && i.items.length > 0) {
e = new DateColumnCache();
for (var j = 0; j < i.items.length; j++) {
e.f(i.items[j].value.toString());
}
}
}
}
}
}
for (var k = 0; k < a.items.length; k++) {
if (typeCast(JsonDictionaryArray.$, a.items[k]) !== null) {
var l = e;
if (l != null) {
l = l.b(k);
}
var m = this.a(a.items[k], b, l);
d[k] = m;
}
else if (typeCast(JsonDictionaryValue.$, a.items[k]) !== null) {
var n = this.c2(a.items[k], e, b);
d[k] = n;
}
else {
var o = this.c1(a.items[k], e, b);
d[k] = o;
}
}
return d;
};
ComponentRenderer.prototype.ag = function (v_, key_) {
if (v_ == null) {
return false;
}
return (v_[key_] !== undefined ? true : false);
};
ComponentRenderer.prototype.db = function (v_, key_) {
if (v_ == null) {
return null;
}