UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

171 lines (170 loc) 5.28 kB
import { TreeGridRecord as TreeGridRecord_internal } from "./TreeGridRecord"; import { ensureBool } from "igniteui-react-core"; var IgrTreeGridRecord = /** @class */ /*@__PURE__*/ (function () { function IgrTreeGridRecord() { this.mounted = false; this._implementation = this.createImplementation(); this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } IgrTreeGridRecord.prototype.createImplementation = function () { var impl = new TreeGridRecord_internal(); if (impl.setNativeElement) { impl.setNativeElement({}); } return impl; }; Object.defineProperty(IgrTreeGridRecord.prototype, "nativeElement", { get: function () { return this._implementation.nativeElement; }, enumerable: false, configurable: true }); Object.defineProperty(IgrTreeGridRecord.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); IgrTreeGridRecord.prototype.onImplementationCreated = function () { }; IgrTreeGridRecord.prototype._provideImplementation = function (i) { this._implementation = i; this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } }; Object.defineProperty(IgrTreeGridRecord.prototype, "key", { get: function () { return this.i.j; }, set: function (v) { this.i.j = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrTreeGridRecord.prototype, "data", { get: function () { return this.i.i; }, set: function (v) { this.i.i = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrTreeGridRecord.prototype, "children", { get: function () { if (!this.i.a) { return undefined; } var ret = []; for (var i = 0; i < this.i.a.length; i++) { var impl = this.i.a[i]; if (!impl.externalObject) { if (impl instanceof IgrTreeGridRecord) { ret.push(impl); continue; } var e = new IgrTreeGridRecord(); e._implementation = impl; impl.externalObject = e; } ret.push(impl.externalObject); } return ret; }, set: function (v) { var arr = []; for (var i = 0; i < v.length; i++) { arr.push(v[i].i); } this.i.a = arr; }, enumerable: false, configurable: true }); Object.defineProperty(IgrTreeGridRecord.prototype, "parent", { get: function () { var r = this.i.b; if (r == null) { return null; } if (!r.externalObject) { var e = new IgrTreeGridRecord(); if (r.$type) { e._implementation = r; } else { if (e.i.setNativeElement) { e.i.setNativeElement(r); } } r.externalObject = e; } return r.externalObject; }, set: function (v) { v == null ? this.i.b = null : this.i.b = v.i; }, enumerable: false, configurable: true }); Object.defineProperty(IgrTreeGridRecord.prototype, "level", { get: function () { return this.i.g; }, set: function (v) { this.i.g = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrTreeGridRecord.prototype, "isFilteredOutParent", { get: function () { return this.i.f; }, set: function (v) { this.i.f = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrTreeGridRecord.prototype, "expanded", { get: function () { return this.i.e; }, set: function (v) { this.i.e = ensureBool(v); }, enumerable: false, configurable: true }); IgrTreeGridRecord.prototype.findByName = function (name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } if (this.parent && this.parent.name && this.parent.name == name) { return this.parent; } return null; }; IgrTreeGridRecord.prototype.setNativeElement = function (element) { this.i.setNativeElement(element); }; return IgrTreeGridRecord; }()); export { IgrTreeGridRecord };