UNPKG

igniteui-angular-core

Version:

Ignite UI Angular Core logic used in multiple UI components.

1,343 lines 169 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 { __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 { DataSourceLocalDataProvider } from "./DataSourceLocalDataProvider"; 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, stringStartsWith, stringEndsWith, 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.t = null; _this.u = null; _this._preserveKeyOrder = false; _this._allowNullForRemove = false; _this._cleanupUnusedOnRender = false; _this._skipSystemRefsClean = 0; _this.by = new List$1(String_$type, 0); _this.bf = new Dictionary$2(String_$type, DateColumnCache.$, 0); _this.bh = new Dictionary$2(String_$type, Dictionary$2.$.specialize(String_$type, Base.$), 0); _this.br = new Dictionary$2(String_$type, Dictionary$2.$.specialize(Base.$, String_$type), 0); _this.b0 = new List$1(Delegate_$type, 0); _this.b2 = new List$1(Delegate_$type, 0); _this.bl = new Dictionary$2(Base.$, Description.$, 0); _this.bm = new Dictionary$2(Base.$, Boolean_$type, 0); _this.bn = new Dictionary$2(Base.$, Boolean_$type, 0); _this.bk = new Dictionary$2(Base.$, Boolean_$type, 0); _this.bi = new Dictionary$2(Base.$, String_$type, 0); _this.bj = new Dictionary$2(Base.$, Number_$type, 0); _this.be = new Dictionary$2(Base.$, DescriptionTreeNode.$, 0); _this.bs = new Dictionary$2(Base.$, ContainerState.$, 0); _this.bo = new Dictionary$2(Base.$, Queue$1.$.specialize(Queue$1.$.specialize(DescriptionTreeAction.$)), 0); _this.bg = new Dictionary$2(Base.$, List$1.$.specialize(Delegate_$type), 0); _this.bc = new Dictionary$2(Base.$, Boolean_$type, 0); _this.bq = new Dictionary$2(String_$type, DescriptionRef.$, 0); _this.bt = new Dictionary$2(String_$type, Base.$, 0); _this.bv = new Dictionary$2(String_$type, Base.$, 0); _this.bp = new Dictionary$2(Base.$, String_$type, 0); _this.bd = new Dictionary$2(String_$type, Delegate_$type, 0); _this.cc = null; _this.b4 = new List$1(Delegate_$type, 0); _this.bu = new Dictionary$2(String_$type, List$1.$.specialize(Delegate_$type), 0); _this.bz = new List$1(Delegate_$type, 0); _this.b3 = new List$1(Delegate_$type, 0); _this.b1 = new List$1(Delegate_$type, 0); _this.bx = null; _this.o = null; _this._shouldNamespaceSystemRefValues = false; _this.x = 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.t = new TypeDescriptionPropretyTransforms(); _this.u = 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()); }; ComponentRenderer.prototype.toJson = function (a) { var e_1, _a, e_2, _b; var b = new DescriptionSerializerBuilder(); var c = new DescriptionSerializer(); b.f("{"); b.i(); b.f("\"descriptions\": {"); b.i(); var d = true; try { for (var _c = __values(fromEnum(this.be.keys)), _d = _c.next(); !_d.done; _d = _c.next()) { var e = _d.value; if (d) { d = false; } else { b.f(","); } var f = e; var g = this.be.item(e); var h = "root"; h = a(f); if (stringIsNullOrEmpty(h)) { h = "root"; } b.e("\"" + h + "\""); b.e(": "); 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.f(""); b.h(); b.e("}"); if (this.bv.count > 0) { b.e(","); } b.f(""); if (this.bv.count > 0) { d = true; b.f("refs: {"); b.i(); try { for (var _e = __values(fromEnum(this.bv.keys)), _f = _e.next(); !_f.done; _f = _e.next()) { var i = _f.value; if (!this.ab(i, this.bv.item(i))) { continue; } if (d) { d = false; } else { b.f(","); } this.gi(b, i, this.bv.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.f(""); b.h(); b.f("}"); } b.h(); b.f("}"); return b.toString(); }; ComponentRenderer.prototype.gi = function (a, b, c) { a.e("\"" + b + "\": "); this.gj(a, c); }; ComponentRenderer.prototype.gj = function (a, b) { if (this.ao(b)) { if (typeof b === 'string') { a.e(b == null ? "null" : "\"" + b.toString() + "\""); } else if (typeof b === 'number') { a.e(b == null ? "null" : b.toString()); } else if (typeof b === 'number') { a.e(b == null ? "null" : b.toString()); } else if (typeof b === 'number') { a.e(b == null ? "null" : b.toString()); } else if (typeof b === 'number') { a.e(b == null ? "null" : b.toString()); } else if (typeof b === 'number') { a.e(b == null ? "null" : b.toString()); } else if (typeof b === 'number') { a.e(b == null ? "null" : b.toString()); } else if (typeof b === 'number') { a.e(b == null ? "null" : b.toString()); } else if (typeCast(Date_$type, b) !== null) { var v_ = b; a.e("\"" + (v_.toJSON()) + "\""); } else if (typeCast(Boolean_$type, b) !== null) { a.e(b == null ? "null" : b.toString().toLowerCase()); } else { a.e("null"); } } else { if (b == null) { a.e("null"); return; } if (this.al(b)) { a.f("["); a.i(); var c = new DataSourceLocalDataProvider(); c.dataSource = b; for (var d = 0; d < c.actualCount; d++) { if (d > 0) { a.f(","); } this.gh(a, c, d); } a.f(""); a.h(); a.e("]"); } else { var e = [b]; var f = new DataSourceLocalDataProvider(); f.dataSource = e; this.gh(a, f, 0); } } }; ComponentRenderer.prototype.gh = function (a, b, c) { a.f("{"); a.i(); var d = b.actualSchema; for (var e = 0; e < d.propertyNames.length; e++) { if (e > 0) { a.f(","); } var f = d.propertyNames[e]; if (stringStartsWith(f, "[")) { f = f.substr(1, f.length - 2); } a.e("\"" + f + "\""); a.e(": "); var g = b.getItemValue(b.getItemAtIndex(c), d.propertyNames[e]); switch (d.propertyTypes[e]) { case 0: a.e(g == null ? "null" : "\"" + g.toString() + "\""); break; case 2: a.e(g == null ? "null" : "\"" + g.toString() + "\""); break; case 10: case 6: case 5: case 1: case 3: case 4: case 7: a.e(g == null ? "null" : g.toString()); break; case 8: var v_ = g; a.e("\"" + (v_.toJSON()) + "\""); break; case 11: this.gj(a, g); break; } } a.h(); a.f("}"); }; ComponentRenderer.prototype.ab = function (a, b) { if (b == null) { return true; } var v_ = b; if ((typeof v_ === 'function')) { return false; } return true; }; 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.bs.item(b); if (h.c("Type")) { var j = h.a("Type").b; return this.c4(j, h, b, i, true, -1, null); } else { return this.c0(typeCast(JsonDictionaryObject.$, d), null, null); } }; ComponentRenderer.prototype.ao = 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.al = 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.fa(a, b, null, false, false, false); }; ComponentRenderer.prototype.loadJsonOverlay = function (a, b, c) { this.fa(a, b, c, true, false, true); }; ComponentRenderer.prototype.loadJsonDelta = function (a, b, c) { this.fa(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.a8 = function () { return false; }; ComponentRenderer.prototype.fj = 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.fc = function (a) { this.by.add(a); }; ComponentRenderer.prototype.hasErrors = function () { return this.by.count > 0; }; ComponentRenderer.prototype.getErrors = function () { return this.by.toArray(); }; ComponentRenderer.prototype.clearErrors = function () { this.by.clear(); }; ComponentRenderer.prototype.fa = 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.a8(); var j = null; if (typeCast(JsonDictionaryObject.$, h) !== null) { var k = h; if (k.g("skipAlterDataCasing")) { var l = k.item("skipAlterDataCasing"); if (l.value) { this.fj(true); } } else { this.fj(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.ca(); if (w != null) { v = true; } var x = null; if (this.isProceedOnErrorEnabled) { try { x = i.d(this.context, t, v, w, false); } catch (y) { this.fc("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.bw.containsKey(u)) { var z = null; if (this.isProceedOnErrorEnabled) { try { z = i.d(this.context, t, v, w, true); } catch (aa) { this.fc("error deserializing item: " + aa.toString()); return; } } else { z = i.d(this.context, t, v, w, true); } this.gb(z.result, u, d, true, this.cleanupUnusedOnRender, m, n); m = null; var ab = c(s); var ac = this.bw.item(u); this.e1(this.be.item(u), ab, ac, u); } } this.gb(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.ay(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.c0(aj, null, null); this.provideRefValue(j, ai, an); } } } } if (k.g("refMessages") && j != null) { var ao = k.item("refMessages"); var ap = this.ay(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.fo(as, at); } } } } if (k.g("modules") && j != null) { var au = k.item("modules"); this.au(au); } if (k.g("strings") && j != null) { var av = k.item("strings"); this.a2(av); } if (k.g("onInit") && j != null) { var aw = k.item("onInit"); this.av(aw); } if (k.g("onViewInit") && j != null) { var ax = k.item("onViewInit"); this.aw(ax); } } }; ComponentRenderer.prototype.fo = 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.fd(a, c); break; case "refClearItems": this.fe(a, c); break; case "refNotifyInsertItem": this.ff(a, c); break; case "refNotifyRemoveItem": this.fg(a, c); break; case "refNotifySetItem": this.fh(a, c); break; case "refNotifyUpdateItem": this.fi(a, c); break; } } } }; ComponentRenderer.prototype.fi = function (a, b) { throw new NotImplementedException(0); }; 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 = null; var i = this.h(b, d); if (b.g("oldItem")) { g = this.c0(b.item("oldItem"), i, null); } if (b.g("newItem")) { h = this.c0(b.item("newItem"), i, null); } var j = null; var k = null; if (g != null) { j = this.d4(g); } if (h != null) { k = this.d4(h); } var l = this.dh(a, d); if (l == null) { return; } if (this.bh.containsKey(d)) { var m = this.bh.item(d); if (k != null) { m.item(k, h); } } if (this.br.containsKey(d)) { var n = this.br.item(d); if (k != null && h != null) { n.item(h, k); } } this.gk(l, e, h); if (this.ah) { if (this.d8(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.bh.containsKey(d)) { var q = this.bh.item(d); var r = this.br.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.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("oldItem")) { g = this.c0(b.item("oldItem"), h, null); } var i = null; var j = null; if (g != null) { i = this.d4(g); } var k = this.dh(a, d); if (k == null) { return; } this.fv(k, e); if (this.ah) { if (this.d8(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.bh.containsKey(d)) { var n = this.bh.item(d); var o = this.br.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.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 = -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.c0(b.item("newItem"), h, null); } var i = null; if (g != null) { i = this.d4(g); } var j = this.dh(a, d); if (j == null) { return; } if (this.bh.containsKey(d)) { var k = this.bh.item(d); if (i != null) { k.item(i, g); } } if (this.br.containsKey(d)) { var l = this.br.item(d); if (g != null && i != null) { l.item(g, i); } } this.e7(j, e, g); if (this.ah) { if (this.d8(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, "ah", { get: function () { return true; }, enumerable: false, configurable: true }); ComponentRenderer.prototype.d4 = function (a) { if (a == null) { return null; } if (this.af(a, "___id")) { return this.da(a, "___id").toString(); } var b = Guid.newGuid().toString(); this.gl(a, "___id", b); return b; }; ComponentRenderer.prototype.h = function (a, b) { if (this.bf.containsKey(b)) { return this.bf.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.bf.item(b, e); this.e6(d, e); return e; } } } return null; }; ComponentRenderer.prototype.e6 = 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.e6(d, e); } } }; 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.bh.item(d, new Dictionary$2(String_$type, Base.$, 0)); this.br.item(d, new Dictionary$2(Base.$, String_$type, 0)); var f = this.bh.item(d); var g = this.br.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.fn(b.item("dataIntents"), d, e, j); } var q = this.dh(a, d); if (q != null) { this.gd(q, j.items.length); for (var r = 0; r < j.items.length; r++) { var s = this.c9(i, r); this.gk(q, r, s); } } if (this.ah) { if (this.d8(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.fd = 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.bh.item(d, new Dictionary$2(String_$type, Base.$, 0)); this.br.item(d, new Dictionary$2(Base.$, String_$type, 0)); var f = this.bh.item(d); var g = this.br.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.c7(d, j, f, g, h); } i = this.d2(i); if (b.g("dataIntents")) { this.fn(b.item("dataIntents"), d, i, j); } if (i != null) { this.x = true; } this.provideRefValue(a, d, i); if (i != null) { this.x = false; } }; ComponentRenderer.prototype.c7 = 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.eo(a, b, g, c, d); } return f; }; ComponentRenderer.prototype.eo = 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.eo(a, h, g, d, e); } else { var i = this.d4(g); if (i != null) { d.item(i, g); if (g != null) { e.item(g, i); } } } } }; ComponentRenderer.prototype.fn = 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.fn(a.item("subIntents"), b, this.c9(c, 0), d.items[e]); } } else { this.fn(a.item("subIntents"), b, this.c9(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.fn(a.item("subIntents"), b, this.da(this.c9(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.c0(f, null, null); this.provideRefValue(a, d, j); } }; ComponentRenderer.prototype.addMemberPathTransformer = function (a) { this.b0.add(a); }; ComponentRenderer.prototype.removeMemberPathTransformer = function (a) { this.b0.remove(a); }; ComponentRenderer.prototype.addReferenceResolver = function (a) { this.b2.add(a); }; ComponentRenderer.prototype.removeReferenceResolver = function (a) { this.b2.remove(a); }; ComponentRenderer.prototype.f = function (a) { if (this.b2.count == 0) { return null; } var b = new ComponentRendererReferenceResolverEventArgs(); for (var c = 0; c < this.b2.count; c++) { this.b2._inner[c](a, b); } return b; }; ComponentRenderer.prototype.ca = function () { var _this = this; if (this.b0.count > 0) { return function (a) { var b = a; for (var c = 0; c < _this.b0.count; c++) { b = _this.b0._inner[c](b); } return b; }; } return null; }; ComponentRenderer.prototype.ay = function (a) { return false; }; ComponentRenderer.prototype.ax = function (a) { return false; }; ComponentRenderer.prototype.au = function (a) { return false; }; ComponentRenderer.prototype.a2 = function (a) { return false; }; ComponentRenderer.prototype.av = function (a) { return false; }; ComponentRenderer.prototype.aw = function (a) { return false; }; ComponentRenderer.prototype.d6 = 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.e1 = function (a, b, c, d) { var e_3, _a; if (!c.b(b)) { c.k(d, this.be.item(d).g, b, this.be.item(d), runOn(this, this.fq), -1); } try { for (var _b = __values(fromEnum(a.f())), _c = _b.next(); !_c.done; _c = _b.next()) { var e = _c.value; this.e2(this.d6(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.e2 = 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.fq), f); } try { for (var _b = __values(fromEnum(g.f())), _c = _b.next(); !_c.done; _c = _b.next()) { var i = _c.value; this.e2(a + "." + this.d6(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.fq), f); } try { for (var _b = __values(fromEnum(s.f())), _c = _b.next(); !_c.done; _c = _b.next()) { var t = _c.value; _this.e2(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.ec(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