UNPKG

igniteui-webcomponents-datasources

Version:

Reference custom data providers for the Ignite UI Web Components data source.

170 lines (169 loc) 7.42 kB
import { __extends } from "tslib"; import { VirtualDataSource } from "igniteui-webcomponents-core"; import { ODataVirtualDataSourceDataProvider } from "./ODataVirtualDataSourceDataProvider"; import { typeCast } from "igniteui-webcomponents-core"; var ODataVirtualDataSource = /** @class */ /*@__PURE__*/ (function (_super) { __extends(ODataVirtualDataSource, _super); function ODataVirtualDataSource() { var _this = _super.call(this) || this; _this._baseUri = null; _this._entitySet = null; _this._timeoutMilliseconds = 10000; _this._isAggregationSupportedByServer = false; _this._enableJsonp = true; _this.dataProvider = ((function () { var $ret = new ODataVirtualDataSourceDataProvider(); $ret.executionContext = _this.executionContext; $ret.enableJsonp = _this.enableJsonp; $ret.isAggregationSupported = _this.isGroupingSupported; return $ret; })()); _this.externalDataSource = _this; return _this; } ODataVirtualDataSource.prototype.onBaseUriChanged = function (oldValue, newValue) { if (typeCast(ODataVirtualDataSourceDataProvider.$type, this.actualDataProvider) !== null) { this.actualDataProvider.baseUri = this.baseUri; } this.queueAutoRefresh(); }; Object.defineProperty(ODataVirtualDataSource.prototype, "baseUri", { get: function () { return this._baseUri; }, set: function (value) { var oldValue = this._baseUri; this._baseUri = value; if (oldValue != this._baseUri) { this.onBaseUriChanged(oldValue, this._baseUri); } }, enumerable: false, configurable: true }); ODataVirtualDataSource.prototype.onEntitySetChanged = function (oldValue, newValue) { if (typeCast(ODataVirtualDataSourceDataProvider.$type, this.actualDataProvider) !== null) { this.actualDataProvider.entitySet = this.entitySet; } this.queueAutoRefresh(); }; Object.defineProperty(ODataVirtualDataSource.prototype, "entitySet", { get: function () { return this._entitySet; }, set: function (value) { var oldValue = this._entitySet; this._entitySet = value; if (this._entitySet != oldValue) { this.onEntitySetChanged(oldValue, this._entitySet); } }, enumerable: false, configurable: true }); ODataVirtualDataSource.prototype.onTimeoutMillisecondsChanged = function (oldValue, newValue) { if (typeCast(ODataVirtualDataSourceDataProvider.$type, this.actualDataProvider) !== null) { this.actualDataProvider.timeoutMilliseconds = this.timeoutMilliseconds; } }; Object.defineProperty(ODataVirtualDataSource.prototype, "timeoutMilliseconds", { get: function () { return this._timeoutMilliseconds; }, set: function (value) { var oldValue = this._timeoutMilliseconds; this._timeoutMilliseconds = value; if (oldValue != this._timeoutMilliseconds) { this.onTimeoutMillisecondsChanged(oldValue, this._timeoutMilliseconds); } }, enumerable: false, configurable: true }); Object.defineProperty(ODataVirtualDataSource.prototype, "isSortingSupportedOverride", { get: function () { return true; }, enumerable: false, configurable: true }); Object.defineProperty(ODataVirtualDataSource.prototype, "isFilteringSupportedOverride", { get: function () { return true; }, enumerable: false, configurable: true }); Object.defineProperty(ODataVirtualDataSource.prototype, "isGroupingSupportedOverride", { get: function () { return this.isAggregationSupportedByServer; }, enumerable: false, configurable: true }); Object.defineProperty(ODataVirtualDataSource.prototype, "isAggregationSupportedByServer", { get: function () { return this._isAggregationSupportedByServer; }, set: function (isSupported) { this._isAggregationSupportedByServer = isSupported; if (typeCast(ODataVirtualDataSourceDataProvider.$type, this.actualDataProvider) !== null) { this.actualDataProvider.isAggregationSupported = isSupported; } }, enumerable: false, configurable: true }); Object.defineProperty(ODataVirtualDataSource.prototype, "enableJsonp", { get: function () { return this._enableJsonp; }, set: function (isEnabled) { this._enableJsonp = isEnabled; if (typeCast(ODataVirtualDataSourceDataProvider.$type, this.actualDataProvider) !== null) { this.actualDataProvider.enableJsonp = isEnabled; } }, enumerable: false, configurable: true }); ODataVirtualDataSource.prototype.clone = function () { var dataSource = new ODataVirtualDataSource(); dataSource.executionContext = this.executionContext; dataSource.includeSummaryRowsInSection = this.includeSummaryRowsInSection; dataSource.isSectionCollapsable = this.isSectionCollapsable; dataSource.isSectionExpandedDefault = this.isSectionExpandedDefault; //dataSource.isSectionHeaderNormalRow = this.isSectionHeaderNormalRow; dataSource.isSectionSummaryRowsAtBottom = this.isSectionSummaryRowsAtBottom; //dataSource.isSectionContentVisible = this.isSectionContentVisible; dataSource.primaryKey = this.primaryKey; dataSource.propertiesRequested = this.propertiesRequested; dataSource.sectionHeaderDisplayMode = this.sectionHeaderDisplayMode; dataSource.shouldEmitSectionFooters = this.shouldEmitSectionFooters; dataSource.shouldEmitSectionHeaders = this.shouldEmitSectionHeaders; dataSource.shouldEmitShiftedRows = this.shouldEmitShiftedRows; dataSource.summaryScope = this.summaryScope; for (var i = 0; i < this.groupDescriptions.size(); i++) { dataSource.groupDescriptions.add(this.groupDescriptions.get(i)); } for (var i = 0; i < this.sortDescriptions.size(); i++) { dataSource.sortDescriptions.add(this.sortDescriptions.get(i)); } for (var i = 0; i < this.filterExpressions.size(); i++) { dataSource.filterExpressions.add(this.filterExpressions.get(i)); } for (var i = 0; i < this.summaryDescriptions.size(); i++) { dataSource.summaryDescriptions.add(this.summaryDescriptions.get(i)); } dataSource.pageSizeRequested = this.pageSizeRequested; dataSource.maxCachedPages = this.maxCachedPages; dataSource.baseUri = this.baseUri; dataSource.entitySet = this.entitySet; dataSource.timeoutMilliseconds = this.timeoutMilliseconds; dataSource.isAggregationSupportedByServer = this.isAggregationSupportedByServer; dataSource.enableJsonp = this.enableJsonp; return dataSource; }; return ODataVirtualDataSource; }(VirtualDataSource)); export { ODataVirtualDataSource };