UNPKG

igniteui-react-core

Version:
140 lines (135 loc) 6.07 kB
import { __extends } from "tslib"; 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"; var IgrGenericVirtualDataSource = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgrGenericVirtualDataSource, _super); function IgrGenericVirtualDataSource() { var _this = _super.call(this) || this; _this._pageRequested = null; _this._pageRequested_wrapped = null; return _this; } IgrGenericVirtualDataSource.prototype.createImplementation = function () { return new GenericVirtualDataSource_internal(); }; Object.defineProperty(IgrGenericVirtualDataSource.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. */ IgrGenericVirtualDataSource.prototype.fillPageStart = function (requestId) { this.i.a0(requestId); }; /** * Ends the current page. Must be called after FillPageStart. */ IgrGenericVirtualDataSource.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. */ IgrGenericVirtualDataSource.prototype.fillCount = function (count) { this.i.as(count); }; IgrGenericVirtualDataSource.prototype.fillColumnBool = function (column, values) { this.i.an(column, values); }; IgrGenericVirtualDataSource.prototype.fillColumnInt = function (column, values) { this.i.aq(column, values); }; IgrGenericVirtualDataSource.prototype.fillColumnDouble = function (column, values) { this.i.ap(column, values); }; IgrGenericVirtualDataSource.prototype.fillColumnString = function (column, values) { this.i.ar(column, values); }; IgrGenericVirtualDataSource.prototype.fillColumnDate = function (column, values) { this.i.ao(column, values); }; IgrGenericVirtualDataSource.prototype.addSchemaProperty = function (propertyName, propertyType) { this.i.ai(propertyName, ensureEnum(GenericDataSourceSchemaPropertyType_$type, propertyType)); }; IgrGenericVirtualDataSource.prototype.fillGroupStart = function (startIndex, endIndex) { this.i.au(startIndex, endIndex); }; /** * Ends the current group. */ IgrGenericVirtualDataSource.prototype.fillGroupEnd = function () { this.i.at(); }; IgrGenericVirtualDataSource.prototype.fillGroupValueInt = function (propertyName, value) { this.i.ax(propertyName, value); }; IgrGenericVirtualDataSource.prototype.fillGroupValueDouble = function (propertyName, value) { this.i.aw(propertyName, value); }; IgrGenericVirtualDataSource.prototype.fillGroupValueString = function (propertyName, value) { this.i.ay(propertyName, value); }; IgrGenericVirtualDataSource.prototype.fillGroupValueDate = function (propertyName, value) { this.i.av(propertyName, value); }; IgrGenericVirtualDataSource.prototype.addSummaryInt = function (propertyName, operand, value) { this.i.al(propertyName, ensureEnum(DataSourceSummaryOperand_$type, operand), value); }; IgrGenericVirtualDataSource.prototype.addSummaryDouble = function (propertyName, operand, value) { this.i.ak(propertyName, ensureEnum(DataSourceSummaryOperand_$type, operand), value); }; IgrGenericVirtualDataSource.prototype.addSummaryString = function (propertyName, operand, value) { this.i.am(propertyName, ensureEnum(DataSourceSummaryOperand_$type, operand), value); }; IgrGenericVirtualDataSource.prototype.addSummaryDate = function (propertyName, operand, value) { this.i.aj(propertyName, ensureEnum(DataSourceSummaryOperand_$type, operand), value); }; Object.defineProperty(IgrGenericVirtualDataSource.prototype, "pageRequested", { /** * Raised when the datasource requests page data. */ get: function () { return this._pageRequested; }, set: function (ev) { var _this = this; 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 = function (o, e) { var 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); ; }, enumerable: false, configurable: true }); return IgrGenericVirtualDataSource; }(IgrBaseGenericDataSource)); export { IgrGenericVirtualDataSource };