UNPKG

igniteui-react-core

Version:
126 lines (121 loc) 4.31 kB
import { delegateCombine, delegateRemove } from './type'; import { IgrPageRequestedEventArgs } from "./igr-page-requested-event-args"; import { GenericDataSourceSchemaPropertyType_$type } from "./GenericDataSourceSchemaPropertyType"; import { DataSourceSummaryOperand_$type } from "./DataSourceSummaryOperand"; import { IgrBaseGenericDataSource } from "./igr-base-generic-data-source"; import { GenericVirtualDataSource as GenericVirtualDataSource_internal } from "./GenericVirtualDataSource"; import { ensureEnum } from "./componentUtil"; export class IgrGenericVirtualDataSource extends IgrBaseGenericDataSource { createImplementation() { return new GenericVirtualDataSource_internal(); } /** * @hidden */ get i() { return this._implementation; } constructor() { super(); this._pageRequested = null; this._pageRequested_wrapped = null; } /** * 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. */ fillPageStart(requestId) { this.i.a0(requestId); } /** * Ends the current page. Must be called after FillPageStart. */ fillPageEnd() { 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. */ fillCount(count) { this.i.as(count); } fillColumnBool(column, values) { this.i.an(column, values); } fillColumnInt(column, values) { this.i.aq(column, values); } fillColumnDouble(column, values) { this.i.ap(column, values); } fillColumnString(column, values) { this.i.ar(column, values); } fillColumnDate(column, values) { this.i.ao(column, values); } addSchemaProperty(propertyName, propertyType) { this.i.ai(propertyName, ensureEnum(GenericDataSourceSchemaPropertyType_$type, propertyType)); } fillGroupStart(startIndex, endIndex) { this.i.au(startIndex, endIndex); } /** * Ends the current group. */ fillGroupEnd() { this.i.at(); } fillGroupValueInt(propertyName, value) { this.i.ax(propertyName, value); } fillGroupValueDouble(propertyName, value) { this.i.aw(propertyName, value); } fillGroupValueString(propertyName, value) { this.i.ay(propertyName, value); } fillGroupValueDate(propertyName, value) { this.i.av(propertyName, value); } addSummaryInt(propertyName, operand, value) { this.i.al(propertyName, ensureEnum(DataSourceSummaryOperand_$type, operand), value); } addSummaryDouble(propertyName, operand, value) { this.i.ak(propertyName, ensureEnum(DataSourceSummaryOperand_$type, operand), value); } addSummaryString(propertyName, operand, value) { this.i.am(propertyName, ensureEnum(DataSourceSummaryOperand_$type, operand), value); } addSummaryDate(propertyName, operand, value) { this.i.aj(propertyName, ensureEnum(DataSourceSummaryOperand_$type, operand), value); } /** * Raised when the datasource requests page data. */ get pageRequested() { return this._pageRequested; } set pageRequested(ev) { if (this._pageRequested_wrapped !== null) { this.i.pageRequested = delegateRemove(this.i.pageRequested, this._pageRequested_wrapped); this._pageRequested_wrapped = null; this._pageRequested = null; } this._pageRequested = ev; this._pageRequested_wrapped = (o, e) => { let outerArgs = new IgrPageRequestedEventArgs(); outerArgs._provideImplementation(e); if (this.beforePageRequested) { this.beforePageRequested(this, outerArgs); } if (this._pageRequested) { this._pageRequested(this, outerArgs); } }; this.i.pageRequested = delegateCombine(this.i.pageRequested, this._pageRequested_wrapped); ; } }