UNPKG

igniteui-angular-core

Version:

Ignite UI Angular Core logic used in multiple UI components.

134 lines (129 loc) 5.92 kB
import { __extends } from "tslib"; import { EventEmitter } from '@angular/core'; import { delegateCombine } from './type'; import { IgxPageRequestedEventArgs } from "./igx-page-requested-event-args"; import { GenericDataSourceSchemaPropertyType_$type } from "./GenericDataSourceSchemaPropertyType"; import { DataSourceSummaryOperand_$type } from "./DataSourceSummaryOperand"; import { IgxBaseGenericDataSource } from "./igx-base-generic-data-source"; import { GenericVirtualDataSource as GenericVirtualDataSource_internal } from "./GenericVirtualDataSource"; import { ensureEnum } from "./componentUtil"; var IgxGenericVirtualDataSource = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgxGenericVirtualDataSource, _super); function IgxGenericVirtualDataSource() { var _this = _super.call(this) || this; _this._pageRequested = null; return _this; } IgxGenericVirtualDataSource.prototype.createImplementation = function () { return new GenericVirtualDataSource_internal(); }; Object.defineProperty(IgxGenericVirtualDataSource.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); /** * Starts filling a page for the specified request. Must later be followed by FillPageEnd to complete the request. * @param requestId * The ID of the requested page. */ IgxGenericVirtualDataSource.prototype.fillPageStart = function (requestId) { this.i.a0(requestId); }; /** * Ends the current page. Must be called after FillPageStart. */ IgxGenericVirtualDataSource.prototype.fillPageEnd = function () { this.i.az(); }; /** * Provides the row count for the datasource. The datasource obtains this from the page request so be must be called * after FillPageStart. * @param count * The row count. */ IgxGenericVirtualDataSource.prototype.fillCount = function (count) { this.i.as(count); }; IgxGenericVirtualDataSource.prototype.fillColumnBool = function (column, values) { this.i.an(column, values); }; IgxGenericVirtualDataSource.prototype.fillColumnInt = function (column, values) { this.i.aq(column, values); }; IgxGenericVirtualDataSource.prototype.fillColumnDouble = function (column, values) { this.i.ap(column, values); }; IgxGenericVirtualDataSource.prototype.fillColumnString = function (column, values) { this.i.ar(column, values); }; IgxGenericVirtualDataSource.prototype.fillColumnDate = function (column, values) { this.i.ao(column, values); }; IgxGenericVirtualDataSource.prototype.addSchemaProperty = function (propertyName, propertyType) { this.i.ai(propertyName, ensureEnum(GenericDataSourceSchemaPropertyType_$type, propertyType)); }; IgxGenericVirtualDataSource.prototype.fillGroupStart = function (startIndex, endIndex) { this.i.au(startIndex, endIndex); }; /** * Ends the current group. */ IgxGenericVirtualDataSource.prototype.fillGroupEnd = function () { this.i.at(); }; IgxGenericVirtualDataSource.prototype.fillGroupValueInt = function (propertyName, value) { this.i.ax(propertyName, value); }; IgxGenericVirtualDataSource.prototype.fillGroupValueDouble = function (propertyName, value) { this.i.aw(propertyName, value); }; IgxGenericVirtualDataSource.prototype.fillGroupValueString = function (propertyName, value) { this.i.ay(propertyName, value); }; IgxGenericVirtualDataSource.prototype.fillGroupValueDate = function (propertyName, value) { this.i.av(propertyName, value); }; IgxGenericVirtualDataSource.prototype.addSummaryInt = function (propertyName, operand, value) { this.i.al(propertyName, ensureEnum(DataSourceSummaryOperand_$type, operand), value); }; IgxGenericVirtualDataSource.prototype.addSummaryDouble = function (propertyName, operand, value) { this.i.ak(propertyName, ensureEnum(DataSourceSummaryOperand_$type, operand), value); }; IgxGenericVirtualDataSource.prototype.addSummaryString = function (propertyName, operand, value) { this.i.am(propertyName, ensureEnum(DataSourceSummaryOperand_$type, operand), value); }; IgxGenericVirtualDataSource.prototype.addSummaryDate = function (propertyName, operand, value) { this.i.aj(propertyName, ensureEnum(DataSourceSummaryOperand_$type, operand), value); }; Object.defineProperty(IgxGenericVirtualDataSource.prototype, "pageRequested", { /** * Raised when the datasource requests page data. */ get: function () { var _this = this; if (this._pageRequested == null) { this._pageRequested = new EventEmitter(); this.i.pageRequested = delegateCombine(this.i.pageRequested, function (o, e) { var outerArgs = new IgxPageRequestedEventArgs(); outerArgs._provideImplementation(e); if (_this.beforePageRequested) { _this.beforePageRequested(_this, outerArgs); } _this._pageRequested.emit({ sender: _this, args: outerArgs }); }); } return this._pageRequested; }, enumerable: false, configurable: true }); return IgxGenericVirtualDataSource; }(IgxBaseGenericDataSource)); export { IgxGenericVirtualDataSource };