UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

200 lines (199 loc) 6.38 kB
import { IgrColumn } from "./igr-column"; import { GroupByRecord as GroupByRecord_internal } from "./GroupByRecord"; import { interfaceToInternal } from "igniteui-react-core"; import { SortingExpression } from "./SortingExpression"; var IgrGroupByRecord = /** @class */ /*@__PURE__*/ (function () { function IgrGroupByRecord() { this.mounted = false; this._implementation = this.createImplementation(); this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } IgrGroupByRecord.prototype.createImplementation = function () { return new GroupByRecord_internal(); }; Object.defineProperty(IgrGroupByRecord.prototype, "nativeElement", { get: function () { return this._implementation.nativeElement; }, enumerable: false, configurable: true }); Object.defineProperty(IgrGroupByRecord.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); IgrGroupByRecord.prototype.onImplementationCreated = function () { }; IgrGroupByRecord.prototype._provideImplementation = function (i) { this._implementation = i; this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } }; Object.defineProperty(IgrGroupByRecord.prototype, "expression", { get: function () { return this.i.e.nativeElement; }, set: function (v) { this.i.e = interfaceToInternal(v, function () { return new SortingExpression(); }); }, enumerable: false, configurable: true }); Object.defineProperty(IgrGroupByRecord.prototype, "level", { get: function () { return this.i.i; }, set: function (v) { this.i.i = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrGroupByRecord.prototype, "records", { get: function () { return this.i.b; }, set: function (v) { if (v && !Array.isArray(v) && typeof (v) == "string") { var re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.b = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrGroupByRecord.prototype, "value", { get: function () { return this.i.l; }, set: function (v) { this.i.l = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrGroupByRecord.prototype, "groupParent", { get: function () { var r = this.i.d; if (r == null) { return null; } if (!r.externalObject) { var e = new IgrGroupByRecord(); 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.d = null : this.i.d = v.i; }, enumerable: false, configurable: true }); Object.defineProperty(IgrGroupByRecord.prototype, "groups", { 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 IgrGroupByRecord) { ret.push(impl); continue; } var e = new IgrGroupByRecord(); 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(IgrGroupByRecord.prototype, "height", { get: function () { return this.i.h; }, set: function (v) { this.i.h = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrGroupByRecord.prototype, "column", { get: function () { var r = this.i.c; if (r == null) { return null; } if (!r.externalObject) { var e = IgrColumn._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; }, set: function (v) { v == null ? this.i.c = null : this.i.c = v.i; }, enumerable: false, configurable: true }); IgrGroupByRecord.prototype.findByName = function (name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } if (this.expression && this.expression.name && this.expression.name == name) { return this.expression; } if (this.groupParent && this.groupParent.name && this.groupParent.name == name) { return this.groupParent; } if (this.column && this.column.name && this.column.name == name) { return this.column; } return null; }; IgrGroupByRecord.prototype.setNativeElement = function (element) { this.i.setNativeElement(element); }; return IgrGroupByRecord; }()); export { IgrGroupByRecord };