UNPKG

igniteui-angular-core

Version:

Ignite UI Angular Core logic used in multiple UI components.

188 lines (187 loc) 8.17 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 { Base, String_$type, markType } from "./type"; import { CodeGeneratingCodeWriter } from "./CodeGeneratingCodeWriter"; import { CodeGeneratingImportManager } from "./CodeGeneratingImportManager"; import { HashSet$1 } from "./HashSet$1"; import { JsonDictionaryParser } from "./JsonDictionaryParser"; import { stringReplace } from "./string"; /** * @hidden */ export let CodeGeneratingComponentRendererHandlerEmitter = /*@__PURE__*/ (() => { class CodeGeneratingComponentRendererHandlerEmitter extends Base { constructor(a, b) { super(); this.m = null; this.k = null; this.d = null; this.a = null; this.i = new CodeGeneratingImportManager(); this.b = null; this.c = null; this.n = new HashSet$1(String_$type, 0); this.m = a; this.k = b; this.d = new CodeGeneratingCodeWriter(this.m); this.b = new CodeGeneratingCodeWriter(this.m); this.c = new CodeGeneratingCodeWriter(this.m); this.a = new CodeGeneratingCodeWriter(this.m); } get l() { return this.k; } get h() { return this.d; } get e() { return this.a; } get j() { return this.i; } get f() { return this.b; } get g() { return this.c; } s(a, b) { } r(a, b) { } q(a, b) { let c = new HashSet$1(String_$type, 0); if (a != null && a.length > 0) { for (let d = 0; d < a.length; d++) { let e = a[d]; if (e != null) { this.p(e, c, true, false); } } } if (b != null && b.length > 0) { for (let f = 0; f < b.length; f++) { let g = b[f]; if (g != null) { this.p(g, c, false, true); } } } for (let h = 0; h < this.k.t.count; h++) { let i = this.k.t._inner[h]; if (i.a != null && i.c == null) { this.p(i.a.e, c, false, false); } } this.k.addContainerResult("eventHandlers", this.h.toString()); this.k.addContainerResult("eventScript", this.e.toString()); this.k.addImportResult("handlersImports", this.j); this.k.addContainerResult("onInit", this.f.toString()); this.k.addContainerResult("onViewInit", this.g.toString()); } p(a, b, c, d) { if (this.m.library != null && this.m.library.hasItem(a)) { if (b.contains(a)) { return; } b.add_1(a); let e = this.m.library.getItem(a); if (e.type == 1) { let f = e.getContentForPlatform(this.k.platform); if (f != null) { if (f.isJson) { let g = new JsonDictionaryParser(); let h = g.parse(f.content); if (h.g("imports")) { let i = h.item("imports").value; let j = stringReplace(i, "\r\n", "\n").split('\n'); for (let l = 0; l < j.length; l++) { let k = j[l]; if (k.trim().length == 0) { continue; } if (!this.n.contains(k)) { this.n.add_1(k); this.t(this.j, k); } } } if (h.g("handler")) { let m = this.h; if (f.isJSContent) { m = this.e; } let n = h.item("handler").value; n = this.o(n); let o = stringReplace(n, "\r\n", "\n").split('\n'); let p = 0x7FFFFFFF; let q = ""; for (let r = 0; r < this.m.indentSpaces; r++) { q += " "; } for (let t = 0; t < o.length; t++) { let s = o[t]; let u = s; if (u.trim().length == 0) { continue; } u = stringReplace(s, "\t", q); let v = 0; for (let w = 0; w < u.length; w++) { if (u.charAt(w) != ' ' && u.charAt(w) != '\t') { break; } v++; } if (v < p) { p = v; } } for (let y = 0; y < o.length; y++) { let x = o[y]; let z = x; let aa = 0; if (z.trim().length > 0) { while (z.length > 0 && (z.charAt(0) == ' ' || z.charAt(0) == '\t') && aa < p) { if (z.charAt(0) == ' ') { z = z.substr(1); aa++; } if (z.charAt(0) == '\t') { z = z.substr(1); aa += this.m.indentSpaces; } } } m.l(z); } } } else { let ab = f.content; this.h.l(ab); } } if (c) { this.r(a, f.isJSContent); } if (d) { this.s(a, f.isJSContent); } } } } t(a, b) { } o(a) { return a; } } CodeGeneratingComponentRendererHandlerEmitter.$t = markType(CodeGeneratingComponentRendererHandlerEmitter, 'CodeGeneratingComponentRendererHandlerEmitter'); return CodeGeneratingComponentRendererHandlerEmitter; })();