igniteui-angular-core
Version:
Ignite UI Angular Core logic used in multiple UI components.
1,277 lines (1,276 loc) • 156 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, 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
*/
export let ComponentRenderer = /*@__PURE__*/ (() => {
class ComponentRenderer extends Base {
constructor() {
super();
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;
let a = this.s();
this.adapter = a;
let adapter_ = this.adapter;
let 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);
}
static get defaultInstance() {
return ComponentRenderer._defaultInstance;
}
static set defaultInstance(a) {
ComponentRenderer._defaultInstance = a;
}
get adapter() {
return this._adapter;
}
set adapter(a) {
this._adapter = a;
}
get context() {
return this._context;
}
set context(a) {
this._context = a;
}
get isProceedOnErrorEnabled() {
return this._isProceedOnErrorEnabled;
}
set isProceedOnErrorEnabled(a) {
this._isProceedOnErrorEnabled = a;
}
s() {
return (new ComponentRendererAdapter());
}
get serializationProvider() {
return this.t;
}
set serializationProvider(a) {
this.t = a;
}
toJson(a) {
if (this.t == null) {
this.bz.add("No serialization provider available");
return null;
}
let b = new DescriptionSerializerBuilder();
let c = new DescriptionSerializer();
b.appendLine("{");
b.increaseTabLevel();
b.appendLine("\"descriptions\": {");
b.increaseTabLevel();
let d = true;
for (let e of fromEnum(this.bf.keys)) {
if (d) {
d = false;
}
else {
b.appendLine(",");
}
let f = e;
let g = this.bf.item(e);
let h = "root";
h = a(f);
if (stringIsNullOrEmpty(h)) {
h = "root";
}
b.append("\"" + h + "\"");
b.append(": ");
c.y(this.context, g, b);
}
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();
for (let i of fromEnum(this.bw.keys)) {
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));
}
b.appendLine("");
b.decreaseTabLevel();
b.appendLine("}");
}
b.decreaseTabLevel();
b.appendLine("}");
return b.toString();
}
createObjectFromJson(a, b) {
let c = new JsonDictionaryParser();
let d = c.parse(a);
let e = new DescriptionSerializer();
let f = false;
let g = e.d(this.context, d, f, null, false);
if (g.result == null) {
return null;
}
let h = DescriptionTreeBuilder.createTree(this.context, g.result);
let i = this.bt.item(b);
if (h.c("Type")) {
let j = h.a("Type").b;
return this.c5(j, h, b, i, true, -1, null);
}
else {
return this.c1(typeCast(JsonDictionaryObject.$, d), null, null);
}
}
ap(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;
}
am(a) {
if (typeCast(Array_$type, a) !== null) {
return true;
}
if (typeCast(IEnumerable_$type, a) !== null) {
return true;
}
return false;
}
loadJson(a, b) {
this.fb(a, b, null, false, false, false);
}
loadJsonOverlay(a, b, c) {
this.fb(a, b, c, true, false, true);
}
loadJsonDelta(a, b, c) {
this.fb(a, b, null, true, c, false);
}
get preserveKeyOrder() {
return this._preserveKeyOrder;
}
set preserveKeyOrder(a) {
this._preserveKeyOrder = a;
}
a9() {
return false;
}
fk(a) {
}
get allowNullForRemove() {
return this._allowNullForRemove;
}
set allowNullForRemove(a) {
this._allowNullForRemove = a;
}
get cleanupUnusedOnRender() {
return this._cleanupUnusedOnRender;
}
set cleanupUnusedOnRender(a) {
this._cleanupUnusedOnRender = a;
}
get skipSystemRefsClean() {
return this._skipSystemRefsClean;
}
set skipSystemRefsClean(a) {
this._skipSystemRefsClean = a;
}
fd(a) {
this.bz.add(a);
}
hasErrors() {
return this.bz.count > 0;
}
getErrors() {
return this.bz.toArray();
}
clearErrors() {
this.bz.clear();
}
fb(a, b, c, d, e, f) {
let g = new JsonDictionaryParser();
let h = g.parse(a);
let i = new DescriptionSerializer();
i.i = this.isProceedOnErrorEnabled;
i.g = this.a9();
let j = null;
if (typeCast(JsonDictionaryObject.$, h) !== null) {
let k = h;
if (k.g("skipAlterDataCasing")) {
let l = k.item("skipAlterDataCasing");
if (l.value) {
this.fk(true);
}
}
else {
this.fk(false);
}
let m = null;
if (k.g("animationIdleRef") || k.g("hasAnimations")) {
m = "AnimationIdleHandler";
if (k.g("animationIdleRef")) {
m = k.item("animationIdleRef").value;
}
}
let n = 0;
if (k.g("animationIdleTimeout")) {
n = truncate(k.item("animationIdleTimeout").value);
}
if (k.g("descriptions")) {
let o = k.item("descriptions");
if (typeCast(JsonDictionaryObject.$, o) !== null) {
let p = o;
let q = p.e();
for (let r = 0; r < q.length; r++) {
let s = q[r];
let t = p.item(s);
let u = b(s);
if (u == null) {
continue;
}
j = u;
let v = false;
let w = this.cb();
if (w != null) {
v = true;
}
let 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)) {
let 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;
let ab = c(s);
let 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) {
let ad = k.item("refs");
let ae = this.az(ad);
if (!ae && typeCast(JsonDictionaryObject.$, ad) !== null) {
let af = ad;
let ag = af.e();
for (let ah = 0; ah < ag.length; ah++) {
let ai = ag[ah];
let aj = af.item(ai);
if (typeCast(JsonDictionaryValue.$, aj) !== null) {
let ak = aj;
this.provideRefValue(j, ai, ak.value);
}
else if (typeCast(JsonDictionaryArray.$, aj) !== null) {
let al = aj;
let am = this.a(al, null, null);
this.provideRefValue(j, ai, am);
}
else {
let an = this.c1(aj, null, null);
this.provideRefValue(j, ai, an);
}
}
}
}
if (k.g("refMessages") && j != null) {
let ao = k.item("refMessages");
let ap = this.az(ao);
if (!ap && typeCast(JsonDictionaryArray.$, ao) !== null) {
let aq = ao;
if (aq.items != null && aq.items.length > 0) {
for (let ar = 0; ar < aq.items.length; ar++) {
let as = j;
let 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) {
let au = k.item("modules");
this.av(au);
}
if (k.g("strings") && j != null) {
let av = k.item("strings");
this.a3(av);
}
if (k.g("onInit") && j != null) {
let aw = k.item("onInit");
this.aw(aw);
}
if (k.g("onViewInit") && j != null) {
let ax = k.item("onViewInit");
this.ax(ax);
}
}
}
fp(a, b) {
if (typeCast(JsonDictionaryObject.$, b) !== null) {
let c = b;
if (c.g("type")) {
let 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;
}
}
}
}
fj(a, b) {
throw new NotImplementedException(0);
}
fi(a, b) {
if (!b.g("refName")) {
return;
}
let c = b.item("refName");
if (!(typeCast(JsonDictionaryValue.$, c) !== null)) {
return;
}
let d = c.value;
let e = -1;
if (b.g("index")) {
let 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;
}
let g = null;
let h = null;
let 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);
}
let j = null;
let k = null;
if (g != null) {
j = this.d5(g);
}
if (h != null) {
k = this.d5(h);
}
let l = this.di(a, d);
if (l == null) {
return;
}
if (this.bi.containsKey(d)) {
let m = this.bi.item(d);
if (k != null) {
m.item(k, h);
}
}
if (this.bs.containsKey(d)) {
let 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") {
let o = ComponentRendererMethodHelper.call("notifySetItem").argument().asInt(e).argument().asEmbeddedRef(((() => {
let $ret = new EmbeddedRefDescription();
$ret.refType = "uuid";
$ret.value = j;
return $ret;
})())).argument().asEmbeddedRef(((() => {
let $ret = new EmbeddedRefDescription();
$ret.refType = "uuid";
$ret.value = k;
return $ret;
})())).$return().asVoid().build();
this.executeMethod(a, o, (p) => {
});
}
else {
let p = ComponentRendererMethodHelper.call("notifySetItem").argument().asEmbeddedRef(((() => {
let $ret = new EmbeddedRefDescription();
$ret.refType = "name";
$ret.value = d;
return $ret;
})())).argument().asInt(e).argument().asEmbeddedRef(((() => {
let $ret = new EmbeddedRefDescription();
$ret.refType = "uuid";
$ret.value = j;
return $ret;
})())).argument().asEmbeddedRef(((() => {
let $ret = new EmbeddedRefDescription();
$ret.refType = "uuid";
$ret.value = k;
return $ret;
})())).$return().asVoid().build();
this.executeMethod(a, p, (q) => {
});
}
}
if (this.bi.containsKey(d)) {
let q = this.bi.item(d);
let r = this.bs.item(d);
let 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);
}
}
}
fh(a, b) {
if (!b.g("refName")) {
return;
}
let c = b.item("refName");
if (!(typeCast(JsonDictionaryValue.$, c) !== null)) {
return;
}
let d = c.value;
let e = -1;
if (b.g("index")) {
let 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;
}
let g = null;
let h = this.h(b, d);
if (b.g("oldItem")) {
g = this.c1(b.item("oldItem"), h, null);
}
let i = null;
let j = null;
if (g != null) {
i = this.d5(g);
}
let k = this.di(a, d);
if (k == null) {
return;
}
this.fw(k, e);
if (this.ai) {
if (this.d9(a) == "DataGrid") {
let l = ComponentRendererMethodHelper.call("notifyRemoveItem").argument().asInt(e).argument().asEmbeddedRef(((() => {
let $ret = new EmbeddedRefDescription();
$ret.refType = "uuid";
$ret.value = i;
return $ret;
})())).$return().asVoid().build();
this.executeMethod(a, l, (m) => {
});
}
else {
let m = ComponentRendererMethodHelper.call("notifyRemoveItem").argument().asEmbeddedRef(((() => {
let $ret = new EmbeddedRefDescription();
$ret.refType = "name";
$ret.value = d;
return $ret;
})())).argument().asInt(e).argument().asEmbeddedRef(((() => {
let $ret = new EmbeddedRefDescription();
$ret.refType = "uuid";
$ret.value = i;
return $ret;
})())).$return().asVoid().build();
this.executeMethod(a, m, (n) => {
});
}
}
if (this.bi.containsKey(d)) {
let n = this.bi.item(d);
let o = this.bs.item(d);
let 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);
}
}
}
fg(a, b) {
if (!b.g("refName")) {
return;
}
let c = b.item("refName");
if (!(typeCast(JsonDictionaryValue.$, c) !== null)) {
return;
}
let d = c.value;
let e = -1;
if (b.g("index")) {
let 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;
}
let g = null;
let h = this.h(b, d);
if (b.g("newItem")) {
g = this.c1(b.item("newItem"), h, null);
}
let i = null;
if (g != null) {
i = this.d5(g);
}
let j = this.di(a, d);
if (j == null) {
return;
}
if (this.bi.containsKey(d)) {
let k = this.bi.item(d);
if (i != null) {
k.item(i, g);
}
}
if (this.bs.containsKey(d)) {
let 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") {
let m = ComponentRendererMethodHelper.call("notifyInsertItem").argument().asInt(e).argument().asEmbeddedRef(((() => {
let $ret = new EmbeddedRefDescription();
$ret.refType = "uuid";
$ret.value = i;
return $ret;
})())).$return().asVoid().build();
this.executeMethod(a, m, (n) => {
});
}
else {
let n = ComponentRendererMethodHelper.call("notifyInsertItem").argument().asEmbeddedRef(((() => {
let $ret = new EmbeddedRefDescription();
$ret.refType = "name";
$ret.value = d;
return $ret;
})())).argument().asInt(e).argument().asEmbeddedRef(((() => {
let $ret = new EmbeddedRefDescription();
$ret.refType = "uuid";
$ret.value = i;
return $ret;
})())).$return().asVoid().build();
this.executeMethod(a, n, (o) => {
});
}
}
}
get ai() {
return true;
}
d5(a) {
if (a == null) {
return null;
}
if (this.ag(a, "___id")) {
return this.db(a, "___id").toString();
}
let b = Guid.newGuid().toString();
this.gj(a, "___id", b);
return b;
}
h(a, b) {
if (this.bg.containsKey(b)) {
return this.bg.item(b);
}
if (a.g("dateCache")) {
let c = a.item("dateCache");
if (typeCast(JsonDictionaryArray.$, c) !== null) {
let d = c;
if (d.items != null && d.items.length > 0) {
let e = new DateColumnCache();
this.bg.item(b, e);
this.e7(d, e);
return e;
}
}
}
return null;
}
e7(a, b) {
for (let c = 0; c < a.items.length; c++) {
let d = a.items[c];
if (typeCast(JsonDictionaryValue.$, d) !== null) {
if (typeof d.value === 'string') {
b.f(d.value);
}
}
else if (typeCast(JsonDictionaryArray.$, d) !== null) {
let e = b.a(c);
this.e7(d, e);
}
}
}
ff(a, b) {
if (!b.g("refName")) {
return;
}
let c = b.item("refName");
if (!(typeCast(JsonDictionaryValue.$, c) !== null)) {
return;
}
let d = c.value;
let 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));
let f = this.bi.item(d);
let g = this.bs.item(d);
let h = null;
if (b.g("dateCache")) {
h = this.h(b, d);
}
let i = null;
let j = null;
if (typeCast(JsonDictionaryArray.$, e) !== null) {
j = e;
if (j.items != null && j.items.length > 0) {
let k = this.a(e, null, h);
i = k;
for (let l = 0; l < j.items.length; l++) {
let m = k[l];
let n = j.items[l];
if (typeCast(JsonDictionaryObject.$, n) !== null && n.g("___id")) {
let o = n;
let 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);
}
let q = this.di(a, d);
if (q != null) {
this.ge(q, j.items.length);
for (let r = 0; r < j.items.length; r++) {
let s = this.da(i, r);
this.gi(q, r, s);
}
}
if (this.ai) {
if (this.d9(a) == "DataGrid") {
let t = ComponentRendererMethodHelper.call("notifyClearItems").$return().asVoid().build();
this.executeMethod(a, t, (u) => {
});
}
else {
let u = ComponentRendererMethodHelper.call("notifyClearItems").argument().asEmbeddedRef(((() => {
let $ret = new EmbeddedRefDescription();
$ret.refType = "name";
$ret.value = d;
return $ret;
})())).$return().asVoid().build();
this.executeMethod(a, u, (v) => {
});
}
}
}
fe(a, b) {
if (!b.g("refName")) {
return;
}
let c = b.item("refName");
if (!(typeCast(JsonDictionaryValue.$, c) !== null)) {
return;
}
let d = c.value;
let 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));
let f = this.bi.item(d);
let g = this.bs.item(d);
let h = null;
if (b.g("dateCache")) {
h = this.h(b, d);
}
let i = null;
let 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;
}
}
c8(a, b, c, d, e) {
let f = null;
if (b.items != null && b.items.length > 0) {
let g = this.a(b, null, e);
f = g;
this.ep(a, b, g, c, d);
}
return f;
}
ep(a, b, c, d, e) {
for (let f = 0; f < b.items.length; f++) {
let g = c[f];
let h = b.items[f];
if (typeCast(JsonDictionaryArray.$, h) !== null) {
this.ep(a, h, g, d, e);
}
else {
let i = this.d5(g);
if (i != null) {
d.item(i, g);
if (g != null) {
e.item(g, i);
}
}
}
}
}
fo(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 (let 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;
}
let f = new Dictionary$2(String_$type, Array_$type, 0);
let i = a.e();
for (let h = 0; h < i.length; h++) {
let 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 {
let j = a.item(g);
let k = null;
if (j != null && j.items != null && j.items.length > 0) {
k = new Array(j.items.length);
for (let l = 0; l < j.items.length; l++) {
k[l] = j.items[l].value.toString();
}
}
f.item(g, k);
}
}
}
provideRefValueFromJson(a, b, c) {
let d = b;
let e = new JsonDictionaryParser();
let f = e.parse(c);
if (typeCast(JsonDictionaryValue.$, f) !== null) {
let g = f;
this.provideRefValue(a, d, g.value);
}
else if (typeCast(JsonDictionaryArray.$, f) !== null) {
let h = f;
let i = this.a(h, null, null);
this.provideRefValue(a, d, i);
}
else {
let j = this.c1(f, null, null);
this.provideRefValue(a, d, j);
}
}
addMemberPathTransformer(a) {
this.b1.add(a);
}
removeMemberPathTransformer(a) {
this.b1.remove(a);
}
addReferenceResolver(a) {
this.b3.add(a);
}
removeReferenceResolver(a) {
this.b3.remove(a);
}
f(a) {
if (this.b3.count == 0) {
return null;
}
let b = new ComponentRendererReferenceResolverEventArgs();
for (let c = 0; c < this.b3.count; c++) {
this.b3._inner[c](a, b);
}
return b;
}
cb() {
if (this.b1.count > 0) {
return (a) => {
let b = a;
for (let c = 0; c < this.b1.count; c++) {
b = this.b1._inner[c](b);
}
return b;
};
}
return null;
}
az(a) {
return false;
}
ay(a) {
return false;
}
av(a) {
return false;
}
a3(a) {
return false;
}
aw(a) {
return false;
}
ax(a) {
return false;
}
d7(a, b, c) {
let 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;
}
e2(a, b, c, d) {
if (!c.b(b)) {
c.k(d, this.bf.item(d).g, b, this.bf.item(d), runOn(this, this.fr), -1);
}
for (let e of fromEnum(a.f())) {
this.e3(this.d7(e.c, ComponentRenderer.platform, e.a), e.b, b, c, d, a.g);
}
}
e3(a, b, c, d, e, f) {
if (typeCast(DescriptionTreeNode.$, b) !== null) {
let g = b;
let 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);
}
for (let i of fromEnum(g.f())) {
this.e3(a + "." + this.d7(i.c, ComponentRenderer.platform, i.a), i.b, c, d, e, g.g);
}
}
if (typeCast(Array_$type, b) !== null) {
let j = new Dictionary$2(Number_$type, DescriptionTreeNode.$, 0);
let k = 0;
let l = b.length;
let m = b;
for (let o = 0; o < m.length; o++) {
let n = m[o];
if (typeCast(DescriptionTreeNode.$, n) !== null) {
let p = n;
j.item(k, p);
}
k++;
}
let q = this.adapter.getPropertyValue(c, a);
k = 0;
this.adapter.forPropertyValueItem(c, a, (r) => {
if (j.containsKey(k)) {
let s = j.item(k);
if (!d.b(r) && !d.a(s.g)) {
d.k(e, s.g, r, s, runOn(this, this.fr), f);
}
for (let t of fromEnum(s.f())) {
this.e3(a + "." + t.c, t.b, c, d, e, s.g);
}
}
k++;
});
if (l > 0 && k == 0) {
let r = this.ed(a);
this.adapter.forPropertyValueItem(c, r, (s) => {
if (j.containsKey(k)) {
let t = j.item(k);
if (!d.b(s) && !d.a(t.g)) {
d.k(e, t.g, s, t, runOn(this, this.fr), f);
}
for (let u of fromEnum(t.f())) {
this.e3(r + "." + u.c, u.b, c, d, e, t.g);
}
}
k++;
});
}
}
}
ed(a) {
let b = a.lastIndexOf('.');
let c = null;
let 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;
}
ea(a) {
return a.substr(0, 1).toUpperCase() + a.substr(1);
}
a(a, b, c) {
let d = new Array(a.items.length);
let e = c;
if (a.items.length > 0 && e == null) {
let f = a.items[0];
if (f != null && typeCast(JsonDictionaryObject.$, f) !== null) {
let g = f;
if (g.g("___dateColumnsCache")) {
let h = g.item("___dateColumnsCache");
if (typeCast(JsonDictionaryArray.$, h) !== null) {
let i = h;
if (i.items != null && i.items.length > 0) {
e = new DateColumnCache();
for (let j = 0; j < i.items.length; j++) {
e.f(i.items[j].value.toString());
}
}
}
}
}
}
for (let k = 0; k < a.items.length; k++) {
if (typeCast(JsonDictionaryArray.$, a.items[k]) !== null) {
let l = e;
if (l != null) {
l = l.b(k);
}
let m = this.a(a.items[k], b, l);
d[k] = m;
}
else if (typeCast(JsonDictionaryValue.$, a.items[k]) !== null) {
let n = this.c2(a.items[k], e, b);
d[k] = n;
}
else {
let o = this.c1(a.items[k], e, b);
d[k] = o;
}
}
return d;
}
ag(v_, key_) {
if (v_ == null) {
return false;
}
return (v_[key_] !== undefined ? true : false);
}
db(v_, key_) {
if (v_ == null) {
return null;
}
return v_[key_] ? v_[key_] : null;
}
gj(v_, key_, value_) {
if (v_ == null) {
return;
}
v_[key_] = value_;
}
d3(a) {
let b = a;
if (b == null) {
return null;
}
return b;
}
gi(ds_, index_, item_) {
ds_[index_] = item_;
}
d9(a) {
if (this.bf.containsKey(a)) {
let b = this.bf.item(a);
if (b != null) {
if (b.c("Type")) {
return b.a("Type").toString();
}
}
}
return null;
}
ge(ds_, length_) {
ds_.length = length_;
}
fw(ds_, index_) {
ds_.splice(index_, 1);
}
e8(ds_, index_, newItem_) {
ds_.splice(index_, 0, newItem_);
}
da(ds_, index_) {
return ds_[index_];
}
c1(a, b, c) {
if (a == null) {
return null;
}
let d = {};
let dict_ = d;
let e = a.e();
for (let f = 0; f < e.length; f++) {
let key_ = e[f];
if (typeCast(JsonDictionaryObject.$, a.item(key_)) !== null) {
let val_ = this.c1(a.item(key_), b, c != null ? c + "." + key_ : key_);
dict_[key_] = val_;
}
else if (typeCast(JsonDictionaryArray.$, a.item(key_)) !== null) {
let val_ = this.a(a.item(key_), c != null ? c + "." + key_ : key_, b);
dict_[key_] = val_;
}
else {
let val_ = a.item(key_).value;
if (b != null && b.c(key_)) {
if (typeof val_ === 'string' && stringStartsWith(val_, "@d:")) {
val_ = val_.substr(3);
}
val_ = this.c3(val_);
}
dict_[key_] = val_;
}
}
return dict_;
}
c2(a, b, c) {
let val_ = a.value;
if (b != null && b.c(c)) {
if (typeof val_ === 'string' && stringStartsWith(val_, "@d:")) {
val_ = val_.substr(3);
}
val_ = this.c3(val_);
}
if (typeof val_ === 'string') {
let d = val_;
if (d == "@dbl:INFINITY") {
val_ = Number.POSITIVE_INFINITY;
}
if (d == "@dbl:-INFINITY") {
val_ = Number.NEGATIVE_INFINITY;
}
}
return val_;
}
c3(val_) {
if (typeof val_ === 'string') {