UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

245 lines (244 loc) 7.7 kB
import { IgrFilteringExpressionsTree } from "./igr-filtering-expressions-tree"; import { SortingDirection_$type } from "./SortingDirection"; import { GridColumnDataType_$type } from "./GridColumnDataType"; import { PivotDimension as PivotDimension_internal } from "./PivotDimension"; import { ensureBool, ensureEnum } from "igniteui-react-core"; /** * Configuration of a pivot dimension. */ var IgrPivotDimension = /** @class */ /*@__PURE__*/ (function () { function IgrPivotDimension() { this.mounted = false; this._implementation = this.createImplementation(); this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } IgrPivotDimension.prototype.createImplementation = function () { var impl = new PivotDimension_internal(); if (impl.setNativeElement) { impl.setNativeElement({}); } return impl; }; Object.defineProperty(IgrPivotDimension.prototype, "nativeElement", { get: function () { return this._implementation.nativeElement; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPivotDimension.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); IgrPivotDimension.prototype.onImplementationCreated = function () { }; IgrPivotDimension.prototype._provideImplementation = function (i) { this._implementation = i; this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } }; Object.defineProperty(IgrPivotDimension.prototype, "childLevel", { /** * Allows defining a hierarchy when multiple sub groups need to be extracted from single member. */ get: function () { var r = this.i.d; if (r == null) { return null; } if (!r.externalObject) { var e = new IgrPivotDimension(); 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(IgrPivotDimension.prototype, "memberName", { /** * Field name to use in order to extract value. */ get: function () { return this.i.o; }, set: function (v) { this.i.o = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPivotDimension.prototype, "displayName", { /** * Display name to show instead of the field name of this value. * */ get: function () { return this.i.n; }, set: function (v) { this.i.n = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPivotDimension.prototype, "enabled", { /** * Enables/Disables a particular dimension from pivot structure. */ get: function () { return this.i.h; }, set: function (v) { this.i.h = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrPivotDimension.prototype, "filter", { /** * A predefined or defined via the `igxPivotSelector` filter expression tree for the current dimension to be applied in the filter pipe. */ get: function () { var r = this.i.a; if (r == null) { return null; } if (!r.externalObject) { var e = new IgrFilteringExpressionsTree(); 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.a = null : this.i.a = v.i; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPivotDimension.prototype, "sortable", { /** * Enable/disable sorting for a particular dimension. True by default. */ get: function () { return this.i.j; }, set: function (v) { this.i.j = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrPivotDimension.prototype, "sortDirection", { /** * The sorting direction of the current dimension. Determines the order in which the values will appear in the related dimension. */ get: function () { return this.i.e; }, set: function (v) { this.i.e = ensureEnum(SortingDirection_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrPivotDimension.prototype, "dataType", { /** * The dataType of the related data field. */ get: function () { return this.i.b; }, set: function (v) { this.i.b = ensureEnum(GridColumnDataType_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrPivotDimension.prototype, "width", { /** * The width of the dimension cells to be rendered.Can be pixel, % or "auto". */ get: function () { return this.i.p; }, set: function (v) { this.i.p = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPivotDimension.prototype, "level", { /** * Level of the dimension. */ get: function () { return this.i.k; }, set: function (v) { this.i.k = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPivotDimension.prototype, "horizontalSummary", { get: function () { return this.i.i; }, set: function (v) { this.i.i = ensureBool(v); }, enumerable: false, configurable: true }); IgrPivotDimension.prototype.findByName = function (name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } if (this.childLevel && this.childLevel.name && this.childLevel.name == name) { return this.childLevel; } if (this.filter && this.filter.name && this.filter.name == name) { return this.filter; } return null; }; IgrPivotDimension.prototype.setNativeElement = function (element) { this.i.setNativeElement(element); }; return IgrPivotDimension; }()); export { IgrPivotDimension };