UNPKG

igniteui-react-core

Version:
1,326 lines (1,325 loc) 183 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, NotSupportedException, IList_$type, String_$type, typeCast, Array_$type, fromEnum, Boolean_$type, markType, EnumUtil, fromEn, Number_$type, BaseError, getInstanceType, Point_$type, typeGetValue, runOn } from "./type"; import { CodeGenerationTargetPlatforms_$type } from "./CodeGenerationTargetPlatforms"; import { CodeGeneratingRendererResult } from "./CodeGeneratingRendererResult"; import { CodeGeneratingCodeWriter } from "./CodeGeneratingCodeWriter"; import { Stack$1 } from "./Stack$1"; import { CodeGenerationItemBuilderPropertyInfo } from "./CodeGenerationItemBuilderPropertyInfo"; import { List$1 } from "./List$1"; 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 { CodeGeneratingImportManager } from "./CodeGeneratingImportManager"; import { stringJoin1, stringIsNullOrEmpty, stringReplace, stringStartsWith, stringEndsWith, stringContains } from "./string"; import { HashSet$1 } from "./HashSet$1"; import { arrayGetValue } from "./array"; import { trimEnd } from "./stringExtended"; import { WebImportsHalper } from "./WebImportsHalper"; import { CodeGeneratingComponentRendererHandlerEmitter } from "./CodeGeneratingComponentRendererHandlerEmitter"; import { Dictionary$2 } from "./Dictionary$2"; import { CodeGeneratingRegexHelper } from "./CodeGeneratingRegexHelper"; import { CodeGeneratingComponentRendererDataEmitter } from "./CodeGeneratingComponentRendererDataEmitter"; import { JsonDictionaryValue } from "./JsonDictionaryValue"; import { JsonDictionaryObject } from "./JsonDictionaryObject"; import { JsonDictionaryValueType_$type } from "./JsonDictionaryValueType"; import { JsonDictionaryArray } from "./JsonDictionaryArray"; import { isNaN_ } from "./number"; import { timeSpanFromMilliseconds } from "./timespan"; import { ComponentRenderer } from "./ComponentRenderer"; import { DotNetCodeGeneratingComponentRendererHandlerEmitter } from "./DotNetCodeGeneratingComponentRendererHandlerEmitter"; import { TSCodeGeneratingComponentRendererTemplateEmitter } from "./TSCodeGeneratingComponentRendererTemplateEmitter"; import { DotNetCodeGeneratingComponentRendererTemplateEmitter } from "./DotNetCodeGeneratingComponentRendererTemplateEmitter"; import { TSCodeGeneratingComponentRendererModuleEmitter } from "./TSCodeGeneratingComponentRendererModuleEmitter"; import { DotNetCodeGeneratingComponentRendererModuleEmitter } from "./DotNetCodeGeneratingComponentRendererModuleEmitter"; import { BlazorCodeGeneratingComponentRendererModuleEmitter } from "./BlazorCodeGeneratingComponentRendererModuleEmitter"; import { CodeGenerationTransformer } from "./CodeGenerationTransformer"; import { LinearGradientBrush } from "./LinearGradientBrush"; import { IComponentRendererAdapter_$type } from "./IComponentRendererAdapter"; /** * @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"; } 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 ""; } 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; 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 1: return b.c.toString(); case 11: { var d = b.c; return d.x + ", " + d.y; } case 14: { var e = b.c; return e.left + ", " + e.top + ", " + e.width + ", " + e.height; } 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_1, _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_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; } } 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.e5(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.e5(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 BlazorRazorCodeGeneratingComponentRendererCodeEmitter = /** @class */ /*@__PURE__*/ (function (_super) { __extends(BlazorRazorCodeGeneratingComponentRendererCodeEmitter, _super); function BlazorRazorCodeGeneratingComponentRendererCodeEmitter(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; } BlazorRazorCodeGeneratingComponentRendererCodeEmitter.prototype.get_r = function () { return false; }; Object.defineProperty(BlazorRazorCodeGeneratingComponentRendererCodeEmitter.prototype, "r", { get: function () { return this.get_r(); }, enumerable: false, configurable: true }); BlazorRazorCodeGeneratingComponentRendererCodeEmitter.prototype.as = function (a, b, c, d) { d = _super.prototype.as.call(this, a, b, c, d); this.f.l("private " + b.n() + " _" + CodeGeneratingComponentRenderer.e5(d) + " = null;"); this.f.l("public " + b.n() + " " + CodeGeneratingComponentRenderer.e6(d)); this.f.l("{"); this.f.h(); this.f.l("get"); this.f.l("{"); this.f.h(); this.f.l("if (this._" + CodeGeneratingComponentRenderer.e5(d) + " == null)"); this.f.l("{"); this.f.h(); this.f.k(c); this.f.l("this._" + CodeGeneratingComponentRenderer.e5(d) + " = " + d + ";"); this.f.f(); this.f.l("}"); this.f.l("return this._" + CodeGeneratingComponentRenderer.e5(d) + ";"); this.f.f(); this.f.l("}"); this.f.f(); this.f.l("}"); return CodeGeneratingComponentRenderer.e6(d); }; BlazorRazorCodeGeneratingComponentRendererCodeEmitter.prototype.at = function (a, b, c, d, e) { e = _super.prototype.at.call(this, a, b, c, d, e); var f = null; if (c.count > 0) { f = c._inner[0].r() + "[]"; } else { var g = a.b.specificExternalType; f = CodeGenerationItemBuilder.o(this.k.platform, g, b, this.am, this.an) + "[]"; } this.f.l("private " + f + " _" + CodeGeneratingComponentRenderer.e5(e) + " = null;"); this.f.l("public " + f + " " + CodeGeneratingComponentRenderer.e6(e)); this.f.l("{"); this.f.h(); this.f.l("get"); this.f.l("{"); this.f.h(); this.f.l("if (this._" + CodeGeneratingComponentRenderer.e5(e) + " == null)"); this.f.l("{"); this.f.h(); this.f.k("var " + CodeGeneratingComponentRenderer.e5(e) + " = new " + stringReplace(f, "[]", "") + "[" + c.count + "];"); for (var h = 0; h < c.count; h++) { this.f.k(d._inner[h]); this.f.k(e + "[" + h + "] = " + c._inner[h].u + ";"); } this.f.l("this._" + CodeGeneratingComponentRenderer.e5(e) + " = " + e + ";"); this.f.f(); this.f.l("}"); this.f.l("return this._" + CodeGeneratingComponentRenderer.e5(e) + ";"); this.f.f(); this.f.l("}"); this.f.f(); this.f.l("}"); return CodeGeneratingComponentRenderer.e6(e); }; BlazorRazorCodeGeneratingComponentRendererCodeEmitter.prototype.i = function (a, b) { return new BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter(a, b); }; BlazorRazorCodeGeneratingComponentRendererCodeEmitter.prototype.get_z = function () { return false; }; BlazorRazorCodeGeneratingComponentRendererCodeEmitter.prototype.bw = function (a, b, c) { if (c.c == null) { return "null"; } var d = c.c; var e = b; var f = new CodeGenerationItemBuilderPropertyInfo(); f.b = ((function () { var $ret = new TypeDescriptionMetadata(); $ret.propertyName = c.b.propertyName; $ret.specificType = b; $ret.specificExternalType = b; return $ret; })()); f.b.knownType = 8; f.b.owningType = c.b.owningType; if (f.b.specificType == "string") { f.b.knownType = 2; } if (f.b.specificType == "int") { f.b.knownType = 1; } if (f.b.specificType == "double") { f.b.knownType = 1; } if (f.b.knownType == 8) { e = this.a8 + e; } var g = "@(new " + e + "[] { "; for (var h = 0; h < d.length; h++) { if (h > 0) { g += ", "; } f.c = d[h]; if (f.b.knownType == 2) { g += "\"" + this.a4(a, f, true) + "\""; } else { g += this.a4(a, f, true); } } g += " })"; return g; }; BlazorRazorCodeGeneratingComponentRendererCodeEmitter.prototype.au = function (a, b) { var c = b.b.specificType; if (c == null) { c = b.b.specificExternalType; } return this.bw(a, c, b); }; BlazorRazorCodeGeneratingComponentRendererCodeEmitter.prototype.bd = function (a, b, c) { _super.prototype.bd.call(this, a, b, c); this.h.l("<" + 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 " + this.ar + " " + CodeGeneratingComponentRenderer.e5(this.aq) + ";"); if (!this.p) { if (this.v) { this.g.l("var " + CodeGeneratingComponentRenderer.e5(this.aq) + " = this." + CodeGeneratingComponentRenderer.e5(this.aq) + ";"); } } else { this.g.l("var " + CodeGeneratingComponentRenderer.e5(this.aq) + " = this." + CodeGeneratingComponentRenderer.e5(this.aq) + ";"); } } }; BlazorRazorCodeGeneratingComponentRendererCodeEmitter.prototype.br = function () { this.h.l(">"); this.h.h(); }; BlazorRazorCodeGeneratingComponentRendererCodeEmitter.prototype.bm = function (a) { this.h.f(); this.h.l("</" + a + ">"); this.h.l(""); _super.prototype.bm.call(this, a); }; BlazorRazorCodeGeneratingComponentRendererCodeEmitter.prototype.bj = function (a, b, c, d) { if (c.b != null && d.hasNameBinding(c.b.owningType, CodeGeneratingComponentRenderer.e6(c.b.propertyName)) && this.q(d, c)) { this.bs(c); if (a > 0) { this.h.l(""); } if (c.a == null || c.a.e == null) { this.h.j(b + "Name=\"@null\""); } else { this.h.j(b + "Name=\"" + c.a.e + "\""); } 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 " + this.ar + " " + CodeGeneratingComponentRenderer.e5(this.aq) + ";"); if (!this.p) { if (this.v) { this.g.l("var " + CodeGeneratingComponentRenderer.e5(this.aq) + " = this." + CodeGeneratingComponentRenderer.e5(this.aq) + ";"); } } else { this.g.l("var " + CodeGeneratingComponentRenderer.e5(this.aq) + " = this." + CodeGeneratingComponentRenderer.e5(this.aq) + ";"); } } var e = CodeGeneratingComponentRenderer.e5(this.a4(d, c, true)); var f = e; if (f != "null" && !stringStartsWith(f, "this.")) { f = "this." + f; } this.e.l(CodeGeneratingComponentRenderer.e5(this.aq) + "." + b + " = " + f + ";"); return; } if (a > 0) { this.h.l(""); } var g = false; if (b == "ComponentRenderer" && (c.b.owningType == "PropertyEditor" || c.b.owningType == "PropertyEditorPanel")) { g = true; } if (!g) { if (c.a != null && c.a.e != null) { if (this.m != null) { if (this.m.library != null) { if (this.m.library.hasItem(c.a.e)) { var h = this.m.library.getItem(c.a.e); var i = h.getContentForPlatform(5); if (i != null && i.isJSContent) { b = b + "Script"; } } } } } this.h.j(b); this.h.j("="); this.h.j("\""); this.h.j(this.a4(d, c, true)); this.h.j("\""); } if (b == "Name") { this.h.l(""); this.h.j("@ref=\"" + CodeGeneratingComponentRenderer.e5(this.a4(d, c, true)) + "\""); } }; BlazorRazorCodeGeneratingComponentRendererCodeEmitter.prototype.ax = function (a) { var b = a.b != null ? a.b.specificType + "." : ""; return b + (a.c != null ? a.c.toString() : ""); }; BlazorRazorCodeGeneratingComponentRendererCodeEmitter.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 11: { var d = b.c; return "@(new Point(" + d.x + ", " + d.y + "))"; } case 14: { var e = b.c; return "@(new Rect(" + e.left + ", " + e.top + ", " + e.width + ", " + e.height + "))"; } case 12: { var f = b.c; return "@(new Size(" + 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" : "false"; } return b.c.toString(); } return _super.prototype.a4.call(this, a, b, c); }; BlazorRazorCodeGeneratingComponentRendererCodeEmitter.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; }; BlazorRazorCodeGeneratingComponentRendererCodeEmitter.prototype.a1 = function () { return "@null"; }; BlazorRazorCodeGeneratingComponentRendererCodeEmitter.prototype.aw = function (a) { return CodeGeneratingComponentRenderer.e5(CodeGeneratingComponentRenderer.e5(a.a.e)); }; BlazorRazorCodeGeneratingComponentRendererCodeEmitter.prototype.bx = function (a) { a = stringReplace(a, "-", "_"); return CodeGeneratingComponentRenderer.e6(a); }; BlazorRazorCodeGeneratingComponentRendererCodeEmitter.prototype.a2 = function (a) { this.bs(a); return CodeGeneratingComponentRenderer.e6(a.a.e); }; BlazorRazorCodeGeneratingComponentRendererCodeEmitter.prototype.bk = function (a, b, c, d) { var e_2, _a; if (c.b.knownType == 9) { var e = typeCast(IList_$type, c.c); if (e != null) { try { for (var _b = __values(fromEn(e)), _c = _b.next(); !_c.done; _c = _b.next()) { var f = _c.value; if (typeCast(CodeGenerationItemBuilder.$, f) !== null) { var g = f; g.v(this, false); } } } 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; } } } } else { if (typeCast(CodeGenerationItemBuilder.$, c.c) !== null) { var h = c.c; h.v(this, false); } } }; BlazorRazorCodeGeneratingComponentRendererCodeEmitter.prototype.get_a8 = function () { return "Igb"; }; BlazorRazorCodeGeneratingComponentRendererCodeEmitter.$t = markType(BlazorRazorCodeGeneratingComponentRendererCodeEmitter, 'BlazorRazorCodeGeneratingComponentRendererCodeEmitter', CodeGeneratingComponentRendererCodeEmitter.$); return BlazorRazorCodeGeneratingComponentRendererCodeEmitter; }(CodeGeneratingComponentRendererCodeEmitter)); export { BlazorRazorCodeGeneratingComponentRendererCodeEmitter }; /** * @hidden */ var BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter = /** @class */ /*@__PURE__*/ (function (_super) { __extends(BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter, _super); function BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter(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; } BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.get_r = function () { return true; }; Object.defineProperty(BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype, "r", { get: function () { return this.get_r(); }, enumerable: false, configurable: true }); BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.i = function (a, b) { return new BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter(a, b); }; BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.get_z = function () { return false; }; BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.bw = function (a, b) { if (b.c == null) { return "null"; } var c = b.c; var d = "new " + a + "[] { "; for (var e = 0; e < c.length; e++) { if (e > 0) { d += ", "; } d += "\"" + c[e] + "\""; } d += " }"; return d; }; BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.au = function (a, b) { if (b.b.specificExternalType == "string") { return this.bw(b.b.specificExternalType, 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]; } return d; }; BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.bd = function (a, b, c) { _super.prototype.bd.call(this, a, b, c); if (this.v) { this.h.l("var " + this.aq + " = new " + a + "();"); } else { this.h.l("var " + this.aq + " = new " + 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 " + this.ar + " " + CodeGeneratingComponentRenderer.e5(this.aq) + ";"); if (!this.p) { if (this.v) { this.g.l("var " + CodeGeneratingComponentRenderer.e5(this.aq) + " = this." + CodeGeneratingComponentRenderer.e5(this.aq) + ";"); } } else { this.g.l("var " + CodeGeneratingComponentRenderer.e5(this.aq) + " = this." + CodeGeneratingComponentRenderer.e5(this.aq) + ";"); } } }; BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.br = function () { }; BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.bm = function (a) { _super.prototype.bm.call(this, a); }; BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.bj = function (a, b, c, d) { if (c.b != null && d.hasNameBinding(c.b.owningType, CodeGeneratingComponentRenderer.e6(c.b.propertyName)) && this.q(d, c)) { this.bs(c); if (a > 0) { this.h.l(""); } if (c.a == null || c.a.e == null) { this.h.j(this.aq + "." + b + "Name = null;"); } else { this.h.j(this.aq + "." + b + "Name = " + c.a.e + ";"); } 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 " + this.ar + " " + CodeGeneratingComponentRenderer.e5(this.aq) + ";"); if (!this.p) { if (this.v) { this.g.l("var " + CodeGeneratingComponentRenderer.e5(this.aq) + " = this." + CodeGeneratingComponentRenderer.e5(this.aq) + ";"); } } else { this.g.l("var " + CodeGeneratingComponentRenderer.e5(this.aq) + " = this." + CodeGeneratingComponentRenderer.e5(this.aq) + ";"); } } var e = CodeGeneratingComponentRenderer.e5(this.a4(d, c, true)); var f = e; if (f != "null" && !stringStartsWith(f, "this.")) { f = "this." + f; } this.e.l(CodeGeneratingComponentRenderer.e5(this.aq) + "." + b + " = " + f + ";"); return; } if (a > 0) { this.h.l(""); } var g = false; if (b == "ComponentRenderer" && (c.b.owningType == "PropertyEditor" || c.b.owningType == "PropertyEditorPanel")) { g = true; } if (!g) { var h = false; if (c.a != null && c.a.e != null) { if (this.m != null) { if (this.m.library != null) { if (this.m.library.hasItem(c.a.e)) { var i = this.m.library.getItem(c.a.e); var j = i.getContentForPlatform(5); if (j != null && j.isJSContent) { b = b + "Script"; h = true; } } } } } this.h.j(this.aq + "."); this.h.j(b); this.h.j(" = "); if (h) { this.h.j("\"" + this.a4(d, c, true) + "\""); } else { this.h.j(this.a4(d, c, true)); } this.h.j(";"); } }; BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.ax = function (a) { var b = a.b != null ? a.b.specificType + "." : ""; return b + (a.c != null ? a.c.toString() : ""); }; BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter.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 11: { var d = b.c; return "new Point(" + d.x + ", " + d.y + ")"; } case 14: { var e = b.c; return "new Rect(" + e.left + ", " + e.top + ", " + e.width + ", " + e.height + ")"; } case 12: { var f = b.c; return "new Size(" + 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" : "false"; } return b.c.toString(); case 5: case 6: case 16: case 2: return "\"" + _super.prototype.a4.call(this, a, b, c) + "\""; case 9: throw new NotSupportedException(1, "shouldn't get here"); } return _super.prototype.a4.call(this, a, b, c); }; BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter.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; }; BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.a1 = function () { return "null"; }; BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.aw = function (a) { return CodeGeneratingComponentRenderer.e5(CodeGeneratingComponentRenderer.e5(a.a.e)); }; BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.bx = function (a) { a = stringReplace(a, "-", "_"); return CodeGeneratingComponentRenderer.e6(a); }; BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.a2 = function (a) { this.bs(a); return CodeGeneratingComponentRenderer.e6(a.a.e); }; BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter.prototype.bk = function (a, b, c, d) { var e_3, _a; if (c.b.knownType == 9) { var e = typeCast(IList_$type, c.c); if (e != null) { try { for (var _b = __values(fromEn(e)), _c = _b.next(); !_c.done; _c = _b.next()) { var f = _c.value; if (typeCast(CodeGenerationItemBuilder.$, f) !== null) { var g = f; g.v(this, false); this.h.l(this.aq + "." + b + ".Add(" + this.a5 + ");"); } } } catch (e_3_1) { e_3 = { error: e_3_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return))