UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

197 lines (196 loc) 6.09 kB
import { IgrPivotAggregator } from "./igr-pivot-aggregator"; import { GridColumnDataType_$type } from "./GridColumnDataType"; import { PivotValue as PivotValue_internal } from "./PivotValue"; import { ensureBool, ensureEnum } from "igniteui-react-core"; /** * Configuration of a pivot value aggregation. */ var IgrPivotValue = /** @class */ /*@__PURE__*/ (function () { function IgrPivotValue() { this.mounted = false; this._implementation = this.createImplementation(); this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } IgrPivotValue.prototype.createImplementation = function () { var impl = new PivotValue_internal(); if (impl.setNativeElement) { impl.setNativeElement({}); } return impl; }; Object.defineProperty(IgrPivotValue.prototype, "nativeElement", { get: function () { return this._implementation.nativeElement; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPivotValue.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); IgrPivotValue.prototype.onImplementationCreated = function () { }; IgrPivotValue.prototype._provideImplementation = function (i) { this._implementation = i; this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } }; Object.defineProperty(IgrPivotValue.prototype, "member", { /** * Unique member to extract related data field value for aggregations. */ get: function () { return this.i.l; }, set: function (v) { this.i.l = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPivotValue.prototype, "displayName", { /** * Display name to show instead of member for the column header of this value. * */ get: function () { return this.i.k; }, set: function (v) { this.i.k = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPivotValue.prototype, "aggregate", { /** * Active aggregator definition with key, label and aggregator. */ get: function () { var r = this.i.c; if (r == null) { return null; } if (!r.externalObject) { var e = new IgrPivotAggregator(); 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.c = null : this.i.c = v.i; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPivotValue.prototype, "aggregateList", { /** * List of aggregates to show in aggregate drop-down. */ 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 IgrPivotAggregator) { ret.push(impl); continue; } var e = new IgrPivotAggregator(); 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(IgrPivotValue.prototype, "enabled", { /** * Enables/Disables a particular value from pivot aggregation. */ get: function () { return this.i.g; }, set: function (v) { this.i.g = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrPivotValue.prototype, "styles", { /** * Allow conditionally styling of the IgxPivotGrid cells. */ get: function () { return this.i.j; }, set: function (v) { this.i.j = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPivotValue.prototype, "dataType", { /** * Enables a data type specific template of the cells */ get: function () { return this.i.b; }, set: function (v) { this.i.b = ensureEnum(GridColumnDataType_$type, v); }, enumerable: false, configurable: true }); IgrPivotValue.prototype.findByName = function (name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } if (this.aggregate && this.aggregate.name && this.aggregate.name == name) { return this.aggregate; } return null; }; IgrPivotValue.prototype.setNativeElement = function (element) { this.i.setNativeElement(element); }; return IgrPivotValue; }()); export { IgrPivotValue };