igniteui-angular-core
Version:
Ignite UI Angular Core logic used in multiple UI components.
1,375 lines • 132 kB
JavaScript
/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { Base, IList_$type, NotSupportedException, String_$type, typeCast, fromEnum, Array_$type, Boolean_$type, markType, EnumUtil, fromEn, Number_$type, 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 { CodeGenerationSpecialValue } from "./CodeGenerationSpecialValue";
import { ColorUtil } from "./ColorUtil";
import { StringBuilder } from "./StringBuilder";
import { CodeGeneratingImportManager } from "./CodeGeneratingImportManager";
import { stringIsNullOrEmpty, stringReplace, stringStartsWith, stringEndsWith, stringContains } from "./string";
import { HashSet$1 } from "./HashSet$1";
import { WebImportsHalper } from "./WebImportsHalper";
import { CodeGeneratingComponentRendererHandlerEmitter } from "./CodeGeneratingComponentRendererHandlerEmitter";
import { CodeGeneratingRegexHelper } from "./CodeGeneratingRegexHelper";
import { CodeGeneratingComponentRendererDataEmitter } from "./CodeGeneratingComponentRendererDataEmitter";
import { Dictionary$2 } from "./Dictionary$2";
import { JsonDictionaryValue } from "./JsonDictionaryValue";
import { JsonDictionaryObject } from "./JsonDictionaryObject";
import { JsonDictionaryArray } from "./JsonDictionaryArray";
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
*/
export let CodeGeneratingComponentRendererCodeEmitter = /*@__PURE__*/ (() => {
class CodeGeneratingComponentRendererCodeEmitter extends Base {
constructor(a, b) {
super();
this.l = null;
this.j = null;
this.y = new List$1(CodeGenerationItemBuilderPropertyInfo.$, 0);
this.d = null;
this.a = null;
this.c = null;
this.b = null;
this.z = new List$1(String_$type, 0);
this.ac = new Stack$1(String_$type);
this.aa = new Stack$1(String_$type);
this.ab = new Stack$1(Boolean_$type);
this.ay = null;
this.ax = 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);
}
get az() {
switch (this.j.platform) {
case 1: return "angular";
case 2: return "react";
case 3: return "webcomponents";
}
return "";
}
get m() {
return this.l;
}
bj(a) {
this.j.af(a);
}
get k() {
return this.j;
}
get h() {
return this.d;
}
get e() {
return this.a;
}
get g() {
return this.c;
}
get f() {
return this.b;
}
a3(a) {
if (a == null || a == "any") {
return;
}
this.z.add(a);
}
v(a, b) {
if (this.r) {
return false;
}
if (a.hasMustSetInCodePlatforms(b.b.owningType, b.b.propertyName)) {
let c = a.getMustSetInCodePlatforms(b.b.owningType, b.b.propertyName);
for (let e = 0; e < c.length; e++) {
let d = c[e];
let f;
if (((() => { let g = EnumUtil.tryParse$1(CodeGenerationTargetPlatforms_$type, d, true, f); f = g.p2; return g.ret; })())) {
if (f == this.j.platform) {
return true;
}
}
}
}
return false;
}
q(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)) {
if (this.v(a, b)) {
return true;
}
}
return false;
}
t(a) {
if (a.b != null && (a.b.knownType == 19)) {
if (a.a != null) {
return true;
}
}
return false;
}
get ak() {
return this.ac.d();
}
a4(a) {
this.ac.h(a);
}
bi() {
}
bc(a) {
}
bd(a) {
this.ac.e();
}
ba(a, b, c, d) {
}
bb(a, b, c, d) {
this.ba(a, b, c, d);
}
toString() {
return this.d.toString();
}
at() {
return "null";
}
aw(a, b, c) {
if (b.b == null) {
return b.c;
}
if (typeCast(CodeGenerationSpecialValue.$, b.c) !== null) {
b.c = this.ad(b);
}
switch (b.b.knownType) {
case 10: return this.am(a, b);
case 7: return b.c ? "true" : "false";
case 4: return this.af(b);
case 6:
{
let d = "";
let e = b.c;
for (let f = 0; f < e.count; f++) {
if (f >= 1) {
d += " ";
}
d += this.ae(e.item(f));
}
return d;
}
break;
case 9:
if (this.v(a, b)) {
return this.ai(a, b);
}
throw new NotSupportedException(1, "shouldn't get here");
case 5: return this.ah(b);
case 16:
{
let g = "";
let h = b.c;
for (let i = 0; i < h.count; i++) {
if (i >= 1) {
g += " ";
}
g += this.ag(h.item(i));
}
return g;
}
break;
case 20:
if (b.a != null) {
return this.av(b);
}
if (b.c == null) {
return this.at();
}
break;
case 22:
if (b.a != null) {
return this.av(b);
}
if (b.c == null) {
return this.at();
}
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.aq(b);
}
else {
return this.at();
}
break;
case 8:
if (b.b.specificExternalType == "string") {
return this.ap(b);
}
if (b.a != null) {
return this.ar(b);
}
if (this.v(a, b)) {
return this.ai(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.as(b);
}
else {
return this.at();
}
break;
case 1: return b.c.toString();
case 11:
{
let j = b.c;
return j.x + ", " + j.y;
}
case 14:
{
let k = b.c;
return k.left + ", " + k.top + ", " + k.width + ", " + k.height;
}
case 12:
{
let l = b.c;
return l.width + ", " + l.height;
}
case 2: return b.c != null ? b.c.toString() : this.at();
case 21: return b.c.toString();
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 "";
}
ai(a, b) {
let c = this.a1(a, b);
if (b.c != null) {
let d = this.i(this.l, this.j);
if (typeCast(CodeGenerationItemBuilder.$, b.c) !== null) {
let e = b.c;
e.r = c;
e.s(d, true);
let f = d.toString();
for (let g of fromEnum(d.z)) {
this.z.add(g);
}
c = this.al(a, e, f, c);
}
}
return c;
}
al(a, b, c, d) {
return d;
}
a1(a, b) {
if (b.c == null) {
return this.at();
}
if (typeCast(CodeGenerationItemBuilder.$, b.c) !== null) {
let c = b.c.n();
if (c != null) {
return c;
}
let d = b.c.m();
let e = this.an(d);
return e;
}
else if (typeCast(IList_$type, b.c) !== null) {
let f = b.c;
if (f.count > 0 && typeCast(CodeGenerationItemBuilder.$, f.item(0)) !== null) {
let g = b.c.n();
if (g != null) {
return g;
}
let h = b.c.m();
let i = this.an(h);
return i;
}
return this.an(b.b.propertyName);
}
else if (typeCast(Array_$type, b.c) !== null) {
let j = b.c;
if (j.length > 0 && typeCast(CodeGenerationItemBuilder.$, j[0]) !== null) {
let k = b.c.n();
if (k != null) {
return k;
}
let l = b.c.m();
let m = this.an(l);
return m;
}
return this.an(b.b.propertyName);
}
return this.at();
}
am(a, b) {
return "";
}
ad(a) {
return a.c;
}
av(a) {
if (!stringIsNullOrEmpty(a.a.e)) {
if (a.a.a) {
return this.ao(a);
}
else {
return this.au(a);
}
}
return this.at();
}
s(a) {
if (a.a != null && !stringIsNullOrEmpty(a.a.e)) {
if (a.a.a) {
return true;
}
}
return false;
}
au(a) {
return "";
}
ao(a) {
return "";
}
ar(a) {
if (!stringIsNullOrEmpty(a.a.e)) {
return a.a.e;
}
return this.at();
}
ap(a) {
return a.c != null ? a.c.toString() : "";
}
as(a) {
return this.aq(a);
}
aq(a) {
if (!stringIsNullOrEmpty(a.a.e)) {
this.bj(a);
return a.a.e;
}
return this.at();
}
get_w() {
return false;
}
get w() {
return this.get_w();
}
ah(a) {
let b = a.c;
return ColorUtil.i(b, this.w);
}
ag(a) {
let b = a;
return ColorUtil.i(b, this.w);
}
af(a) {
if (a.c == null) {
return "";
}
let b = a.c;
return ColorUtil.i(b.color, this.w);
}
ae(a) {
if (a == null) {
return "";
}
let b = a;
return ColorUtil.i(b.color, this.w);
}
bh(a) {
this.aa.h(a);
this.ab.h(false);
}
bg(a) {
let b = this.an(a);
this.aa.h(b);
this.ab.h(true);
}
an(a) {
let b = stringReplace(stringReplace(a, this.a0, ""), "Component", "");
b = CodeGeneratingComponentRenderer.d2(b);
return this.j.v(b);
}
be() {
this.ax = this.aa.e();
this.ab.e();
}
get_a0() {
return "";
}
get a0() {
return this.get_a0();
}
get aj() {
if (this.aa.f > 0) {
return this.aa.d();
}
let a = stringReplace(stringReplace(this.ak, this.a0, ""), "Component", "");
return CodeGeneratingComponentRenderer.d2(a);
}
get u() {
return this.ac.f == 1;
}
get o() {
if (this.ab.f == 0) {
return false;
}
return this.ab.d();
}
get p() {
if (this.aa.f > 0) {
return true;
}
return false;
}
get_x() {
return true;
}
get x() {
return this.get_x();
}
get_n() {
return this.r;
}
get n() {
return this.get_n();
}
bf() {
this.ax = this.aa.e();
}
a6(a) {
let b = this.f.toString();
if (b.length > 0) {
a.l(b);
}
}
a9(a) {
let b = this.g.toString();
if (b.length > 0) {
a.l(b);
}
}
a5(a) {
let b = this.e.toString();
if (b.length > 0) {
a.l(b);
}
}
a7(a, b) {
if (this.z.count > 0) {
this.a8(a, this.z, b);
}
}
a8(a, b, c) {
}
}
CodeGeneratingComponentRendererCodeEmitter.$t = markType(CodeGeneratingComponentRendererCodeEmitter, 'CodeGeneratingComponentRendererCodeEmitter');
return CodeGeneratingComponentRendererCodeEmitter;
})();
/**
* @hidden
*/
export let BlazorRazorCodeGeneratingComponentRendererCodeEmitter = /*@__PURE__*/ (() => {
class BlazorRazorCodeGeneratingComponentRendererCodeEmitter extends CodeGeneratingComponentRendererCodeEmitter {
constructor(a, b) {
super(a, b);
this.bm = 0;
this.bk = new HashSet$1(String_$type, 0);
this.bl = new HashSet$1(String_$type, 0);
}
get_r() {
return false;
}
get r() {
return this.get_r();
}
al(a, b, c, d) {
d = super.al(a, b, c, d);
this.f.l("private " + b.m() + " _" + CodeGeneratingComponentRenderer.d2(d) + " = null;");
this.f.l("public " + b.m() + " " + CodeGeneratingComponentRenderer.d3(d));
this.f.l("{");
this.f.h();
this.f.l("get");
this.f.l("{");
this.f.h();
this.f.l("if (this._" + CodeGeneratingComponentRenderer.d2(d) + " == null)");
this.f.l("{");
this.f.h();
this.f.k(c);
this.f.l("this._" + CodeGeneratingComponentRenderer.d2(d) + " = " + d + ";");
this.f.f();
this.f.l("}");
this.f.l("return this._" + CodeGeneratingComponentRenderer.d2(d) + ";");
this.f.f();
this.f.l("}");
this.f.f();
this.f.l("}");
return CodeGeneratingComponentRenderer.d3(d);
}
i(a, b) {
return new BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter(a, b);
}
get_x() {
return false;
}
bn(a, b, c) {
if (c.c == null) {
return "null";
}
let d = c.c;
let e = b;
let f = new CodeGenerationItemBuilderPropertyInfo();
f.b = ((() => {
let $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.a0 + e;
}
let g = "@(new " + e + "[] { ";
for (let h = 0; h < d.length; h++) {
if (h > 0) {
g += ", ";
}
f.c = d[h];
if (f.b.knownType == 2) {
g += "\"" + this.aw(a, f, true) + "\"";
}
else {
g += this.aw(a, f, true);
}
}
g += " })";
return g;
}
am(a, b) {
let c = b.b.specificType;
if (c == null) {
c = b.b.specificExternalType;
}
return this.bn(a, c, b);
}
a4(a) {
super.a4(a);
this.h.l("<" + a + "");
if (!this.bk.contains(this.aj)) {
this.bk.add_1(this.aj);
if (!this.bl.contains(this.ak)) {
this.bl.add_1(this.ak);
this.a3(this.ak);
}
this.f.l("private " + this.ak + " " + CodeGeneratingComponentRenderer.d2(this.aj) + ";");
if (!this.p) {
if (this.u) {
this.g.l("var " + CodeGeneratingComponentRenderer.d2(this.aj) + " = this." + CodeGeneratingComponentRenderer.d2(this.aj) + ";");
}
}
else {
this.g.l("var " + CodeGeneratingComponentRenderer.d2(this.aj) + " = this." + CodeGeneratingComponentRenderer.d2(this.aj) + ";");
}
}
}
bi() {
this.h.l(">");
this.h.h();
}
bd(a) {
this.h.f();
this.h.l("</" + a + ">");
this.h.l("");
super.bd(a);
}
ba(a, b, c, d) {
if (c.b != null && d.hasNameBinding(c.b.owningType, CodeGeneratingComponentRenderer.d3(c.b.propertyName)) && this.q(d, c)) {
this.bj(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.bj(c);
if (!this.bk.contains(this.aj)) {
this.bk.add_1(this.aj);
if (!this.bl.contains(this.ak)) {
this.bl.add_1(this.ak);
this.a3(this.ak);
}
this.f.l("private " + this.ak + " " + CodeGeneratingComponentRenderer.d2(this.aj) + ";");
if (!this.p) {
if (this.u) {
this.g.l("var " + CodeGeneratingComponentRenderer.d2(this.aj) + " = this." + CodeGeneratingComponentRenderer.d2(this.aj) + ";");
}
}
else {
this.g.l("var " + CodeGeneratingComponentRenderer.d2(this.aj) + " = this." + CodeGeneratingComponentRenderer.d2(this.aj) + ";");
}
}
let e = CodeGeneratingComponentRenderer.d2(this.aw(d, c, true));
let f = e;
if (f != "null" && !stringStartsWith(f, "this.")) {
f = "this." + f;
}
this.e.l(CodeGeneratingComponentRenderer.d2(this.aj) + "." + b + " = " + f + ";");
return;
}
if (a > 0) {
this.h.l("");
}
let 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)) {
let h = this.m.library.getItem(c.a.e);
let 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.aw(d, c, true));
this.h.j("\"");
}
if (b == "Name") {
this.h.l("");
this.h.j("@ref=\"" + CodeGeneratingComponentRenderer.d2(this.aw(d, c, true)) + "\"");
}
}
ap(a) {
let b = a.b != null ? a.b.specificType + "." : "";
return b + (a.c != null ? a.c.toString() : "");
}
aw(a, b, c) {
if (b.b == null) {
return b.c;
}
if (typeCast(CodeGenerationSpecialValue.$, b.c) !== null) {
b.c = this.ad(b);
}
switch (b.b.knownType) {
case 11:
{
let d = b.c;
return "@(new Point(" + d.x + ", " + d.y + "))";
}
case 14:
{
let e = b.c;
return "@(new Rect(" + e.left + ", " + e.top + ", " + e.width + ", " + e.height + "))";
}
case 12:
{
let 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.aw(a, b, c);
}
ad(a) {
let 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;
}
at() {
return "@null";
}
ao(a) {
return CodeGeneratingComponentRenderer.d2(CodeGeneratingComponentRenderer.d2(a.a.e));
}
bo(a) {
a = stringReplace(a, "-", "_");
return CodeGeneratingComponentRenderer.d3(a);
}
au(a) {
this.bj(a);
return CodeGeneratingComponentRenderer.d3(a.a.e);
}
bb(a, b, c, d) {
if (c.b.knownType == 9) {
let e = typeCast(IList_$type, c.c);
if (e != null) {
for (let f of fromEn(e)) {
if (typeCast(CodeGenerationItemBuilder.$, f) !== null) {
let g = f;
g.s(this, false);
}
}
}
}
else {
if (typeCast(CodeGenerationItemBuilder.$, c.c) !== null) {
let h = c.c;
h.s(this, false);
}
}
}
get_a0() {
return "Igb";
}
}
BlazorRazorCodeGeneratingComponentRendererCodeEmitter.$t = markType(BlazorRazorCodeGeneratingComponentRendererCodeEmitter, 'BlazorRazorCodeGeneratingComponentRendererCodeEmitter', CodeGeneratingComponentRendererCodeEmitter.$);
return BlazorRazorCodeGeneratingComponentRendererCodeEmitter;
})();
/**
* @hidden
*/
export let BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter = /*@__PURE__*/ (() => {
class BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter extends CodeGeneratingComponentRendererCodeEmitter {
constructor(a, b) {
super(a, b);
this.bm = 0;
this.bk = new HashSet$1(String_$type, 0);
this.bl = new HashSet$1(String_$type, 0);
}
get_r() {
return true;
}
get r() {
return this.get_r();
}
i(a, b) {
return new BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter(a, b);
}
get_x() {
return false;
}
bn(a, b) {
if (b.c == null) {
return "null";
}
let c = b.c;
let d = "new " + a + "[] { ";
for (let e = 0; e < c.length; e++) {
if (e > 0) {
d += ", ";
}
d += "\"" + c[e] + "\"";
}
d += " }";
return d;
}
am(a, b) {
if (b.b.specificExternalType == "string") {
return this.bn(b.b.specificExternalType, b);
}
if (b.c == null) {
return "null";
}
let c = b.c;
let d = "";
for (let e = 0; e < c.length; e++) {
if (e > 0) {
d += ", ";
}
d += c[e];
}
return d;
}
a4(a) {
super.a4(a);
if (this.u) {
this.h.l("var " + this.aj + " = new " + a + "();");
}
else {
this.h.l("var " + this.aj + " = new " + a + "();");
}
if (!this.bk.contains(this.aj)) {
this.bk.add_1(this.aj);
if (!this.bl.contains(this.ak)) {
this.bl.add_1(this.ak);
this.a3(this.ak);
}
this.f.l("private " + this.ak + " " + CodeGeneratingComponentRenderer.d2(this.aj) + ";");
if (!this.p) {
if (this.u) {
this.g.l("var " + CodeGeneratingComponentRenderer.d2(this.aj) + " = this." + CodeGeneratingComponentRenderer.d2(this.aj) + ";");
}
}
else {
this.g.l("var " + CodeGeneratingComponentRenderer.d2(this.aj) + " = this." + CodeGeneratingComponentRenderer.d2(this.aj) + ";");
}
}
}
bi() {
}
bd(a) {
super.bd(a);
}
ba(a, b, c, d) {
if (c.b != null && d.hasNameBinding(c.b.owningType, CodeGeneratingComponentRenderer.d3(c.b.propertyName)) && this.q(d, c)) {
this.bj(c);
if (a > 0) {
this.h.l("");
}
if (c.a == null || c.a.e == null) {
this.h.j(this.aj + "." + b + "Name = null;");
}
else {
this.h.j(this.aj + "." + b + "Name = " + c.a.e + ";");
}
return;
}
if (this.s(c)) {
this.bj(c);
if (!this.bk.contains(this.aj)) {
this.bk.add_1(this.aj);
if (!this.bl.contains(this.ak)) {
this.bl.add_1(this.ak);
this.a3(this.ak);
}
this.f.l("private " + this.ak + " " + CodeGeneratingComponentRenderer.d2(this.aj) + ";");
if (!this.p) {
if (this.u) {
this.g.l("var " + CodeGeneratingComponentRenderer.d2(this.aj) + " = this." + CodeGeneratingComponentRenderer.d2(this.aj) + ";");
}
}
else {
this.g.l("var " + CodeGeneratingComponentRenderer.d2(this.aj) + " = this." + CodeGeneratingComponentRenderer.d2(this.aj) + ";");
}
}
let e = CodeGeneratingComponentRenderer.d2(this.aw(d, c, true));
let f = e;
if (f != "null" && !stringStartsWith(f, "this.")) {
f = "this." + f;
}
this.e.l(CodeGeneratingComponentRenderer.d2(this.aj) + "." + b + " = " + f + ";");
return;
}
if (a > 0) {
this.h.l("");
}
let g = false;
if (b == "ComponentRenderer" && (c.b.owningType == "PropertyEditor" || c.b.owningType == "PropertyEditorPanel")) {
g = true;
}
if (!g) {
let 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)) {
let i = this.m.library.getItem(c.a.e);
let j = i.getContentForPlatform(5);
if (j != null && j.isJSContent) {
b = b + "Script";
h = true;
}
}
}
}
}
this.h.j(this.aj + ".");
this.h.j(b);
this.h.j(" = ");
if (h) {
this.h.j("\"" + this.aw(d, c, true) + "\"");
}
else {
this.h.j(this.aw(d, c, true));
}
this.h.j(";");
}
}
ap(a) {
let b = a.b != null ? a.b.specificType + "." : "";
return b + (a.c != null ? a.c.toString() : "");
}
aw(a, b, c) {
if (b.b == null) {
return "\"" + b.c + "\"";
}
if (typeCast(CodeGenerationSpecialValue.$, b.c) !== null) {
b.c = this.ad(b);
}
switch (b.b.knownType) {
case 11:
{
let d = b.c;
return "new Point(" + d.x + ", " + d.y + ")";
}
case 14:
{
let e = b.c;
return "new Rect(" + e.left + ", " + e.top + ", " + e.width + ", " + e.height + ")";
}
case 12:
{
let 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.aw(a, b, c) + "\"";
case 9: throw new NotSupportedException(1, "shouldn't get here");
}
return super.aw(a, b, c);
}
ad(a) {
let 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;
}
at() {
return "null";
}
ao(a) {
return CodeGeneratingComponentRenderer.d2(CodeGeneratingComponentRenderer.d2(a.a.e));
}
bo(a) {
a = stringReplace(a, "-", "_");
return CodeGeneratingComponentRenderer.d3(a);
}
au(a) {
this.bj(a);
return CodeGeneratingComponentRenderer.d3(a.a.e);
}
bb(a, b, c, d) {
if (c.b.knownType == 9) {
let e = typeCast(IList_$type, c.c);
if (e != null) {
for (let f of fromEn(e)) {
if (typeCast(CodeGenerationItemBuilder.$, f) !== null) {
let g = f;
g.s(this, false);
this.h.l(this.aj + "." + b + ".Add(" + this.ax + ");");
}
}
}
}
else {
if (typeCast(CodeGenerationItemBuilder.$, c.c) !== null) {
let h = c.c;
h.s(this, false);
this.h.l(this.aj + "." + b + " = " + this.ax + ";");
}
}
}
get_a0() {
return "Igb";
}
}
BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter.$t = markType(BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter, 'BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter', CodeGeneratingComponentRendererCodeEmitter.$);
return BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter;
})();
/**
* @hidden
*/
export let ReactMarkupCodeGeneratingComponentRendererCodeEmitter = /*@__PURE__*/ (() => {
class ReactMarkupCodeGeneratingComponentRendererCodeEmitter extends CodeGeneratingComponentRendererCodeEmitter {
constructor(a, b) {
super(a, b);
this.bk = new HashSet$1(String_$type, 0);
this.bl = new HashSet$1(String_$type, 0);
}
get_r() {
return false;
}
get r() {
return this.get_r();
}
al(a, b, c, d) {
d = super.al(a, b, c, d);
let e = b.p();
this.f.l("private " + " _" + CodeGeneratingComponentRenderer.d2(d) + ": " + e + " | null = null;");
this.f.l("public get " + CodeGeneratingComponentRenderer.d2(d) + "(): " + e + " {");
this.f.h();
this.f.l("if (this._" + CodeGeneratingComponentRenderer.d2(d) + " == null)");
this.f.l("{");
this.f.h();
this.f.k(c);
this.f.l("this._" + CodeGeneratingComponentRenderer.d2(d) + " = " + d + ";");
this.f.f();
this.f.l("}");
this.f.l("return this._" + CodeGeneratingComponentRenderer.d2(d) + ";");
this.f.f();
this.f.l("}");
return CodeGeneratingComponentRenderer.d3(d);
}
i(a, b) {
return new ReactCodeBehindCodeGeneratingComponentRendererCodeEmitter(a, b);
}
am(a, b) {
if (b.c == null) {
return "{null}";
}
let c = b.c;
let d = "[";
for (let e = 0; e < c.length; e++) {
if (e > 0) {
d += ", ";
}
d += "\"" + c[e].toString() + "\"";
}
d += "]";
return d;
}
get_w() {
return true;
}
get_a0() {
return "Igr";
}
a4(a) {
super.a4(a);
this.h.l("<" + this.bn(a) + "");
this.h.h();
if (!this.bl.contains(this.ak)) {
this.bl.add_1(this.ak);
this.a3(this.ak);
}
if (!this.bk.contains(this.aj)) {
this.bk.add_1(this.aj);
this.f.l("private " + CodeGeneratingComponentRenderer.d2(this.aj) + ": " + this.ak);
if (this.u) {
this.f.l("private " + CodeGeneratingComponentRenderer.d2(this.aj) + "Ref(r: " + this.ak + ") {");
this.f.h();
this.f.l("this." + CodeGeneratingComponentRenderer.d2(this.aj) + " = r;");
this.f.l("this.setState({});");
this.f.f();
this.f.l("}");
this.g.l("this." + CodeGeneratingComponentRenderer.d2(this.aj) + "Ref = " + "this." + CodeGeneratingComponentRenderer.d2(this.aj) + "Ref.bind(this);");
}
}
}
bn(a) {
if (stringEndsWith(a, "Component")) {
a = a.substr(0, a.length - ("Component").length);
}
return CodeGeneratingComponentRenderer.d3(a);
}
bi() {
if (!this.u && !this.p) {
let a = this.bm();
this.h.l("");
this.h.l("name=\"" + a + "\"");
}
this.h.f();
this.h.l(">");
this.h.h();
}
bm() {
let a = CodeGeneratingComponentRenderer.d2(stringReplace(stringReplace(this.ak, this.a0, ""), "Component", ""));
a = this.k.u(a);
return a;
}
aq(a) {
if (!stringIsNullOrEmpty(a.a.e)) {
this.bj(a);
if (!this.bk.contains(a.a.e)) {
this.g.l("this." + CodeGeneratingComponentRenderer.d2(a.a.e) + " = " + "this." + CodeGeneratingComponentRenderer.d2(a.a.e) + ".bind(this);");
}
return "this." + CodeGeneratingComponentRenderer.d2(a.a.e);
}
return this.at();
}
bd(a) {
this.h.f();
this.h.l("</" + this.bn(a) + ">");
super.bd(a);
}
ba(a, b, c, d) {
let e = CodeGeneratingComponentRenderer.d2(b);
let f = this.aw(d, c, true);
if (c.b != null && d.hasNameBinding(c.b.owningType, CodeGeneratingComponentRenderer.d3(c.b.propertyName)) && this.q(d, c)) {
this.bj(c);
if (a > 0) {
this.h.l("");
}
if (c.a == null || c.a.e == null) {
this.h.j(e + "Name={null}");
}
else {
this.h.j(e + "Name=\"" + c.a.e + "\"");
}
return;
}
if (!(e == "name") || !this.u) {
let g = (c.b != null && c.b.knownType == 10);
if (this.q(d, c) || g) {
this.bj(c);
f = "{" + f + "}";
}
if (a > 0) {
this.h.l("");
}
this.h.j(e);
this.h.j("=");
if (!this.q(d, c) && !g) {
this.h.j("\"");
}
this.h.j(f);
if (!this.q(d, c) && !g) {
this.h.j("\"");
}
a++;
}
if (e == "name") {
if (this.u) {
if (a > 0) {
this.h.l("");
}
this.h.j("ref={this." + CodeGeneratingComponentRenderer.d2(this.aw(d, c, true)) + "Ref}");
}
}
}
ad(a) {
let 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;
}
at() {
return "null";
}
ao(a) {
return "this." + CodeGeneratingComponentRenderer.d2(a.a.e);
}
au(a) {
return "this." + CodeGeneratingComponentRenderer.d2(a.a.e);
}
bb(a, b, c, d) {
if (c.b.knownType == 9) {
let e = typeCast(IList_$type, c.c);
if (e != null) {
for (let f of fromEn(e)) {
if (typeCast(CodeGenerationItemBuilder.$, f) !== null) {
let g = f;
g.s(this, false);
}
}
}
}
else {
if (typeCast(CodeGenerationItemBuilder.$, c.c) !== null) {
let h = c.c;
h.s(this, false);
}
}
}
a8(a, b, c) {
super.a8(a, b, c);
WebImportsHalper.a(this.k, this.az, this.ay, this.a0, a, b, c);
}
}
ReactMarkupCodeGeneratingComponentRendererCodeEmitter.$t = markType(ReactMarkupCodeGeneratingComponentRendererCodeEmitter, 'ReactMarkupCodeGeneratingComponentRendererCodeEmitter', CodeGeneratingComponentRendererCodeEmitter.$);
return ReactMarkupCodeGeneratingComponentRendererCodeEmitter;
})();
/**
* @hidden
*/
export let WebCodeBehindCodeGeneratingComponentRendererCodeEmitter = /*@__PURE__*/ (() => {
class WebCodeBehindCodeGeneratingComponentRendererCodeEmitter extends CodeGeneratingComponentRendererCodeEmitter {
constructor(a, b) {
super(a, b);
this.bm = 0;
this.bk = new HashSet$1(String_$type, 0);
this.bl = new HashSet$1(String_$type, 0);
}
get_r() {
return true;
}
get r() {
return this.get_r();
}
ap(a) {
if (!this.bl.contains(a.b.specificType)) {
this.bl.add_1(a.b.specificType);
this.a3(a.b.specificType);
}
let b = a.b != null ? a.b.specificType + "." : "";
return b + (a.c != null ? a.c.toString() : "");
}
am(a, b) {
if (b.c == null) {
return "null";
}
let c = b.c;
let d = "[";
for (let e = 0; e < c.length; e++) {
if (e > 0) {
d += ", ";
}
d += c[e];
}
return d + "]";
}
get_w() {
return true;
}
a4(a) {
super.a4(a);
if (a == "any") {
if (this.u) {
this.h.l("var " + this.aj + ": any = {};");
}
else {
this.h.l("var " + this.aj + ": any = {};");
}
}
else {
if (this.u) {
this.h.l("var " + this.aj + " = new " + a + "();");
}
else {
this.h.l("var " + this.aj + " = new " + a + "();");
}
}
if (!this.bk.contains(this.aj)) {
this.bk.add_1(this.aj);
if (!this.bl.contains(this.ak)) {
this.bl.add_1(this.ak);
this.a3(this.ak);
}
this.f.l("private " + CodeGeneratingComponentRenderer.d2(this.aj) + ": " + this.ak);
if (!this.p) {
if (this.u) {
this.g.l("var " + CodeGeneratingComponentRenderer.d2(this.aj) + " = this." + CodeGeneratingComponentRenderer.d2(this.aj) + " = document.querySelector('" + CodeGeneratingComponentRenderer.d4(stringReplace(this.ak, "Component", "")) + "') as " + this.ak + ";");
}
}
else {
this.g.l("var " + CodeGeneratingComponentRenderer.d2(this.aj) + " = this." + CodeGeneratingComponentRenderer.d2(this.aj) + " = document.getElementById('" + this.aj + "') as " + this.ak + ";");
}
}
}
bn(a) {
if (stringEndsWith(a, "Component")) {
a = a.substr(0, a.length - ("Component").length);
}
return CodeGeneratingComponentRenderer.d4(a);
}
bi() {
this.h.l("");
}
bc(a) {
}
bd(a) {
{
this.h.l("");
}
super.bd(a);
}
ba(a, b, c, d) {
let e = CodeGeneratingComponentRenderer.d2(b);
if (this.s(c)) {
this.bj(c);
if (!this.bk.contains(this.aj)) {
this.bk.add_1(this.aj);
if (!this.bl.contains(this.ak)) {
this.bl.add_1(this.ak);
this.a3(this.ak);
}
this.f.l("private " + CodeGeneratingComponentRenderer.d2(this.aj) + ": " + this.ak);
if (!this.p) {
if (this.u) {
this.g.l("