UNPKG

igniteui-react-core

Version:
810 lines (809 loc) 26.3 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, __values } from "tslib"; import { Base, fromEnum, markType, EnumUtil } from "./type"; import { List$1 } from "./List$1"; import { JsonDictionaryObject } from "./JsonDictionaryObject"; import { JsonDictionaryArray } from "./JsonDictionaryArray"; import { JsonDictionaryValue } from "./JsonDictionaryValue"; import { TypeDescriptionWellKnownType_$type } from "./TypeDescriptionWellKnownType"; /** * @hidden */ var ComponentRendererMethodHelperBuilder = /** @class */ /*@__PURE__*/ (function (_super) { __extends(ComponentRendererMethodHelperBuilder, _super); function ComponentRendererMethodHelperBuilder(a, b) { var _this = _super.call(this) || this; _this.e = null; _this.f = null; _this.d = new List$1(ComponentRendererMethodHelperArgumentBuilder.$, 0); _this.b = null; _this.e = a; _this.f = b; return _this; } ComponentRendererMethodHelperBuilder.prototype.argument = function () { var a = new ComponentRendererMethodHelperArgumentBuilder(this); this.d.add(a); return a; }; ComponentRendererMethodHelperBuilder.prototype.$return = function () { var a = new ComponentRendererMethodHelperReturnBuilder(this); this.b = a; return a; }; ComponentRendererMethodHelperBuilder.prototype.build = function () { var e_1, _a; var _this = this; var a = new JsonDictionaryObject(); var b = new JsonDictionaryArray(); a.item("args", b); var c = new Array(this.d.count); var d = 0; try { for (var _b = __values(fromEnum(this.d)), _c = _b.next(); !_c.done; _c = _b.next()) { var e = _c.value; c[d] = e.y(); d++; } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_1) throw e_1.error; } } b.items = c; if (this.f != null) { a.item("targetRef", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = _this.f; return $ret; })())); } a.item("methodName", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = _this.e; return $ret; })())); if (this.b == null) { this.$return().asVoid(); } a.item("return", this.b.x()); return a.b(); }; ComponentRendererMethodHelperBuilder.$t = markType(ComponentRendererMethodHelperBuilder, 'ComponentRendererMethodHelperBuilder'); return ComponentRendererMethodHelperBuilder; }(Base)); export { ComponentRendererMethodHelperBuilder }; /** * @hidden */ var ComponentRendererMethodHelperArgumentBuilder = /** @class */ /*@__PURE__*/ (function (_super) { __extends(ComponentRendererMethodHelperArgumentBuilder, _super); function ComponentRendererMethodHelperArgumentBuilder(a) { var _this = _super.call(this) || this; _this.v = null; _this.z = 0; _this.ac = null; _this.ab = null; _this.aa = null; _this.x = null; _this.v = a; return _this; } ComponentRendererMethodHelperArgumentBuilder.prototype.argument = function () { return this.v.argument(); }; ComponentRendererMethodHelperArgumentBuilder.prototype.$return = function () { return this.v.$return(); }; ComponentRendererMethodHelperArgumentBuilder.prototype.build = function () { return this.v.build(); }; ComponentRendererMethodHelperArgumentBuilder.prototype.asInt = function (a) { this.z = 1; this.ac = null; this.ab = "int"; this.x = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = a; return $ret; })()); return this; }; ComponentRendererMethodHelperArgumentBuilder.prototype.asIntArray = function (a) { this.z = 10; this.ac = null; this.ab = "int"; if (a == null) { this.x = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 3; $ret.value = null; return $ret; })()); } else { var b = new JsonDictionaryArray(); b.items = new Array(a.length); var _loop_1 = function (c) { b.items[c] = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = a[c]; return $ret; })()); }; for (var c = 0; c < a.length; c++) { _loop_1(c); } this.x = b; } return this; }; ComponentRendererMethodHelperArgumentBuilder.prototype.asDouble = function (a) { this.z = 1; this.ac = null; this.ab = "double"; this.x = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = a; return $ret; })()); return this; }; ComponentRendererMethodHelperArgumentBuilder.prototype.asDoubleArray = function (a) { this.z = 10; this.ac = null; this.ab = "double"; if (a == null) { this.x = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 3; $ret.value = null; return $ret; })()); } else { var b = new JsonDictionaryArray(); b.items = new Array(a.length); var _loop_2 = function (c) { b.items[c] = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = a[c]; return $ret; })()); }; for (var c = 0; c < a.length; c++) { _loop_2(c); } this.x = b; } return this; }; ComponentRendererMethodHelperArgumentBuilder.prototype.asShort = function (a) { this.z = 1; this.ac = null; this.ab = "short"; this.x = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = a; return $ret; })()); return this; }; ComponentRendererMethodHelperArgumentBuilder.prototype.asShortArray = function (a) { this.z = 10; this.ac = null; this.ab = "short"; if (a == null) { this.x = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 3; $ret.value = null; return $ret; })()); } else { var b = new JsonDictionaryArray(); b.items = new Array(a.length); var _loop_3 = function (c) { b.items[c] = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = a[c]; return $ret; })()); }; for (var c = 0; c < a.length; c++) { _loop_3(c); } this.x = b; } return this; }; ComponentRendererMethodHelperArgumentBuilder.prototype.asLong = function (a) { this.z = 1; this.ac = null; this.ab = "long"; this.x = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = a; return $ret; })()); return this; }; ComponentRendererMethodHelperArgumentBuilder.prototype.asLongArray = function (a) { this.z = 10; this.ac = null; this.ab = "long"; if (a == null) { this.x = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 3; $ret.value = null; return $ret; })()); } else { var b = new JsonDictionaryArray(); b.items = new Array(a.length); var _loop_4 = function (c) { b.items[c] = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = a[c]; return $ret; })()); }; for (var c = 0; c < a.length; c++) { _loop_4(c); } this.x = b; } return this; }; ComponentRendererMethodHelperArgumentBuilder.prototype.asFloat = function (a) { this.z = 1; this.ac = null; this.ab = "float"; this.x = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = a; return $ret; })()); return this; }; ComponentRendererMethodHelperArgumentBuilder.prototype.asFloatArray = function (a) { this.z = 10; this.ac = null; this.ab = "float"; if (a == null) { this.x = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 3; $ret.value = null; return $ret; })()); } else { var b = new JsonDictionaryArray(); b.items = new Array(a.length); var _loop_5 = function (c) { b.items[c] = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = a[c]; return $ret; })()); }; for (var c = 0; c < a.length; c++) { _loop_5(c); } this.x = b; } return this; }; ComponentRendererMethodHelperArgumentBuilder.prototype.asEnum = function (a, b) { this.z = 8; this.ac = a.typeName; this.ab = "string"; if (b == null) { this.x = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 3; $ret.value = null; return $ret; })()); } else { this.x = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = b.toString(); return $ret; })()); } return this; }; ComponentRendererMethodHelperArgumentBuilder.prototype.asString = function (a) { this.z = 2; this.ac = null; this.ab = "string"; if (a == null) { this.x = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 3; $ret.value = null; return $ret; })()); } else { this.x = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = a; return $ret; })()); } return this; }; ComponentRendererMethodHelperArgumentBuilder.prototype.asStringArray = function (a) { this.z = 10; this.ac = null; this.ab = "string"; if (a == null) { this.x = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 3; $ret.value = null; return $ret; })()); } else { var b = new JsonDictionaryArray(); b.items = new Array(a.length); var _loop_6 = function (c) { b.items[c] = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = a[c]; return $ret; })()); }; for (var c = 0; c < a.length; c++) { _loop_6(c); } this.x = b; } return this; }; ComponentRendererMethodHelperArgumentBuilder.prototype.asPublicTypeRef = function (a, b) { this.z = 8; this.ac = a; this.ab = a; if (b == null) { this.x = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 3; $ret.value = null; return $ret; })()); } else { var c = new JsonDictionaryObject(); c.item("refType", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = "name"; return $ret; })())); c.item("id", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = b.name; return $ret; })())); this.x = c; } return this; }; ComponentRendererMethodHelperArgumentBuilder.prototype.asPoint = function (a) { this.z = 11; this.ac = null; this.ab = null; var b = new JsonDictionaryObject(); b.item("x", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = a.x; return $ret; })())); b.item("y", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = a.y; return $ret; })())); this.x = b; return this; }; ComponentRendererMethodHelperArgumentBuilder.prototype.asSize = function (a) { this.z = 12; this.ac = null; this.ab = null; var b = new JsonDictionaryObject(); b.item("width", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = a.width; return $ret; })())); b.item("height", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = a.height; return $ret; })())); this.x = b; return this; }; ComponentRendererMethodHelperArgumentBuilder.prototype.asRect = function (a) { this.z = 14; this.ac = null; this.ab = null; var b = new JsonDictionaryObject(); b.item("left", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = a.left; return $ret; })())); b.item("top", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = a.top; return $ret; })())); b.item("width", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = a.width; return $ret; })())); b.item("height", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = a.height; return $ret; })())); this.x = b; return this; }; ComponentRendererMethodHelperArgumentBuilder.prototype.asMethodRef = function (a) { this.z = 18; this.ac = null; this.ab = null; var b = new JsonDictionaryObject(); b.item("refType", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = "name"; return $ret; })())); b.item("id", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = a; return $ret; })())); this.x = b; return this; }; ComponentRendererMethodHelperArgumentBuilder.prototype.asBool = function (a) { this.z = 2; this.ac = null; this.ab = "boolean"; this.x = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 1; $ret.value = a; return $ret; })()); return this; }; ComponentRendererMethodHelperArgumentBuilder.prototype.asBoolArray = function (a) { this.z = 10; this.ac = null; this.ab = "boolean"; if (a == null) { this.x = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 3; $ret.value = null; return $ret; })()); } else { var b = new JsonDictionaryArray(); b.items = new Array(a.length); var _loop_7 = function (c) { b.items[c] = ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 1; $ret.value = a[c]; return $ret; })()); }; for (var c = 0; c < a.length; c++) { _loop_7(c); } this.x = b; } return this; }; ComponentRendererMethodHelperArgumentBuilder.prototype.y = function () { var _this = this; var a = new JsonDictionaryObject(); a.item("knownType", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = EnumUtil.getName(TypeDescriptionWellKnownType_$type, _this.z); return $ret; })())); if (this.ac != null) { a.item("specificType", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = _this.ac; return $ret; })())); } if (this.ab != null) { a.item("specificExternalType", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = _this.ab; return $ret; })())); } if (this.aa != null) { a.item("collectionElementType", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = _this.aa; return $ret; })())); } if (this.x != null) { a.item("value", this.x); } else { a.item("value", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 3; return $ret; })())); } return a; }; ComponentRendererMethodHelperArgumentBuilder.$t = markType(ComponentRendererMethodHelperArgumentBuilder, 'ComponentRendererMethodHelperArgumentBuilder'); return ComponentRendererMethodHelperArgumentBuilder; }(Base)); export { ComponentRendererMethodHelperArgumentBuilder }; /** * @hidden */ var ComponentRendererMethodHelperReturnBuilder = /** @class */ /*@__PURE__*/ (function (_super) { __extends(ComponentRendererMethodHelperReturnBuilder, _super); function ComponentRendererMethodHelperReturnBuilder(a) { var _this = _super.call(this) || this; _this.b = null; _this.y = 0; _this.ab = null; _this.aa = null; _this.z = null; _this.b = a; return _this; } ComponentRendererMethodHelperReturnBuilder.prototype.argument = function () { return this.b.argument(); }; ComponentRendererMethodHelperReturnBuilder.prototype.$return = function () { return this.b.$return(); }; ComponentRendererMethodHelperReturnBuilder.prototype.build = function () { return this.b.build(); }; ComponentRendererMethodHelperReturnBuilder.prototype.asInt = function () { this.y = 1; this.ab = null; this.aa = "int"; return this; }; ComponentRendererMethodHelperReturnBuilder.prototype.asIntArray = function () { this.y = 10; this.ab = null; this.aa = "int"; return this; }; ComponentRendererMethodHelperReturnBuilder.prototype.asDouble = function () { this.y = 1; this.ab = null; this.aa = "double"; return this; }; ComponentRendererMethodHelperReturnBuilder.prototype.asDoubleArray = function () { this.y = 10; this.ab = null; this.aa = "double"; return this; }; ComponentRendererMethodHelperReturnBuilder.prototype.asShort = function () { this.y = 1; this.ab = null; this.aa = "short"; return this; }; ComponentRendererMethodHelperReturnBuilder.prototype.asShortArray = function () { this.y = 10; this.ab = null; this.aa = "short"; return this; }; ComponentRendererMethodHelperReturnBuilder.prototype.asLong = function () { this.y = 1; this.ab = null; this.aa = "long"; return this; }; ComponentRendererMethodHelperReturnBuilder.prototype.asLongArray = function () { this.y = 10; this.ab = null; this.aa = "long"; return this; }; ComponentRendererMethodHelperReturnBuilder.prototype.asFlout = function () { this.y = 1; this.ab = null; this.aa = "float"; return this; }; ComponentRendererMethodHelperReturnBuilder.prototype.asFloatArray = function () { this.y = 10; this.ab = null; this.aa = "float"; return this; }; ComponentRendererMethodHelperReturnBuilder.prototype.asEnum = function (a) { this.y = 8; this.ab = a.typeName; this.aa = "string"; return this; }; ComponentRendererMethodHelperReturnBuilder.prototype.asString = function () { this.y = 2; this.ab = null; this.aa = "string"; return this; }; ComponentRendererMethodHelperReturnBuilder.prototype.asStringArray = function () { this.y = 10; this.ab = null; this.aa = "string"; return this; }; ComponentRendererMethodHelperReturnBuilder.prototype.asPublicTypeRef = function (a) { this.y = 8; this.ab = a; this.aa = a; var b = new JsonDictionaryObject(); b.item("refType", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = "name"; return $ret; })())); b.item("id", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = "name"; return $ret; })())); return this; }; ComponentRendererMethodHelperReturnBuilder.prototype.asPoint = function () { this.y = 11; this.ab = null; this.aa = null; return this; }; ComponentRendererMethodHelperReturnBuilder.prototype.asSize = function () { this.y = 12; this.ab = null; this.aa = null; return this; }; ComponentRendererMethodHelperReturnBuilder.prototype.asRect = function () { this.y = 14; this.ab = null; this.aa = null; return this; }; ComponentRendererMethodHelperReturnBuilder.prototype.asMethodRef = function () { this.y = 18; this.ab = null; this.aa = null; return this; }; ComponentRendererMethodHelperReturnBuilder.prototype.asBool = function () { this.y = 7; this.ab = null; this.aa = "boolean"; return this; }; ComponentRendererMethodHelperReturnBuilder.prototype.x = function () { var _this = this; var a = new JsonDictionaryObject(); a.item("knownType", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = EnumUtil.getName(TypeDescriptionWellKnownType_$type, _this.y); return $ret; })())); if (this.ab != null) { a.item("specificType", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = _this.ab; return $ret; })())); } if (this.aa != null) { a.item("specificExternalType", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = _this.aa; return $ret; })())); } if (this.z != null) { a.item("collectionElementType", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = _this.z; return $ret; })())); } return a; }; ComponentRendererMethodHelperReturnBuilder.prototype.asVoid = function () { this.y = 0; this.ab = null; this.aa = null; return this; }; ComponentRendererMethodHelperReturnBuilder.$t = markType(ComponentRendererMethodHelperReturnBuilder, 'ComponentRendererMethodHelperReturnBuilder'); return ComponentRendererMethodHelperReturnBuilder; }(Base)); export { ComponentRendererMethodHelperReturnBuilder };