UNPKG

igniteui-angular-core

Version:

Ignite UI Angular Core logic used in multiple UI components.

108 lines (107 loc) 5.01 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 } from "tslib"; import { CodeGeneratingComponentRendererTemplateEmitter } from "./CodeGeneratingComponentRendererTemplateEmitter"; import { Dictionary$2 } from "./Dictionary$2"; import { String_$type, markType } from "./type"; import { CodeGeneratingRegexHelper } from "./CodeGeneratingRegexHelper"; import { stringReplace, stringContains, stringStartsWith, stringEndsWith } from "./string"; /** * @hidden */ var TSCodeGeneratingComponentRendererTemplateEmitter = /** @class */ /*@__PURE__*/ (function (_super) { __extends(TSCodeGeneratingComponentRendererTemplateEmitter, _super); function TSCodeGeneratingComponentRendererTemplateEmitter(a, b, c) { var _this = _super.call(this, a, b) || this; _this.t = 0; _this.u = new Dictionary$2(String_$type, String_$type, 0); _this.t = c; _this.u.item("IgxRowType", "RowType"); _this.u.item("IgxCellType", "CellType"); return _this; } Object.defineProperty(TSCodeGeneratingComponentRendererTemplateEmitter.prototype, "v", { get: function () { switch (this.t) { case 1: return "angular"; case 2: return "react"; case 3: return "webcomponents"; } return ""; }, enumerable: false, configurable: true }); Object.defineProperty(TSCodeGeneratingComponentRendererTemplateEmitter.prototype, "w", { get: function () { switch (this.t) { case 1: return "Igx"; case 2: return "Igr"; case 3: return "Igc"; } return ""; }, enumerable: false, configurable: true }); TSCodeGeneratingComponentRendererTemplateEmitter.prototype.s = function (a, b) { var _this = this; _super.prototype.s.call(this, a, b); var c = new CodeGeneratingRegexHelper("import {([^}]+)}\\s+from\\s+['\"]([^'\"]+)['\"]"); c.execute(b, function (d, e, f) { var g = d(1); var h = d(2); h = stringReplace(h, "webcomponents", _this.v); h = stringReplace(h, "react", _this.v); h = stringReplace(h, "angular", _this.v); if (_this.v == "angular" || _this.v == "react") { if (stringContains(h, "/grids")) { h = stringReplace(h, "/grids", ""); } } if (_this.v == "angular") { if (stringContains(h, "igniteui-angular-grids")) { h = stringReplace(h, "igniteui-angular-grids", "igniteui-angular"); } } var i = g.split(','); for (var k = 0; k < i.length; k++) { var j = i[k]; var l = j.trim(); if (stringStartsWith(l, "Igc")) { l = _this.w + l.substr(3); } if (stringStartsWith(l, "Igr")) { l = _this.w + l.substr(3); } if (stringStartsWith(l, "Igx")) { l = _this.w + l.substr(3); } if (stringStartsWith(l, "Igr") && stringEndsWith(l, "Component")) { l = l.substr(0, l.length - ("Component").length); } if (h.trim() == "igniteui-angular") { if (_this.u.containsKey(l.trim())) { l = _this.u.item(l.trim()); } if (stringStartsWith(l.trim(), "Igx") && stringEndsWith(l.trim(), "EventArgs")) { _this.u.item(l.trim(), stringReplace(l, "Igx", "I")); l = stringReplace(l, "Igx", "I"); } } a.addPackageImport(h.trim(), l.trim()); } return null; }); }; TSCodeGeneratingComponentRendererTemplateEmitter.prototype.q = function (a, b) { return b; }; TSCodeGeneratingComponentRendererTemplateEmitter.$t = markType(TSCodeGeneratingComponentRendererTemplateEmitter, 'TSCodeGeneratingComponentRendererTemplateEmitter', CodeGeneratingComponentRendererTemplateEmitter.$); return TSCodeGeneratingComponentRendererTemplateEmitter; }(CodeGeneratingComponentRendererTemplateEmitter)); export { TSCodeGeneratingComponentRendererTemplateEmitter };