UNPKG

igniteui-angular-core

Version:

Ignite UI Angular Core logic used in multiple UI components.

1,288 lines 246 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 { CodeGeneratingComponentRendererHandlerEmitter } from "./CodeGeneratingComponentRendererHandlerEmitter"; import { CodeGeneratingRendererResult } from "./CodeGeneratingRendererResult"; import { CodeGeneratingImportManager } from "./CodeGeneratingImportManager"; import { CodeGeneratingCodeWriter } from "./CodeGeneratingCodeWriter"; import { Base, markType, BaseError, fromEnum, typeCast, EnumUtil, getInstanceType, NotSupportedException, IList_$type, String_$type, Array_$type, Boolean_$type, fromEn, Number_$type, Point_$type, typeGetValue, runOn } from "./type"; import { CodeGeneratingComponentRendererDataEmitter } from "./CodeGeneratingComponentRendererDataEmitter"; import { List$1 } from "./List$1"; import { JsonDictionaryValue } from "./JsonDictionaryValue"; import { JsonDictionaryObject } from "./JsonDictionaryObject"; import { JsonDictionaryValueType_$type } from "./JsonDictionaryValueType"; import { JsonDictionaryArray } from "./JsonDictionaryArray"; import { CodeGenerationTargetPlatforms_$type } from "./CodeGenerationTargetPlatforms"; import { stringReplace, stringContains, stringJoin1, stringIsNullOrEmpty, stringStartsWith, stringEndsWith } from "./string"; import { Stack$1 } from "./Stack$1"; import { CodeGenerationItemBuilderPropertyInfo } from "./CodeGenerationItemBuilderPropertyInfo"; import { TypeDescriptionContext } from "./TypeDescriptionContext"; import { TypeDescriptionMetadata } from "./TypeDescriptionMetadata"; import { Rect } from "./Rect"; import { Size } from "./Size"; import { CodeGenerationSpecialValue } from "./CodeGenerationSpecialValue"; import { ColorUtil } from "./ColorUtil"; import { Brush } from "./Brush"; import { StringBuilder } from "./StringBuilder"; import { HashSet$1 } from "./HashSet$1"; import { isNaN_ } from "./number"; import { trimEnd } from "./stringExtended"; import { WebImportsHalper } from "./WebImportsHalper"; import { Dictionary$2 } from "./Dictionary$2"; import { CodeGeneratingRegexHelper } from "./CodeGeneratingRegexHelper"; import { timeSpanFromMilliseconds } from "./timespan"; import { ComponentRenderer } from "./ComponentRenderer"; import { DotNetCodeGeneratingComponentRendererHandlerEmitter } from "./DotNetCodeGeneratingComponentRendererHandlerEmitter"; import { TSCodeGeneratingComponentRendererTemplateEmitter } from "./TSCodeGeneratingComponentRendererTemplateEmitter"; import { KotlinCodeGeneratingComponentRendererTemplateEmitter } from "./KotlinCodeGeneratingComponentRendererTemplateEmitter"; import { SwiftCodeGeneratingComponentRendererTemplateEmitter } from "./SwiftCodeGeneratingComponentRendererTemplateEmitter"; import { DotNetCodeGeneratingComponentRendererTemplateEmitter } from "./DotNetCodeGeneratingComponentRendererTemplateEmitter"; import { TSCodeGeneratingComponentRendererModuleEmitter } from "./TSCodeGeneratingComponentRendererModuleEmitter"; import { DotNetCodeGeneratingComponentRendererModuleEmitter } from "./DotNetCodeGeneratingComponentRendererModuleEmitter"; import { KotlinCodeGeneratingComponentRendererModuleEmitter } from "./KotlinCodeGeneratingComponentRendererModuleEmitter"; import { SwiftCodeGeneratingComponentRendererModuleEmitter } from "./SwiftCodeGeneratingComponentRendererModuleEmitter"; import { BlazorCodeGeneratingComponentRendererModuleEmitter } from "./BlazorCodeGeneratingComponentRendererModuleEmitter"; import { CodeGenerationTransformer } from "./CodeGenerationTransformer"; import { LinearGradientBrush } from "./LinearGradientBrush"; import { IComponentRendererAdapter_$type } from "./IComponentRendererAdapter"; /** * @hidden */ var KotlinCodeGeneratingComponentRendererHandlerEmitter = /** @class */ /*@__PURE__*/ (function (_super) { __extends(KotlinCodeGeneratingComponentRendererHandlerEmitter, _super); function KotlinCodeGeneratingComponentRendererHandlerEmitter(a, b) { return _super.call(this, a, b) || this; } KotlinCodeGeneratingComponentRendererHandlerEmitter.prototype.v = function (a, b) { _super.prototype.v.call(this, a, b); a.addUsing(b); }; KotlinCodeGeneratingComponentRendererHandlerEmitter.prototype.t = function (a, b) { _super.prototype.t.call(this, a, b); this.g.l("this." + CodeGeneratingComponentRenderer.g7(a) + "();"); }; KotlinCodeGeneratingComponentRendererHandlerEmitter.prototype.u = function (a, b) { _super.prototype.u.call(this, a, b); this.h.l("this." + CodeGeneratingComponentRenderer.g7(a) + "();"); }; KotlinCodeGeneratingComponentRendererHandlerEmitter.prototype.q = function (a, b) { return a; }; KotlinCodeGeneratingComponentRendererHandlerEmitter.$t = markType(KotlinCodeGeneratingComponentRendererHandlerEmitter, 'KotlinCodeGeneratingComponentRendererHandlerEmitter', CodeGeneratingComponentRendererHandlerEmitter.$); return KotlinCodeGeneratingComponentRendererHandlerEmitter; }(CodeGeneratingComponentRendererHandlerEmitter)); export { KotlinCodeGeneratingComponentRendererHandlerEmitter }; /** * @hidden */ var KotlinCodeGeneratingComponentRendererDataEmitter = /** @class */ /*@__PURE__*/ (function (_super) { __extends(KotlinCodeGeneratingComponentRendererDataEmitter, _super); function KotlinCodeGeneratingComponentRendererDataEmitter(a, b) { return _super.call(this, a, b) || this; } KotlinCodeGeneratingComponentRendererDataEmitter.prototype.ab = function (a, b) { this.l = CodeGeneratingImportManager.merge(this.l, b); }; KotlinCodeGeneratingComponentRendererDataEmitter.prototype.af = function (a) { a.l("package com.infragistics.mobile.samples;"); _super.prototype.af.call(this, a); }; KotlinCodeGeneratingComponentRendererDataEmitter.prototype.x = function (a, b) { if (b === void 0) { b = false; } a = CodeGeneratingComponentRenderer.g8(a); a = stringReplace(a, "-", "_"); if (b) { a += "Item"; } return a; }; KotlinCodeGeneratingComponentRendererDataEmitter.prototype.w = function (a) { a = stringReplace(a, "-", "_"); if (this.p.g) { return a; } return CodeGeneratingComponentRenderer.g7(a); }; KotlinCodeGeneratingComponentRendererDataEmitter.prototype.aq = function (a) { a = stringReplace(a, "-", "_"); return "_" + CodeGeneratingComponentRenderer.g7(a); }; KotlinCodeGeneratingComponentRendererDataEmitter.prototype.al = function (a, b, c, d, e, f) { var e_1, _a; _super.prototype.al.call(this, a, b, c, d, e, f); var g = this.s(this.x(b, true), this.x(b, false), c, d); try { for (var _b = __values(fromEnum(g)), _c = _b.next(); !_c.done; _c = _b.next()) { var h = _c.value; this.ad(h, e, f); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_1) throw e_1.error; } } e.l(""); e.l("public class " + this.x(b, false)); e.h(); e.l(": ArrayList<" + this.x(b, true) + ">"); e.f(); e.l("{"); e.h(); e.l("public constructor() {"); e.h(); }; KotlinCodeGeneratingComponentRendererDataEmitter.prototype.ah = function (a, b, c) { _super.prototype.ah.call(this, a, b, c); if (b == 3) { var d = this.p.cDNBasePath + this.x(a, false) + ".json"; this.g.l("public RemoteJSON " + this.w(a)); this.g.l("{"); this.g.h(); this.g.l("get"); this.g.l("{"); this.g.h(); this.g.l("return RemoteJSON.LoadFrom(\"" + d + "\");"); this.g.f(); this.g.l("}"); this.g.l(""); return; } var e = this.aq(a) + " = " + "new " + this.x(a, false) + "(); "; var f = ""; if (this.n.platform == 5) { f = " StateHasChanged();"; } else { f = " OnPropertyChanged(\"" + this.x(a, false) + "\");"; } if (c != null && (b == 2 || c.isAsync)) { e = this.x(a, false) + ".Fetch().ContinueWith((t) => {" + this.aq(a) + " = t.Result; " + f + " });"; } this.g.l("private " + this.x(a, false) + " " + this.aq(a) + " = null;"); this.g.l("public " + this.x(a, false) + " " + this.w(a)); this.g.l("{"); this.g.h(); this.g.l("get"); this.g.l("{"); this.g.h(); this.g.l("if (" + this.aq(a) + " == null)"); this.g.l("{"); this.g.h(); this.g.l(e); this.g.f(); this.g.l("}"); this.g.l("return " + this.aq(a) + ";"); this.g.f(); this.g.l("}"); this.g.f(); this.g.l("}"); this.g.l(""); }; KotlinCodeGeneratingComponentRendererDataEmitter.prototype.ai = function (a, b) { _super.prototype.ai.call(this, a, b); this.g.l("private var " + this.aq(a) + ": " + this.an(b.e) + " = " + this.ao(b) + ";"); this.g.l("public var " + this.w(a) + ": " + this.an(b.e) + " {"); this.g.h(); this.g.l("get () {"); this.g.h(); this.g.l("return " + this.aq(a) + ";"); this.g.f(); this.g.l("}"); this.g.f(); this.g.l(""); }; KotlinCodeGeneratingComponentRendererDataEmitter.prototype.aj = function (a, b, c, d) { _super.prototype.aj.call(this, a, b, c, d); this.g.l("private var " + this.aq(a) + ": " + this.x(a, false) + "Item " + " = null;"); this.g.l("public var " + this.w(a) + ": " + this.x(a, false) + "Item"); this.g.h(); this.g.l("get () {"); this.g.h(); this.g.l("if (" + this.aq(a) + " == null)"); this.g.l("{"); this.g.h(); this.g.l("_" + a + " = "); this.ar(this.x(a, true), b, c, d, this.g); this.g.f(); this.g.l("}"); this.g.l("return " + this.aq(a) + ";"); this.g.f(); this.g.l("}"); this.g.f(); this.g.l(""); }; KotlinCodeGeneratingComponentRendererDataEmitter.prototype.get_t = function () { return ".kt"; }; KotlinCodeGeneratingComponentRendererDataEmitter.prototype.ad = function (a, b, c) { b.l("public class " + a.d + "{"); b.h(); for (var d = 0; d < a.a.length; d++) { var e = a.a[d]; var f = a.b[d]; b.l("private var " + this.aq(e) + ": " + this.ap(a, e, f) + " = " + this.am(a, e, f) + ";"); b.l("public var " + this.w(e) + ": " + this.ap(a, e, f)); b.h(); b.l("get() { return " + this.aq(e) + "; }"); b.l("set(v) { " + this.aq(e) + " = v; }"); b.f(); } b.f(); b.l("}"); }; KotlinCodeGeneratingComponentRendererDataEmitter.prototype.am = function (a, b, c) { if (c.d) { return "null"; } else if (c.f) { return "null"; } else { switch (c.c) { case 1: return "false"; case 0: return "0.0"; case 2: return "null"; case 3: return "null"; } } return "null"; }; KotlinCodeGeneratingComponentRendererDataEmitter.prototype.an = function (a) { switch (a) { case 1: return "Boolean"; case 0: return "Double"; case 2: return "String?"; case 3: return "Any?"; } return "Any?"; }; KotlinCodeGeneratingComponentRendererDataEmitter.prototype.get_r = function () { return true; }; KotlinCodeGeneratingComponentRendererDataEmitter.prototype.ap = function (a, b, c) { if (c.d) { return "List<" + a.d + "_" + CodeGeneratingComponentRenderer.g8(this.w(b)) + "Item?>?"; } else if (c.f) { return a.d + "_" + CodeGeneratingComponentRenderer.g8(this.w(b)) + "?"; } else { switch (c.c) { case 1: return "Boolean"; case 0: return "Double"; case 2: return "String?"; case 3: return "Any?"; } } return "Any?"; }; KotlinCodeGeneratingComponentRendererDataEmitter.prototype.ak = function (a, b, c, d, e) { _super.prototype.ak.call(this, a, b, c, d, e); e.f(); e.l("};"); e.f(); e.l("}"); }; KotlinCodeGeneratingComponentRendererDataEmitter.prototype.y = function (a, b, c, d, e, f, g) { _super.prototype.y.call(this, a, b, c, d, e, f, g); if (a == 2 || a == 3) { return; } g.j("this.add("); this.ar(this.x(b, true), c, d, e, g); g.l(");"); }; KotlinCodeGeneratingComponentRendererDataEmitter.prototype.ar = function (a, b, c, d, e) { if (d == null) { e.j("null"); return; } if (typeCast(JsonDictionaryArray.$, d) !== null) { var f = d; e.l("mutableListOf<" + a + ">().apply {"); e.h(); if (f.items != null && f.items.length > 0) { for (var g = 0; g < f.items.length; g++) { if (g > 0) { e.l(";"); } e.j("add("); this.ar(a, b, c, f.items[g], e); e.j(")"); } } e.f(); e.l("}"); } else if (typeCast(JsonDictionaryObject.$, d) !== null) { var h = d; e.l("" + a + "().apply {"); e.h(); for (var i = 0; i < b.length; i++) { var j = b[i]; var k = c[i]; if (!h.g(j)) { continue; } if (i > 0) { e.l(";"); } e.j(this.w(j) + " = "); if (k.d) { var l = a + "_" + CodeGeneratingComponentRenderer.g8(this.w(j)) + "Item"; this.ar(l, k.a, k.b, h.item(j), e); } else if (k.f) { var m = a + "_" + CodeGeneratingComponentRenderer.g8(this.w(j)); this.ar(m, k.a, k.b, h.item(j), e); } else { var n = h.item(j); try { e.j(this.u(k, n)); } catch (o) { var p = getInstanceType(n.value).typeName; var q = stringReplace(EnumUtil.getName(JsonDictionaryValueType_$type, k.c), "Value", ""); var r = "'" + j + "' property (" + n.value + ") is '" + p + "' instead of '" + q + "' type."; throw new BaseError(1, "Failed on creating '" + a + "' because " + r + "\n" + o.message); } } } e.l(""); e.f(); e.j("}"); } }; KotlinCodeGeneratingComponentRendererDataEmitter.prototype.u = function (a, b) { switch (a.c) { case 1: return (b.value ? "true" : "false"); case 0: if (b == null || b.value == null) { return "Double.NaN"; } var c = b.value.toString(); if (!stringContains(c, ".") && !stringContains(c, "E") && !stringContains(c, "e")) { c += ".0"; } return c; case 2: if (b.value == null) { return "null"; } else { return ("\"\"\"" + b.value + "\"\"\""); } case 3: return ("null"); } return ""; }; KotlinCodeGeneratingComponentRendererDataEmitter.prototype.ao = function (a) { switch (a.e) { case 1: return (a.value ? "true" : "false"); case 0: return (a.value.toString()); case 2: return ("\"\"\"" + a.value + "\"\"\""); case 3: return "null"; } return ""; }; KotlinCodeGeneratingComponentRendererDataEmitter.$t = markType(KotlinCodeGeneratingComponentRendererDataEmitter, 'KotlinCodeGeneratingComponentRendererDataEmitter', CodeGeneratingComponentRendererDataEmitter.$); return KotlinCodeGeneratingComponentRendererDataEmitter; }(CodeGeneratingComponentRendererDataEmitter)); export { KotlinCodeGeneratingComponentRendererDataEmitter }; /** * @hidden */ var CodeGeneratingComponentRendererCodeEmitter = /** @class */ /*@__PURE__*/ (function (_super) { __extends(CodeGeneratingComponentRendererCodeEmitter, _super); function CodeGeneratingComponentRendererCodeEmitter(a, b) { var _this = _super.call(this) || this; _this.l = null; _this.j = null; _this.aa = new List$1(CodeGenerationItemBuilderPropertyInfo.$, 0); _this.d = null; _this.a = null; _this.c = null; _this.b = null; _this.ab = new List$1(String_$type, 0); _this.ag = new Stack$1(String_$type); _this.ae = new Stack$1(String_$type); _this.af = new Stack$1(Boolean_$type); _this.a6 = null; _this.a5 = null; _this.l = a; _this.j = b; _this.d = new CodeGeneratingCodeWriter(_this.l); _this.a = new CodeGeneratingCodeWriter(_this.l); _this.c = new CodeGeneratingCodeWriter(_this.l); _this.b = new CodeGeneratingCodeWriter(_this.l); return _this; } CodeGeneratingComponentRendererCodeEmitter.prototype.get_am = function () { switch (this.j.platform) { case 1: return "Igx"; case 2: return "Igr"; case 3: return "Igc"; case 4: return "Ultra"; case 0: return "Xam"; case 5: return "Igb"; case 6: return "Iga"; case 7: return "Igs"; } return ""; }; Object.defineProperty(CodeGeneratingComponentRendererCodeEmitter.prototype, "am", { get: function () { return this.get_am(); }, enumerable: false, configurable: true }); CodeGeneratingComponentRendererCodeEmitter.prototype.get_an = function () { switch (this.j.platform) { case 1: return "Component"; case 2: return ""; case 3: return "Component"; case 4: return ""; case 0: return ""; case 6: return ""; case 7: return ""; } return ""; }; Object.defineProperty(CodeGeneratingComponentRendererCodeEmitter.prototype, "an", { get: function () { return this.get_an(); }, enumerable: false, configurable: true }); Object.defineProperty(CodeGeneratingComponentRendererCodeEmitter.prototype, "a7", { get: function () { switch (this.j.platform) { case 1: return "angular"; case 2: return "react"; case 3: return "webcomponents"; } return ""; }, enumerable: false, configurable: true }); Object.defineProperty(CodeGeneratingComponentRendererCodeEmitter.prototype, "m", { get: function () { return this.l; }, enumerable: false, configurable: true }); CodeGeneratingComponentRendererCodeEmitter.prototype.bs = function (a) { this.j.af(a); }; Object.defineProperty(CodeGeneratingComponentRendererCodeEmitter.prototype, "k", { get: function () { return this.j; }, enumerable: false, configurable: true }); Object.defineProperty(CodeGeneratingComponentRendererCodeEmitter.prototype, "h", { get: function () { return this.d; }, enumerable: false, configurable: true }); Object.defineProperty(CodeGeneratingComponentRendererCodeEmitter.prototype, "e", { get: function () { return this.a; }, enumerable: false, configurable: true }); Object.defineProperty(CodeGeneratingComponentRendererCodeEmitter.prototype, "g", { get: function () { return this.c; }, enumerable: false, configurable: true }); Object.defineProperty(CodeGeneratingComponentRendererCodeEmitter.prototype, "f", { get: function () { return this.b; }, enumerable: false, configurable: true }); CodeGeneratingComponentRendererCodeEmitter.prototype.bc = function (a) { if (a == null || a == "any") { return; } this.ab.add(a); }; CodeGeneratingComponentRendererCodeEmitter.prototype.w = function (a, b) { if (this.r) { return false; } if (a.hasMustSetInCodePlatforms(b.b.owningType, b.b.propertyName)) { var c = a.getMustSetInCodePlatforms(b.b.owningType, b.b.propertyName); var _loop_1 = function (e) { var d = c[e]; var f = 0; if (((function () { var g = EnumUtil.tryParse$1(CodeGenerationTargetPlatforms_$type, d, true, f); f = g.p2; return g.ret; })())) { if (f == this_1.j.platform) { return { value: true }; } } }; var this_1 = this; for (var e = 0; e < c.length; e++) { var state_1 = _loop_1(e); if (typeof state_1 === "object") return state_1.value; } } return false; }; CodeGeneratingComponentRendererCodeEmitter.prototype.q = function (a, b) { if (b.b != null && (b.b.knownType == 20 || b.b.knownType == 19 || b.b.knownType == 22 || b.b.knownType == 18)) { if (b.a != null) { return true; } } if (b.b != null && (b.b.knownType == 8 || b.b.knownType == 9 || b.b.knownType == 10)) { if (this.w(a, b)) { return true; } } return false; }; CodeGeneratingComponentRendererCodeEmitter.prototype.t = function (a) { if (a.b != null && (a.b.knownType == 19)) { if (a.a != null) { return true; } } return false; }; Object.defineProperty(CodeGeneratingComponentRendererCodeEmitter.prototype, "ar", { get: function () { return this.ag.d(); }, enumerable: false, configurable: true }); CodeGeneratingComponentRendererCodeEmitter.prototype.bd = function (a, b, c) { this.ag.h(a); }; CodeGeneratingComponentRendererCodeEmitter.prototype.u = function (a, b) { var c = false; if (b.getMetadata(a, "__isPlainObject") != null) { c = true; } return c; }; CodeGeneratingComponentRendererCodeEmitter.prototype.br = function () { }; CodeGeneratingComponentRendererCodeEmitter.prototype.bl = function (a) { }; CodeGeneratingComponentRendererCodeEmitter.prototype.bm = function (a) { this.ag.e(); }; CodeGeneratingComponentRendererCodeEmitter.prototype.x = function (a, b, c) { return b.b == null && a.toLowerCase() == "type"; }; CodeGeneratingComponentRendererCodeEmitter.prototype.bj = function (a, b, c, d) { }; CodeGeneratingComponentRendererCodeEmitter.prototype.bk = function (a, b, c, d) { this.bj(a, b, c, d); }; CodeGeneratingComponentRendererCodeEmitter.prototype.toString = function () { return this.d.toString(); }; CodeGeneratingComponentRendererCodeEmitter.prototype.a1 = function () { return "null"; }; CodeGeneratingComponentRendererCodeEmitter.prototype.a4 = function (a, b, c) { if (b.b == null) { return b.c; } if (typeCast(CodeGenerationSpecialValue.$, b.c) !== null) { b.c = this.ah(b); } switch (b.b.knownType) { case 10: if (this.w(a, b)) { return this.ap(a, b); } return this.au(a, b); case 23: if (this.w(a, b)) { return this.ap(a, b); } return this.au(a, b); case 7: return b.c ? "true" : "false"; case 4: return this.aj(b); case 6: { return stringJoin1(String_$type, " ", this.ac(b, c)); } case 9: if (this.w(a, b)) { return this.ap(a, b); } throw new NotSupportedException(1, "shouldn't get here"); case 5: return this.al(b); case 16: { return stringJoin1(String_$type, " ", this.ad(b, c)); } case 20: if (b.a != null) { return this.a3(b); } if (b.c == null) { return this.a1(); } break; case 22: if (b.a != null) { return this.a3(b); } if (b.c == null) { return this.a1(); } break; case 15: throw new NotSupportedException(1, "need to figure this out"); case 3: throw new NotSupportedException(1, "need to figure this out"); case 19: if (b.a != null) { return this.ay(b); } else { return this.a1(); } case 8: if (b.b.specificExternalType == "string") { return this.ax(b); } if (b.a != null) { return this.az(b); } if (this.w(a, b)) { return this.ap(a, b); } throw new NotSupportedException(1, "shouldn't get here"); case 13: throw new NotSupportedException(1, "shouldn't get here"); case 18: if (b.a != null) { return this.a0(b); } else { return this.a1(); } case 24: case 1: return b.c.toString(); case 25: case 11: { var d = b.c; return d.x + ", " + d.y; } case 26: case 14: { var e = b.c; return e.left + ", " + e.top + ", " + e.width + ", " + e.height; } case 27: case 12: { var f = b.c; return f.width + ", " + f.height; } case 2: return b.c != null ? b.c.toString() : this.a1(); case 21: return this.ba(b.c); case 17: if (b.c == null) { return "null"; } if (typeof b.c === 'string') { return b.c.toString(); } return b.c.toString(); case 0: throw new NotSupportedException(1, "shouldn't get here"); } return ""; }; CodeGeneratingComponentRendererCodeEmitter.prototype.ac = function (a, b) { if (a.b == null) { return ((function () { var $ret = new List$1(String_$type, 0); $ret.add(a.c); return $ret; })()); } if (typeCast(CodeGenerationSpecialValue.$, a.c) !== null) { a.c = this.ah(a); } var c = a.c; var d = new List$1(String_$type, 0); for (var e = 0; e < c.count; e++) { d.add(this.ai(c.item(e))); } return d; }; CodeGeneratingComponentRendererCodeEmitter.prototype.ad = function (a, b) { if (a.b == null) { return ((function () { var $ret = new List$1(String_$type, 0); $ret.add(a.c); return $ret; })()); } if (typeCast(CodeGenerationSpecialValue.$, a.c) !== null) { a.c = this.ah(a); } var c = a.c; var d = new List$1(String_$type, 0); for (var e = 0; e < c.count; e++) { d.add(this.ak(c.item(e))); } return d; }; CodeGeneratingComponentRendererCodeEmitter.prototype.ba = function (a) { if (a == null) { return ""; } return a.toString(); }; CodeGeneratingComponentRendererCodeEmitter.prototype.ap = function (a, b) { var c = this.a9(a, b); if (b.c != null) { var d = b.c; if (typeCast(List$1.$.specialize(Base.$), d) !== null) { d = d.toArray(); } if (typeCast(CodeGenerationItemBuilder.$, d) !== null) { var e = this.i(this.l, this.j); var f = this.ao(c, b.c, e); c = this.as(a, b.c, f, c); } else if (typeCast(Array_$type, d) !== null) { var g = d; var h = new List$1(CodeGenerationItemBuilder.$, 0); var i = new List$1(String_$type, 0); for (var j = 0; j < g.length; j++) { if (typeCast(CodeGenerationItemBuilder.$, g[j]) !== null) { var k = this.i(this.l, this.j); var l = c; var m = g[j].p(); if (m == null) { m = g[j].n(); m = this.av(m); } if (m != null) { if (m != l) { l = m; } else { l = c + "_" + j.toString(); } } var n = this.ao(l, g[j], k); h.add(g[j]); i.add(n); } } c = this.at(b, a, h, i, c); } } return c; }; CodeGeneratingComponentRendererCodeEmitter.prototype.ao = function (a, b, c) { var e_2, _a; b.u = a; b.v(c, true); var d = c.toString(); try { for (var _b = __values(fromEnum(c.ab)), _c = _b.next(); !_c.done; _c = _b.next()) { var e = _c.value; this.ab.add(e); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_2) throw e_2.error; } } return d; }; CodeGeneratingComponentRendererCodeEmitter.prototype.as = function (a, b, c, d) { return d; }; CodeGeneratingComponentRendererCodeEmitter.prototype.at = function (a, b, c, d, e) { return e; }; CodeGeneratingComponentRendererCodeEmitter.prototype.a9 = function (a, b) { if (b.c == null) { return this.a1(); } if (typeCast(CodeGenerationItemBuilder.$, b.c) !== null) { var c = b.c.p(); if (c != null) { return c; } var d = b.c.n(); var e = this.av(d); return e; } else if (typeCast(IList_$type, b.c) !== null) { var f = b.c; if (f.count > 0 && typeCast(CodeGenerationItemBuilder.$, f.item(0)) !== null) { var g = f.item(0); var h = g.p(); if (h != null) { return h; } var i = g.n(); var j = this.av(i); return j; } return this.av(b.b.propertyName); } else if (typeCast(Array_$type, b.c) !== null) { var k = b.c; if (k.length > 0 && typeCast(CodeGenerationItemBuilder.$, k[0]) !== null) { var l = b.c.p(); if (l != null) { return l; } var m = b.c.n(); var n = this.av(m); return n; } return this.av(b.b.propertyName); } return this.a1(); }; CodeGeneratingComponentRendererCodeEmitter.prototype.au = function (a, b) { return ""; }; CodeGeneratingComponentRendererCodeEmitter.prototype.ah = function (a) { return a.c; }; CodeGeneratingComponentRendererCodeEmitter.prototype.a3 = function (a) { if (!stringIsNullOrEmpty(a.a.e)) { if (a.a.a) { return this.aw(a); } else { return this.a2(a); } } return this.a1(); }; CodeGeneratingComponentRendererCodeEmitter.prototype.s = function (a) { if (a.a != null && !stringIsNullOrEmpty(a.a.e)) { if (a.a.a) { return true; } } return false; }; CodeGeneratingComponentRendererCodeEmitter.prototype.a2 = function (a) { return ""; }; CodeGeneratingComponentRendererCodeEmitter.prototype.aw = function (a) { return ""; }; CodeGeneratingComponentRendererCodeEmitter.prototype.az = function (a) { if (!stringIsNullOrEmpty(a.a.e)) { return a.a.e; } return this.a1(); }; CodeGeneratingComponentRendererCodeEmitter.prototype.ax = function (a) { return a.c != null ? a.c.toString() : ""; }; CodeGeneratingComponentRendererCodeEmitter.prototype.a0 = function (a) { return this.ay(a); }; CodeGeneratingComponentRendererCodeEmitter.prototype.ay = function (a) { if (!stringIsNullOrEmpty(a.a.e)) { this.bs(a); return a.a.e; } return this.a1(); }; CodeGeneratingComponentRendererCodeEmitter.prototype.get_y = function () { return false; }; Object.defineProperty(CodeGeneratingComponentRendererCodeEmitter.prototype, "y", { get: function () { return this.get_y(); }, enumerable: false, configurable: true }); CodeGeneratingComponentRendererCodeEmitter.prototype.al = function (a) { var b = a.c; return ColorUtil.k(b, this.y); }; CodeGeneratingComponentRendererCodeEmitter.prototype.ak = function (a) { var b = a; return ColorUtil.k(b, this.y); }; CodeGeneratingComponentRendererCodeEmitter.prototype.aj = function (a) { if (a.c == null) { return ""; } var b = a.c; return ColorUtil.k(b.color, this.y); }; CodeGeneratingComponentRendererCodeEmitter.prototype.ai = function (a) { if (a == null) { return ""; } var b = a; return ColorUtil.k(b.color, this.y); }; CodeGeneratingComponentRendererCodeEmitter.prototype.bq = function (a) { this.ae.h(a); this.af.h(false); }; CodeGeneratingComponentRendererCodeEmitter.prototype.bp = function (a) { var b = this.av(a); this.ae.h(b); this.af.h(true); }; CodeGeneratingComponentRendererCodeEmitter.prototype.av = function (a) { var b = stringReplace(stringReplace(a, this.a8, ""), "Component", ""); b = CodeGeneratingComponentRenderer.g7(b); return this.j.v(b); }; CodeGeneratingComponentRendererCodeEmitter.prototype.bn = function () { this.a5 = this.ae.e(); this.af.e(); }; CodeGeneratingComponentRendererCodeEmitter.prototype.get_a8 = function () { return ""; }; Object.defineProperty(CodeGeneratingComponentRendererCodeEmitter.prototype, "a8", { get: function () { return this.get_a8(); }, enumerable: false, configurable: true }); Object.defineProperty(CodeGeneratingComponentRendererCodeEmitter.prototype, "aq", { get: function () { if (this.ae.f > 0) { return this.ae.d(); } var a = stringReplace(stringReplace(this.ar, this.a8, ""), "Component", ""); return CodeGeneratingComponentRenderer.g7(a); }, enumerable: false, configurable: true }); Object.defineProperty(CodeGeneratingComponentRendererCodeEmitter.prototype, "v", { get: function () { return this.ag.f == 1; }, enumerable: false, configurable: true }); Object.defineProperty(CodeGeneratingComponentRendererCodeEmitter.prototype, "o", { get: function () { if (this.af.f == 0) { return false; } return this.af.d(); }, enumerable: false, configurable: true }); Object.defineProperty(CodeGeneratingComponentRendererCodeEmitter.prototype, "p", { get: function () { if (this.ae.f > 0) { return true; } return false; }, enumerable: false, configurable: true }); CodeGeneratingComponentRendererCodeEmitter.prototype.get_z = function () { return true; }; Object.defineProperty(CodeGeneratingComponentRendererCodeEmitter.prototype, "z", { get: function () { return this.get_z(); }, enumerable: false, configurable: true }); CodeGeneratingComponentRendererCodeEmitter.prototype.get_n = function () { return this.r; }; Object.defineProperty(CodeGeneratingComponentRendererCodeEmitter.prototype, "n", { get: function () { return this.get_n(); }, enumerable: false, configurable: true }); CodeGeneratingComponentRendererCodeEmitter.prototype.bo = function () { this.a5 = this.ae.e(); }; CodeGeneratingComponentRendererCodeEmitter.prototype.bf = function (a) { var b = this.f.toString(); if (b.length > 0) { a.l(b); } }; CodeGeneratingComponentRendererCodeEmitter.prototype.bi = function (a) { var b = this.g.toString(); if (b.length > 0) { a.l(b); } }; CodeGeneratingComponentRendererCodeEmitter.prototype.be = function (a) { var b = this.e.toString(); if (b.length > 0) { a.l(b); } }; CodeGeneratingComponentRendererCodeEmitter.prototype.bg = function (a, b) { if (this.ab.count > 0) { this.bh(a, this.ab, b); } }; CodeGeneratingComponentRendererCodeEmitter.prototype.bh = function (a, b, c) { }; CodeGeneratingComponentRendererCodeEmitter.$t = markType(CodeGeneratingComponentRendererCodeEmitter, 'CodeGeneratingComponentRendererCodeEmitter'); return CodeGeneratingComponentRendererCodeEmitter; }(Base)); export { CodeGeneratingComponentRendererCodeEmitter }; /** * @hidden */ var KotlinCodeBehindCodeGeneratingComponentRendererCodeEmitter = /** @class */ /*@__PURE__*/ (function (_super) { __extends(KotlinCodeBehindCodeGeneratingComponentRendererCodeEmitter, _super); function KotlinCodeBehindCodeGeneratingComponentRendererCodeEmitter(a, b) { var _this = _super.call(this, a, b) || this; _this.bv = 0; _this.bt = new HashSet$1(String_$type, 0); _this.bu = new HashSet$1(String_$type, 0); return _this; } KotlinCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.ba = function (a) { if (a == null || isNaN_(a)) { return ""; } return "TimeSpan.FromMilliseconds(" + a + ")"; }; KotlinCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.get_r = function () { return true; }; Object.defineProperty(KotlinCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype, "r", { get: function () { return this.get_r(); }, enumerable: false, configurable: true }); KotlinCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.i = function (a, b) { return new KotlinCodeBehindCodeGeneratingComponentRendererCodeEmitter(a, b); }; KotlinCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.get_z = function () { return false; }; KotlinCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.au = function (a, b) { if (b.c == null) { return "null"; } var c = b.c; var d = ""; for (var e = 0; e < c.length; e++) { if (e > 0) { d += ", "; } d += c[e].toString(); } return d; }; KotlinCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.bd = function (a, b, c) { _super.prototype.bd.call(this, a, b, c); if (this.v) { this.h.l("var " + this.aq + " = " + a + "();"); } else { this.h.l("var " + this.aq + " = " + a + "();"); } if (!this.bt.contains(this.aq)) { this.bt.add_1(this.aq); if (!this.bu.contains(this.ar)) { this.bu.add_1(this.ar); this.bc(this.ar); } this.f.l("private var " + CodeGeneratingComponentRenderer.g7(this.aq) + ": " + this.ar); if (!this.p) { if (this.v) { this.g.l("var " + CodeGeneratingComponentRenderer.g7(this.aq) + " = this." + CodeGeneratingComponentRenderer.g7(this.aq) + " = document.querySelector('" + CodeGeneratingComponentRenderer.ha(stringReplace(this.ar, "Component", "")) + "') as " + this.ar + ";"); } } else { this.g.l("var " + CodeGeneratingComponentRenderer.g7(this.aq) + " = this." + CodeGeneratingComponentRenderer.g7(this.aq) + " = document.getElementById('" + this.aq + "') as " + this.ar + ";"); } } }; KotlinCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.br = function () { this.h.l(""); }; KotlinCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.bm = function (a) { { this.h.l(""); } _super.prototype.bm.call(this, a); }; KotlinCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.bj = function (a, b, c, d) { var e = CodeGeneratingComponentRenderer.g7(b); if (e == "name" && c.b == null) { return; } if (this.s(c)) { this.bs(c); if (!this.bt.contains(this.aq)) { this.bt.add_1(this.aq); if (!this.bu.contains(this.ar)) { this.bu.add_1(this.ar); this.bc(this.ar); } this.f.l("private var " + CodeGeneratingComponentRenderer.g7(this.aq) + ": " + this.ar); if (!this.p) { if (this.v) { this.g.l("var " + CodeGeneratingComponentRenderer.g7(this.aq) + " = this." + CodeGeneratingComponentRenderer.g7(this.aq) + " = document.querySelector('" + CodeGeneratingComponentRenderer.ha(stringReplace(this.ar, "Component", "")) + "') as " + this.ar + ";"); } } else { this.g.l("var " + CodeGeneratingComponentRenderer.g7(this.aq) + " = this." + CodeGeneratingComponentRenderer.g7(this.aq) + " = document.getElementById('" + this.aq + "') as " + this.ar + ";"); } } var f = CodeGeneratingComponentRenderer.g7(this.a4(d, c, true)); var g = f; if (g != "null" && !stringStartsWith(g, "this.")) { g = "this." + g; } if (this.ar == "any" && stringContains(e, "-")) { this.e.l(CodeGeneratingComponentRenderer.g7(this.aq) + "['" + e + "'] = " + g + ";"); } else { if (c.b != null && c.b.isCustomEvent) { this.e.l(CodeGeneratingComponentRenderer.g7(this.aq) + ".addEventListener(\"" + e + "\", " + g + ");"); } else { this.e.l(CodeGeneratingComponentRenderer.g7(this.aq) + "." + e + " = " + g + ";"); } } return; } if (a > 0) { this.h.l(""); } if (this.ar == "any" && stringContains(e, "-")) { this.h.j(this.aq + "." + CodeGeneratingComponentRenderer.g7(this.aq) + "['" + e + "']"); } else { this.h.j(this.aq + "." + CodeGeneratingComponentRenderer.g7(e)); } this.h.j(" = "); this.h.j(this.a4(d, c, true)); this.h.j(";"); }; KotlinCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.ah = function (a) { var b = a.c; switch (b.a) { case 3: return b.b; case 0: return b.b; case 1: return b.b; case 2: return b.b; } return b.b; }; KotlinCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.a1 = function () { return "null"; }; KotlinCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.ay = function (a) { if (!stringIsNullOrEmpty(a.a.e)) { this.bs(a); if (!this.bt.contains(a.a.e)) { this.g.l("this." + CodeGeneratingComponentRenderer.g7(a.a.e) + " = " + "this." + CodeGeneratingComponentRenderer.g7(a.a.e) + ".bind(this);"); } return "this." + CodeGeneratingComponentRenderer.g7(a.a.e); } return this.a1(); }; KotlinCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.aw = function (a) { return CodeGeneratingComponentRenderer.g7(a.a.e); }; KotlinCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.a2 = function (a) { return CodeGeneratingComponentRenderer.g7(a.a.e); }; KotlinCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.a4 = function (a, b, c) { if (b.b == null) { return "\"" + b.c + "\""; } if (typeCast(CodeGenerationSpecialValue.$, b.c) !== null) { b.c = this.ah(b); } switch (b.b.knownType) { case 25: case 11: { var d = b.c; return "IgaPoint(" + d.x + ", " + d.y + ")"; } case 26: case 14: { var e = b.c; return "IgaRect(" + e.left + ", " + e.top + ", " + e.width + ", " + e.height + ")"; } case 27: case 12: { var f = b.c; return "IgaSize(" + f.width + ", " + f.height + ")"; } case 17: if (b.c == null) { return "null"; } if (typeof b.c === 'string') { return "\"" + b.c.toString() + "\""; } if (typeCast(Boolean_$type, b.c) !== null) { return b.c ? "true" : "fa