igniteui-react-core
Version:
Ignite UI React Core.
157 lines (156 loc) • 6.08 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 { CodeGeneratingComponentRendererModuleEmitter } from "./CodeGeneratingComponentRendererModuleEmitter";
import { CodeGenerationTargetPlatforms_$type } from "./CodeGenerationTargetPlatforms";
import { Dictionary$2 } from "./Dictionary$2";
import { List$1 } from "./List$1";
import { HashSet$1 } from "./HashSet$1";
import { String_$type, EnumUtil, fromEnum, markType } from "./type";
import { stringReplace, stringEndsWith } from "./string";
/**
* @hidden
*/
export let TSCodeGeneratingComponentRendererModuleEmitter = /*@__PURE__*/ (() => {
class TSCodeGeneratingComponentRendererModuleEmitter extends CodeGeneratingComponentRendererModuleEmitter {
constructor(a, b, c) {
super(b, c);
this.q = 0;
this.v = 0;
this.r = false;
this.t = new Dictionary$2(String_$type, List$1.$.specialize(String_$type), 0);
this.u = new HashSet$1(String_$type, 0);
this.s = false;
this.q = a;
}
p() {
super.p();
this.v = 0;
}
get x() {
switch (this.q) {
case 1: return "Igx";
case 2: return "Igr";
case 3: return "Igc";
}
return "";
}
get w() {
switch (this.q) {
case 1: return "angular";
case 2: return "react";
case 3: return "webcomponents";
}
return "";
}
m(a, b, c) {
super.m(a, b, c);
if (b == "withDescriptions") {
this.r = true;
return;
}
let d = "igniteui-" + this.w + "-core";
let e = "";
let f = b.split('/');
if (f.length == 1) {
e = f[0];
this.j.addPackageRef(e);
}
else {
d = f[0];
this.j.addPackageRef(d);
if (d == "webinputs") {
d = "igniteui-" + this.w;
}
else {
if (d == "webgrids") {
d = "grids";
}
d = "igniteui-" + this.w + "-" + d;
}
e = f[1];
}
let g = false;
let h = null;
let i = stringReplace(e, "Module", "");
if (c) {
i = "Web" + i;
}
if (a.getMetadata(i, "__skipModuleRegister" + EnumUtil.getName(CodeGenerationTargetPlatforms_$type, this.q)) != null) {
g = true;
}
if (a.getMetadata(i, "__importOverride" + EnumUtil.getName(CodeGenerationTargetPlatforms_$type, this.q)) != null) {
h = a.getMetadata(i, "__importOverride" + EnumUtil.getName(CodeGenerationTargetPlatforms_$type, this.q)).specificExternalType;
}
if (h != null) {
if (!this.u.contains(h)) {
this.u.add_1(h);
}
}
else {
if (!this.t.containsKey(d)) {
this.t.addItem(d, new List$1(String_$type, 0));
}
}
if (this.v > 0 && !g) {
this.d.l(",");
}
if (!g) {
this.d.j(this.x + e);
this.v++;
}
if (h == null && !g) {
let j = this.t.item(d);
j.add(this.x + e);
}
if (this.r) {
if (!this.s) {
this.s = true;
this.c.l("private _componentRenderer: ComponentRenderer = null;");
this.c.l("public get renderer(): ComponentRenderer {");
this.c.h();
this.c.l("if (this._componentRenderer == null) {");
this.c.h();
this.c.l("this._componentRenderer = new ComponentRenderer();");
this.c.l("var context = this._componentRenderer.context;");
this.g.addPackageImport("igniteui-" + this.w + "-core", "ComponentRenderer");
}
let k = e;
if (stringEndsWith(k, "Module")) {
k = k.substr(0, k.length - ("Module").length);
k += "DescriptionModule";
}
if (c) {
k = "Web" + k;
}
this.g.addPackageImport("igniteui-" + this.w + "-core", k);
this.c.l(k + ".register(context);");
}
}
o() {
super.o();
for (let a of fromEnum(this.t.keys)) {
let b = a;
let c = this.t.item(a);
for (let d of fromEnum(c)) {
this.h.addPackageImport(b, d);
}
}
for (let e of fromEnum(this.u)) {
this.h.addDefaultImport(e, "@SELF@");
}
if (this.r) {
this.c.f();
this.c.l("}");
this.c.l("return this._componentRenderer;");
this.c.f();
this.c.l("}");
}
}
}
TSCodeGeneratingComponentRendererModuleEmitter.$t = /*@__PURE__*/ markType(TSCodeGeneratingComponentRendererModuleEmitter, 'TSCodeGeneratingComponentRendererModuleEmitter', CodeGeneratingComponentRendererModuleEmitter.$);
return TSCodeGeneratingComponentRendererModuleEmitter;
})();