UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

94 lines (93 loc) 2.46 kB
import { PivotAggregationType_$type } from "./PivotAggregationType"; import { PivotAggregator as PivotAggregator_internal } from "./PivotAggregator"; import { ensureEnum } from "igniteui-react-core"; /** * Interface describing a IPivotAggregator class. * Used for specifying custom aggregator lists. */ export class IgrPivotAggregator { createImplementation() { let impl = new PivotAggregator_internal(); if (impl.setNativeElement) { impl.setNativeElement({}); } return impl; } get nativeElement() { return this._implementation.nativeElement; } /** * @hidden */ get i() { return this._implementation; } onImplementationCreated() { } constructor() { this.mounted = false; this._implementation = this.createImplementation(); this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } _provideImplementation(i) { this._implementation = i; this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } /** * Aggregation unique key. */ get key() { return this.i.g; } set key(v) { this.i.g = v; } /** * Aggregation label to show in the UI. */ get label() { return this.i.h; } set label(v) { this.i.h = v; } /** * Aggregation name that will be used from a list of predefined aggregations. * If not set will use the specified aggregator function. */ get aggregatorName() { return this.i.b; } set aggregatorName(v) { this.i.b = ensureEnum(PivotAggregationType_$type, v); } /** * Aggregator function can be a custom implementation of `PivotAggregation`, or * use predefined ones from `IgxPivotAggregate` and its variants. */ get aggregator() { return this.i.a; } set aggregator(v) { this.i.a = v; } findByName(name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } return null; } setNativeElement(element) { this.i.setNativeElement(element); } }