igniteui-react-core
Version:
Ignite UI React Core.
1,393 lines (1,392 loc) • 153 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, 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
*/
export let CodeGeneratingComponentRendererCodeEmitter = /*@__PURE__*/ (() => {
class CodeGeneratingComponentRendererCodeEmitter extends Base {
get_al() {
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 "";
}
get al() {
return this.get_al();
}
get_am() {
switch (this.j.platform) {
case 1: return "Component";
case 2: return "";
case 3: return "Component";
case 4: return "";
case 0: return "";
}
return "";
}
get am() {
return this.get_am();
}
get a6() {
switch (this.j.platform) {
case 1: return "angular";
case 2: return "react";
case 3: return "webcomponents";
}
return "";
}
get m() {
return this.l;
}
br(a) {
this.j.af(a);
}
get k() {
return this.j;
}
constructor(a, b) {
super();
this.l = null;
this.j = null;
this.z = new List$1(CodeGenerationItemBuilderPropertyInfo.$, 0);
this.d = null;
this.a = null;
this.c = null;
this.b = null;
this.aa = new List$1(String_$type, 0);
this.af = new Stack$1(String_$type);
this.ad = new Stack$1(String_$type);
this.ae = new Stack$1(Boolean_$type);
this.a5 = null;
this.a4 = 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 h() {
return this.d;
}
get e() {
return this.a;
}
get g() {
return this.c;
}
get f() {
return this.b;
}
bb(a) {
if (a == null || a == "any") {
return;
}
this.aa.add(a);
}
w(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 || b.b.knownType == 10)) {
if (this.w(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 aq() {
return this.af.d();
}
bc(a, b, c) {
this.af.h(a);
}
u(a, b) {
let c = false;
if (b.getMetadata(a, "__isPlainObject") != null) {
c = true;
}
return c;
}
bq() {
}
bk(a) {
}
bl(a) {
this.af.e();
}
bi(a, b, c, d) {
}
bj(a, b, c, d) {
this.bi(a, b, c, d);
}
toString() {
return this.d.toString();
}
a0() {
return "null";
}
a3(a, b, c) {
if (b.b == null) {
return b.c;
}
if (typeCast(CodeGenerationSpecialValue.$, b.c) !== null) {
b.c = this.ag(b);
}
switch (b.b.knownType) {
case 10:
if (this.w(a, b)) {
return this.ao(a, b);
}
return this.at(a, b);
case 23:
if (this.w(a, b)) {
return this.ao(a, b);
}
return this.at(a, b);
case 7: return b.c ? "true" : "false";
case 4: return this.ai(b);
case 6:
{
return stringJoin1(String_$type, " ", this.ab(b, c));
}
case 9:
if (this.w(a, b)) {
return this.ao(a, b);
}
throw new NotSupportedException(1, "shouldn't get here");
case 5: return this.ak(b);
case 16:
{
return stringJoin1(String_$type, " ", this.ac(b, c));
}
case 20:
if (b.a != null) {
return this.a2(b);
}
if (b.c == null) {
return this.a0();
}
break;
case 22:
if (b.a != null) {
return this.a2(b);
}
if (b.c == null) {
return this.a0();
}
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.ax(b);
}
else {
return this.a0();
}
case 8:
if (b.b.specificExternalType == "string") {
return this.aw(b);
}
if (b.a != null) {
return this.ay(b);
}
if (this.w(a, b)) {
return this.ao(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.az(b);
}
else {
return this.a0();
}
case 1: return b.c.toString();
case 11:
{
let d = b.c;
return d.x + ", " + d.y;
}
case 14:
{
let e = b.c;
return e.left + ", " + e.top + ", " + e.width + ", " + e.height;
}
case 12:
{
let f = b.c;
return f.width + ", " + f.height;
}
case 2: return b.c != null ? b.c.toString() : this.a0();
case 21: return this.a9(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 "";
}
ab(a, b) {
if (a.b == null) {
return ((() => {
let $ret = new List$1(String_$type, 0);
$ret.add(a.c);
return $ret;
})());
}
if (typeCast(CodeGenerationSpecialValue.$, a.c) !== null) {
a.c = this.ag(a);
}
let c = a.c;
let d = new List$1(String_$type, 0);
for (let e = 0; e < c.count; e++) {
d.add(this.ah(c.item(e)));
}
return d;
}
ac(a, b) {
if (a.b == null) {
return ((() => {
let $ret = new List$1(String_$type, 0);
$ret.add(a.c);
return $ret;
})());
}
if (typeCast(CodeGenerationSpecialValue.$, a.c) !== null) {
a.c = this.ag(a);
}
let c = a.c;
let d = new List$1(String_$type, 0);
for (let e = 0; e < c.count; e++) {
d.add(this.aj(c.item(e)));
}
return d;
}
a9(a) {
if (a == null) {
return "";
}
return a.toString();
}
ao(a, b) {
let c = this.a8(a, b);
if (b.c != null) {
let d = b.c;
if (typeCast(List$1.$.specialize(Base.$), d) !== null) {
d = d.toArray();
}
if (typeCast(CodeGenerationItemBuilder.$, d) !== null) {
let e = this.i(this.l, this.j);
let f = this.an(c, b.c, e);
c = this.ar(a, b.c, f, c);
}
else if (typeCast(Array_$type, d) !== null) {
let g = d;
let h = new List$1(CodeGenerationItemBuilder.$, 0);
let i = new List$1(String_$type, 0);
for (let j = 0; j < g.length; j++) {
if (typeCast(CodeGenerationItemBuilder.$, g[j]) !== null) {
let k = this.i(this.l, this.j);
let l = c;
let m = g[j].p();
if (m == null) {
m = g[j].n();
m = this.au(m);
}
if (m != null) {
if (m != l) {
l = m;
}
else {
l = c + "_" + j.toString();
}
}
let n = this.an(l, g[j], k);
h.add(g[j]);
i.add(n);
}
}
c = this.as(b, a, h, i, c);
}
}
return c;
}
an(a, b, c) {
b.u = a;
b.v(c, true);
let d = c.toString();
for (let e of fromEnum(c.aa)) {
this.aa.add(e);
}
return d;
}
ar(a, b, c, d) {
return d;
}
as(a, b, c, d, e) {
return e;
}
a8(a, b) {
if (b.c == null) {
return this.a0();
}
if (typeCast(CodeGenerationItemBuilder.$, b.c) !== null) {
let c = b.c.p();
if (c != null) {
return c;
}
let d = b.c.n();
let e = this.au(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 = f.item(0);
let h = g.p();
if (h != null) {
return h;
}
let i = g.n();
let j = this.au(i);
return j;
}
return this.au(b.b.propertyName);
}
else if (typeCast(Array_$type, b.c) !== null) {
let k = b.c;
if (k.length > 0 && typeCast(CodeGenerationItemBuilder.$, k[0]) !== null) {
let l = b.c.p();
if (l != null) {
return l;
}
let m = b.c.n();
let n = this.au(m);
return n;
}
return this.au(b.b.propertyName);
}
return this.a0();
}
at(a, b) {
return "";
}
ag(a) {
return a.c;
}
a2(a) {
if (!stringIsNullOrEmpty(a.a.e)) {
if (a.a.a) {
return this.av(a);
}
else {
return this.a1(a);
}
}
return this.a0();
}
s(a) {
if (a.a != null && !stringIsNullOrEmpty(a.a.e)) {
if (a.a.a) {
return true;
}
}
return false;
}
a1(a) {
return "";
}
av(a) {
return "";
}
ay(a) {
if (!stringIsNullOrEmpty(a.a.e)) {
return a.a.e;
}
return this.a0();
}
aw(a) {
return a.c != null ? a.c.toString() : "";
}
az(a) {
return this.ax(a);
}
ax(a) {
if (!stringIsNullOrEmpty(a.a.e)) {
this.br(a);
return a.a.e;
}
return this.a0();
}
get_x() {
return false;
}
get x() {
return this.get_x();
}
ak(a) {
let b = a.c;
return ColorUtil.k(b, this.x);
}
aj(a) {
let b = a;
return ColorUtil.k(b, this.x);
}
ai(a) {
if (a.c == null) {
return "";
}
let b = a.c;
return ColorUtil.k(b.color, this.x);
}
ah(a) {
if (a == null) {
return "";
}
let b = a;
return ColorUtil.k(b.color, this.x);
}
bp(a) {
this.ad.h(a);
this.ae.h(false);
}
bo(a) {
let b = this.au(a);
this.ad.h(b);
this.ae.h(true);
}
au(a) {
let b = stringReplace(stringReplace(a, this.a7, ""), "Component", "");
b = CodeGeneratingComponentRenderer.e5(b);
return this.j.v(b);
}
bm() {
this.a4 = this.ad.e();
this.ae.e();
}
get_a7() {
return "";
}
get a7() {
return this.get_a7();
}
get ap() {
if (this.ad.f > 0) {
return this.ad.d();
}
let a = stringReplace(stringReplace(this.aq, this.a7, ""), "Component", "");
return CodeGeneratingComponentRenderer.e5(a);
}
get v() {
return this.af.f == 1;
}
get o() {
if (this.ae.f == 0) {
return false;
}
return this.ae.d();
}
get p() {
if (this.ad.f > 0) {
return true;
}
return false;
}
get_y() {
return true;
}
get y() {
return this.get_y();
}
get_n() {
return this.r;
}
get n() {
return this.get_n();
}
bn() {
this.a4 = this.ad.e();
}
be(a) {
let b = this.f.toString();
if (b.length > 0) {
a.l(b);
}
}
bh(a) {
let b = this.g.toString();
if (b.length > 0) {
a.l(b);
}
}
bd(a) {
let b = this.e.toString();
if (b.length > 0) {
a.l(b);
}
}
bf(a, b) {
if (this.aa.count > 0) {
this.bg(a, this.aa, b);
}
}
bg(a, b, c) {
}
}
CodeGeneratingComponentRendererCodeEmitter.$t = /*@__PURE__*/ markType(CodeGeneratingComponentRendererCodeEmitter, 'CodeGeneratingComponentRendererCodeEmitter');
return CodeGeneratingComponentRendererCodeEmitter;
})();
/**
* @hidden
*/
export let BlazorRazorCodeGeneratingComponentRendererCodeEmitter = /*@__PURE__*/ (() => {
class BlazorRazorCodeGeneratingComponentRendererCodeEmitter extends CodeGeneratingComponentRendererCodeEmitter {
get_r() {
return false;
}
get r() {
return this.get_r();
}
ar(a, b, c, d) {
d = super.ar(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);
}
as(a, b, c, d, e) {
e = super.as(a, b, c, d, e);
let f = null;
if (c.count > 0) {
f = c._inner[0].r() + "[]";
}
else {
let g = a.b.specificExternalType;
f = CodeGenerationItemBuilder.o(this.k.platform, g, b, this.al, this.am) + "[]";
}
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 (let 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);
}
i(a, b) {
return new BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter(a, b);
}
get_y() {
return false;
}
constructor(a, b) {
super(a, b);
this.bu = 0;
this.bs = new HashSet$1(String_$type, 0);
this.bt = new HashSet$1(String_$type, 0);
}
bv(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.a7 + 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.a3(a, f, true) + "\"";
}
else {
g += this.a3(a, f, true);
}
}
g += " })";
return g;
}
at(a, b) {
let c = b.b.specificType;
if (c == null) {
c = b.b.specificExternalType;
}
return this.bv(a, c, b);
}
bc(a, b, c) {
super.bc(a, b, c);
this.h.l("<" + a + "");
if (!this.bs.contains(this.ap)) {
this.bs.add_1(this.ap);
if (!this.bt.contains(this.aq)) {
this.bt.add_1(this.aq);
this.bb(this.aq);
}
this.f.l("private " + this.aq + " " + CodeGeneratingComponentRenderer.e5(this.ap) + ";");
if (!this.p) {
if (this.v) {
this.g.l("var " + CodeGeneratingComponentRenderer.e5(this.ap) + " = this." + CodeGeneratingComponentRenderer.e5(this.ap) + ";");
}
}
else {
this.g.l("var " + CodeGeneratingComponentRenderer.e5(this.ap) + " = this." + CodeGeneratingComponentRenderer.e5(this.ap) + ";");
}
}
}
bq() {
this.h.l(">");
this.h.h();
}
bl(a) {
this.h.f();
this.h.l("</" + a + ">");
this.h.l("");
super.bl(a);
}
bi(a, b, c, d) {
if (c.b != null && d.hasNameBinding(c.b.owningType, CodeGeneratingComponentRenderer.e6(c.b.propertyName)) && this.q(d, c)) {
this.br(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.br(c);
if (!this.bs.contains(this.ap)) {
this.bs.add_1(this.ap);
if (!this.bt.contains(this.aq)) {
this.bt.add_1(this.aq);
this.bb(this.aq);
}
this.f.l("private " + this.aq + " " + CodeGeneratingComponentRenderer.e5(this.ap) + ";");
if (!this.p) {
if (this.v) {
this.g.l("var " + CodeGeneratingComponentRenderer.e5(this.ap) + " = this." + CodeGeneratingComponentRenderer.e5(this.ap) + ";");
}
}
else {
this.g.l("var " + CodeGeneratingComponentRenderer.e5(this.ap) + " = this." + CodeGeneratingComponentRenderer.e5(this.ap) + ";");
}
}
let e = CodeGeneratingComponentRenderer.e5(this.a3(d, c, true));
let f = e;
if (f != "null" && !stringStartsWith(f, "this.")) {
f = "this." + f;
}
this.e.l(CodeGeneratingComponentRenderer.e5(this.ap) + "." + 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.a3(d, c, true));
this.h.j("\"");
}
if (b == "Name") {
this.h.l("");
this.h.j("@ref=\"" + CodeGeneratingComponentRenderer.e5(this.a3(d, c, true)) + "\"");
}
}
aw(a) {
let b = a.b != null ? a.b.specificType + "." : "";
return b + (a.c != null ? a.c.toString() : "");
}
a3(a, b, c) {
if (b.b == null) {
return b.c;
}
if (typeCast(CodeGenerationSpecialValue.$, b.c) !== null) {
b.c = this.ag(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.a3(a, b, c);
}
ag(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;
}
a0() {
return "@null";
}
av(a) {
return CodeGeneratingComponentRenderer.e5(CodeGeneratingComponentRenderer.e5(a.a.e));
}
bw(a) {
a = stringReplace(a, "-", "_");
return CodeGeneratingComponentRenderer.e6(a);
}
a1(a) {
this.br(a);
return CodeGeneratingComponentRenderer.e6(a.a.e);
}
bj(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.v(this, false);
}
}
}
}
else {
if (typeCast(CodeGenerationItemBuilder.$, c.c) !== null) {
let h = c.c;
h.v(this, false);
}
}
}
get_a7() {
return "Igb";
}
}
BlazorRazorCodeGeneratingComponentRendererCodeEmitter.$t = /*@__PURE__*/ markType(BlazorRazorCodeGeneratingComponentRendererCodeEmitter, 'BlazorRazorCodeGeneratingComponentRendererCodeEmitter', CodeGeneratingComponentRendererCodeEmitter.$);
return BlazorRazorCodeGeneratingComponentRendererCodeEmitter;
})();
/**
* @hidden
*/
export let BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter = /*@__PURE__*/ (() => {
class BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter extends CodeGeneratingComponentRendererCodeEmitter {
get_r() {
return true;
}
get r() {
return this.get_r();
}
i(a, b) {
return new BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter(a, b);
}
get_y() {
return false;
}
constructor(a, b) {
super(a, b);
this.bu = 0;
this.bs = new HashSet$1(String_$type, 0);
this.bt = new HashSet$1(String_$type, 0);
}
bv(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;
}
at(a, b) {
if (b.b.specificExternalType == "string") {
return this.bv(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;
}
bc(a, b, c) {
super.bc(a, b, c);
if (this.v) {
this.h.l("var " + this.ap + " = new " + a + "();");
}
else {
this.h.l("var " + this.ap + " = new " + a + "();");
}
if (!this.bs.contains(this.ap)) {
this.bs.add_1(this.ap);
if (!this.bt.contains(this.aq)) {
this.bt.add_1(this.aq);
this.bb(this.aq);
}
this.f.l("private " + this.aq + " " + CodeGeneratingComponentRenderer.e5(this.ap) + ";");
if (!this.p) {
if (this.v) {
this.g.l("var " + CodeGeneratingComponentRenderer.e5(this.ap) + " = this." + CodeGeneratingComponentRenderer.e5(this.ap) + ";");
}
}
else {
this.g.l("var " + CodeGeneratingComponentRenderer.e5(this.ap) + " = this." + CodeGeneratingComponentRenderer.e5(this.ap) + ";");
}
}
}
bq() {
}
bl(a) {
super.bl(a);
}
bi(a, b, c, d) {
if (c.b != null && d.hasNameBinding(c.b.owningType, CodeGeneratingComponentRenderer.e6(c.b.propertyName)) && this.q(d, c)) {
this.br(c);
if (a > 0) {
this.h.l("");
}
if (c.a == null || c.a.e == null) {
this.h.j(this.ap + "." + b + "Name = null;");
}
else {
this.h.j(this.ap + "." + b + "Name = " + c.a.e + ";");
}
return;
}
if (this.s(c)) {
this.br(c);
if (!this.bs.contains(this.ap)) {
this.bs.add_1(this.ap);
if (!this.bt.contains(this.aq)) {
this.bt.add_1(this.aq);
this.bb(this.aq);
}
this.f.l("private " + this.aq + " " + CodeGeneratingComponentRenderer.e5(this.ap) + ";");
if (!this.p) {
if (this.v) {
this.g.l("var " + CodeGeneratingComponentRenderer.e5(this.ap) + " = this." + CodeGeneratingComponentRenderer.e5(this.ap) + ";");
}
}
else {
this.g.l("var " + CodeGeneratingComponentRenderer.e5(this.ap) + " = this." + CodeGeneratingComponentRenderer.e5(this.ap) + ";");
}
}
let e = CodeGeneratingComponentRenderer.e5(this.a3(d, c, true));
let f = e;
if (f != "null" && !stringStartsWith(f, "this.")) {
f = "this." + f;
}
this.e.l(CodeGeneratingComponentRenderer.e5(this.ap) + "." + 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.ap + ".");
this.h.j(b);
this.h.j(" = ");
if (h) {
this.h.j("\"" + this.a3(d, c, true) + "\"");
}
else {
this.h.j(this.a3(d, c, true));
}
this.h.j(";");
}
}
aw(a) {
let b = a.b != null ? a.b.specificType + "." : "";
return b + (a.c != null ? a.c.toString() : "");
}
a3(a, b, c) {
if (b.b == null) {
return "\"" + b.c + "\"";
}
if (typeCast(CodeGenerationSpecialValue.$, b.c) !== null) {
b.c = this.ag(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.a3(a, b, c) + "\"";
case 9: throw new NotSupportedException(1, "shouldn't get here");
}
return super.a3(a, b, c);
}
ag(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;
}
a0() {
return "null";
}
av(a) {
return CodeGeneratingComponentRenderer.e5(CodeGeneratingComponentRenderer.e5(a.a.e));
}
bw(a) {
a = stringReplace(a, "-", "_");
return CodeGeneratingComponentRenderer.e6(a);
}
a1(a) {
this.br(a);
return CodeGeneratingComponentRenderer.e6(a.a.e);
}
bj(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.v(this, false);
this.h.l(this.ap + "." + b + ".Add(" + this.a4 + ");");
}
}
}
}
else if (c.b.knownType == 10) {
let h = typeCast(Array_$type, c.c);
if (h != null) {
let i = "[";
for (let j = 0; j < h.length; j++) {
let k = arrayGetValue(h, j);
if (typeCast(CodeGenerationItemBuilder.$, k) !== null) {
let l = k;
l.v(this, false);
i += this.a4 + ",";
}
}
i = trimEnd(i, ',');
i += "]";
this.h.l(this.ap + "." + b + " = " + i + ";");
}
}
else {
if (typeCast(CodeGenerationItemBuilder.$, c.c) !== null) {
let m = c.c;
m.v(this, false);
this.h.l(this.ap + "." + b + " = " + this.a4 + ";");
}
}
}
get_a7() {
return "Igb";
}
}
BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter.$t = /*@__PURE__*/ markType(BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter, 'BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter', CodeGeneratingComponentRendererCodeEmitter.$);
return BlazorCodeBehindCodeGeneratingComponentRendererCodeEmitter;
})();
/**
* @hidden
*/
export let ReactMarkupCodeGeneratingComponentRendererCodeEmitter = /*@__PURE__*/ (() => {
class ReactMarkupCodeGeneratingComponentRendererCodeEmitter extends CodeGeneratingComponentRendererCodeEmitter {
get_r() {
return false;
}
get r() {
return this.get_r();
}
ar(a, b, c, d) {
d = super.ar(a, b, c, d);
let e = b.r();
this.f.l("private " + " _" + CodeGeneratingComponentRenderer.e5(d) + ": " + e + " | null = null;");
this.f.l("public get " + CodeGeneratingComponentRenderer.e5(d) + "(): " + e + " {");
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("}");
return CodeGeneratingComponentRenderer.e6(d);
}
as(a, b, c, d, e) {
e = super.as(a, b, c, d, e);
let f = null;
if (c.count > 0) {
f = c._inner[0].r() + "[]";
}
else {
let g = a.b.specificExternalType;
f = CodeGenerationItemBuilder.o(this.k.platform, g, b, this.al, this.am) + "[]";
}
this.f.l("private" + " _" + CodeGeneratingComponentRenderer.e5(e) + ": " + f + " | null = null;");
this.f.l("public get " + CodeGeneratingComponentRenderer.e5(e) + "(): " + f + " {");
this.f.h();
this.f.l("if (this._" + CodeGeneratingComponentRenderer.e5(e) + " == null)");
this.f.l("{");
this.f.h();
this.f.k("let " + CodeGeneratingComponentRenderer.e5(e) + ": " + f + " = [];");
for (let h = 0; h < c.count; h++) {
this.f.k(d._inner[h]);
this.f.k(e + ".push(" + 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("}");
return CodeGeneratingComponentRenderer.e6(e);
}
i(a, b) {
return new ReactCodeBehindCodeGeneratingComponentRendererCodeEmitter(a, b);
}
constructor(a, b) {
super(a, b);
this.bs = new HashSet$1(String_$type, 0);
this.bt = new HashSet$1(String_$type, 0);
}
at(a, b) {
if (b.c == null) {
return "{null}";
}
if (b.b != null && b.b.knownType == 23) {
let c = b.c;
let d = "";
for (let e = 0; e < c.length; e++) {
if (e > 0) {
d += ", ";
}
d += c[e];
}
return d;
}
let f = b.c;
let g = "[";
for (let h = 0; h < f.length; h++) {
if (h > 0) {
g += ", ";
}
if (b.b != null && (b.b.specificExternalType == "int" || b.b.specificExternalType == "double")) {
g += f[h].toString();
}
else {
g += "\"" + f[h].toString() + "\"";
}
}
g += "]";
return g;
}
get_x() {
return true;
}
get_a7() {
return "Igr";
}
bc(a, b, c) {
super.bc(a, b, c);
this.h.l("<" + this.bv(a) + "");
this.h.h();
if (!this.bt.contains(this.aq)) {
this.bt.add_1(this.aq);
this.bb(this.aq);
}
if (!this.bs.contains(this.ap)) {
this.bs.add_1(this.ap);
this.f.l("private " + CodeGeneratingComponentRenderer.e5(this.ap) + ": " + this.aq);
if (this.v) {
this.f.l("private " + CodeGeneratingComponentRenderer.e5(this.ap) + "Ref(r: " + this.aq + ") {");
this.f.h();
this.f.l("this." + CodeGeneratingComponentRenderer.e5(this.ap) + " = r;");
this.f.l("this.setState({});");
this.f.f();
this.f.l("}");
this.g.l("this." + CodeGeneratingComponentRenderer.e5(this.ap) + "Ref = " + "this." + CodeGeneratingComponentRenderer.e5(this.ap) + "Ref.bind(this);");
}
}
}
bv(a) {
if (stringEndsWith(a, "Component")) {
a = a.substr(0, a.length - ("Component").length);
}
return CodeGeneratingComponentRenderer.e6(a);
}
bq() {
if (!this.v && !this.p) {
let a = this.bu();
this.h.l("");
this.h.l("name=\"" + a + "\"");
}
this.h.f();
this.h.l(">");
this.h.h();
}
bu() {
let a = CodeGeneratingComponentRenderer.e5(stringReplace(stringReplace(this.aq, this.a7, ""), "Component", ""));
a = this.k.u(a);
return a;
}
ax(a) {
if (!stringIsNullOrEmpty(a.a.e)) {
this.br(a);
if (!this.bs.contains(a.a.e)) {
this.g.l("this." + CodeGeneratingComponentRenderer.e5(a.a.e) + " = " + "this." + CodeGeneratingComponentRenderer.e5(a.a.e) + ".bind(this);");
}
return "this." + CodeGeneratingComponentRenderer.e5(a.a.e);
}
return this.a0();
}
bl(a) {
this.h.f();
this.h.l("</" + this.bv(a) + ">");
super.bl(a);
}
bi(a, b, c, d) {
let e = CodeGeneratingComponentRenderer.e5(b);
let f = this.a3(d, c, true);
if (c.b != null && d.hasNameBinding(c.b.owningType, CodeGeneratingComponentRenderer.e6(c.b.propertyName)) && this.q(d, c)) {
this.br(c);
if (a > 0) {
this.h.l("");
}
if (c.a == null || c.a.e == null) {