UNPKG

igniteui-angular-core

Version:

Ignite UI Angular Core logic used in multiple UI components.

134 lines (133 loc) 4.96 kB
import { EventEmitter } from '@angular/core'; import { delegateCombine } from './type'; import { DataSourceSummaryOperand_$type } from "./DataSourceSummaryOperand"; import { IgxProvideCalculatorEventArgs } from "./igx-provide-calculator-event-args"; import { DataSourceSummaryDescription as DataSourceSummaryDescription_internal } from "./DataSourceSummaryDescription"; import { ensureEnum } from "./componentUtil"; var IgxDataSourceSummaryDescription = /** @class */ /*@__PURE__*/ (function () { function IgxDataSourceSummaryDescription() { this._provideCalculator = null; this._zoneRunner = null; this._implementation = this.createImplementation(); this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } IgxDataSourceSummaryDescription.prototype.createImplementation = function () { return new DataSourceSummaryDescription_internal(0); }; Object.defineProperty(IgxDataSourceSummaryDescription.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); IgxDataSourceSummaryDescription.prototype.onImplementationCreated = function () { }; IgxDataSourceSummaryDescription.prototype._provideImplementation = function (i) { this._implementation = i; this._implementation.externalObject = this; this.onImplementationCreated(); }; Object.defineProperty(IgxDataSourceSummaryDescription.prototype, "field", { get: function () { return this.i.p; }, set: function (v) { this.i.p = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataSourceSummaryDescription.prototype, "operand", { get: function () { return this.i.c; }, set: function (v) { this.i.c = ensureEnum(DataSourceSummaryOperand_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataSourceSummaryDescription.prototype, "alias", { /** * Gets or sets an alias for the summary. Currently only used in aggregated data situations. */ get: function () { return this.i.n; }, set: function (v) { this.i.n = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataSourceSummaryDescription.prototype, "calculatorDisplayName", { /** * Gets or sets the name to use when displaying the calculator name. */ get: function () { return this.i.o; }, set: function (v) { this.i.o = v; }, enumerable: false, configurable: true }); IgxDataSourceSummaryDescription.prototype.findByName = function (name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } return null; }; IgxDataSourceSummaryDescription.prototype.equals = function (other) { var iv = this.i.equals(other); return (iv); }; Object.defineProperty(IgxDataSourceSummaryDescription.prototype, "provideCalculator", { /** * Called when the summary calculator is required. */ get: function () { var _this = this; if (this._provideCalculator == null) { this._provideCalculator = new EventEmitter(); this.i.provideCalculator = delegateCombine(this.i.provideCalculator, function (o, e) { _this._runInZone(function () { var outerArgs = new IgxProvideCalculatorEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeProvideCalculator) { _this.beforeProvideCalculator(_this, outerArgs); } _this._provideCalculator.emit({ sender: _this, args: outerArgs }); }); }); } return this._provideCalculator; }, enumerable: false, configurable: true }); IgxDataSourceSummaryDescription.prototype._runInZone = function (act) { if (this._zoneRunner != null) { this._zoneRunner(act); } else { act(); } }; return IgxDataSourceSummaryDescription; }()); export { IgxDataSourceSummaryDescription };