UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

268 lines (267 loc) 8.86 kB
import { IgrPivotKeys } from "./igr-pivot-keys"; import { PivotConfiguration as PivotConfiguration_internal } from "./PivotConfiguration"; import { interfaceToInternal } from "igniteui-react-core"; import { PivotDimensionStrategy } from "./PivotDimensionStrategy"; import { IgrPivotDimension } from "./igr-pivot-dimension"; import { IgrPivotValue } from "./igr-pivot-value"; /** * Configuration of the pivot grid. */ var IgrPivotConfiguration = /** @class */ /*@__PURE__*/ (function () { function IgrPivotConfiguration() { this.mounted = false; this._implementation = this.createImplementation(); this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } IgrPivotConfiguration.prototype.createImplementation = function () { var impl = new PivotConfiguration_internal(); if (impl.setNativeElement) { impl.setNativeElement({}); } return impl; }; Object.defineProperty(IgrPivotConfiguration.prototype, "nativeElement", { get: function () { return this._implementation.nativeElement; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPivotConfiguration.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); IgrPivotConfiguration.prototype.onImplementationCreated = function () { }; IgrPivotConfiguration.prototype._provideImplementation = function (i) { this._implementation = i; this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } }; Object.defineProperty(IgrPivotConfiguration.prototype, "rowStrategy", { /** * A strategy to transform the rows. */ get: function () { return this.i.f.nativeElement; }, set: function (v) { this.i.f = interfaceToInternal(v, function () { return new PivotDimensionStrategy(); }); }, enumerable: false, configurable: true }); Object.defineProperty(IgrPivotConfiguration.prototype, "columnStrategy", { /** * A strategy to transform the columns. */ get: function () { return this.i.e.nativeElement; }, set: function (v) { this.i.e = interfaceToInternal(v, function () { return new PivotDimensionStrategy(); }); }, enumerable: false, configurable: true }); Object.defineProperty(IgrPivotConfiguration.prototype, "rows", { /** * A list of the rows. */ get: function () { if (!this.i.c) { return undefined; } var ret = []; for (var i = 0; i < this.i.c.length; i++) { var impl = this.i.c[i]; if (!impl.externalObject) { if (impl instanceof IgrPivotDimension) { ret.push(impl); continue; } var e = new IgrPivotDimension(); 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.c = arr; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPivotConfiguration.prototype, "columns", { /** * A list of the columns. */ 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 IgrPivotDimension) { ret.push(impl); continue; } var e = new IgrPivotDimension(); 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(IgrPivotConfiguration.prototype, "values", { /** * A list of the values. */ get: function () { if (!this.i.d) { return undefined; } var ret = []; for (var i = 0; i < this.i.d.length; i++) { var impl = this.i.d[i]; if (!impl.externalObject) { if (impl instanceof IgrPivotValue) { ret.push(impl); continue; } var e = new IgrPivotValue(); 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.d = arr; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPivotConfiguration.prototype, "filters", { /** * Dimensions to be displayed in the filter area. */ get: function () { if (!this.i.b) { return undefined; } var ret = []; for (var i = 0; i < this.i.b.length; i++) { var impl = this.i.b[i]; if (!impl.externalObject) { if (impl instanceof IgrPivotDimension) { ret.push(impl); continue; } var e = new IgrPivotDimension(); 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.b = arr; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPivotConfiguration.prototype, "pivotKeys", { /** * Pivot data keys used for data generation. Can be used for custom remote scenarios where the data is pre-populated. */ get: function () { var r = this.i.g; if (r == null) { return null; } if (!r.externalObject) { var e = new IgrPivotKeys(); 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.g = null : this.i.g = v.i; }, enumerable: false, configurable: true }); IgrPivotConfiguration.prototype.findByName = function (name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } if (this.rowStrategy && this.rowStrategy.name && this.rowStrategy.name == name) { return this.rowStrategy; } if (this.columnStrategy && this.columnStrategy.name && this.columnStrategy.name == name) { return this.columnStrategy; } if (this.pivotKeys && this.pivotKeys.name && this.pivotKeys.name == name) { return this.pivotKeys; } return null; }; IgrPivotConfiguration.prototype.setNativeElement = function (element) { this.i.setNativeElement(element); }; return IgrPivotConfiguration; }()); export { IgrPivotConfiguration };