igniteui-webcomponents-datasources
Version:
Reference custom data providers for the Ignite UI Web Components data source.
358 lines (357 loc) • 14.3 kB
JavaScript
import { __extends } from "tslib";
import { VirtualDataSource } from "igniteui-webcomponents-core";
import { RestVirtualDataSourceDataProvider } from "./RestVirtualDataSourceDataProvider";
var RestVirtualDataSource = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(RestVirtualDataSource, _super);
function RestVirtualDataSource() {
var _this = _super.call(this) || this;
_this._baseUri = null;
_this._isFilteringSupportedByServer = false;
_this._entitySet = null;
_this._timeoutMilliseconds = 10000;
_this._isAggregationSupportedByServer = false;
_this._enableJsonp = true;
_this._fixedFullCount = -1;
_this._provideFullCount = null;
_this._provideOrderByParameter = null;
_this._provideFilterParameter = null;
_this._provideAggregationParameter = null;
_this._provideAggregatedCount = null;
_this._provideUri = null;
_this._performFetch = null;
_this._providePagingParameter = null;
_this._provideDesiredPropertiesParameter = null;
_this.dataProvider = ((function () {
var $ret = new RestVirtualDataSourceDataProvider();
$ret.executionContext = _this.executionContext;
$ret.enableJsonp = _this.enableJsonp;
$ret.isAggregationSupported = _this.isGroupingSupported;
return $ret;
})());
_this.externalDataSource = _this;
return _this;
}
RestVirtualDataSource.prototype.onBaseUriChanged = function (oldValue, newValue) {
if (this.actualDataProvider) {
this.actualDataProvider.baseUri = this.baseUri;
this.queueAutoRefresh();
}
};
Object.defineProperty(RestVirtualDataSource.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
});
RestVirtualDataSource.prototype.onEntitySetChanged = function (oldValue, newValue) {
if (this.actualDataProvider) {
this.actualDataProvider.entitySet = this.entitySet;
this.queueAutoRefresh();
}
this.queueAutoRefresh();
};
Object.defineProperty(RestVirtualDataSource.prototype, "isFilteringSupportedByServer", {
get: function () {
return this._isFilteringSupportedByServer;
},
set: function (v) {
this._isFilteringSupportedByServer = v;
},
enumerable: false,
configurable: true
});
RestVirtualDataSource.prototype.get_isFilteringSupported = function () {
if (this._isFilteringSupportedByServer) {
return true;
}
return false;
};
Object.defineProperty(RestVirtualDataSource.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
});
RestVirtualDataSource.prototype.onTimeoutMillisecondsChanged = function (oldValue, newValue) {
if (this.actualDataProvider) {
this.actualDataProvider.timeoutMilliseconds = this.timeoutMilliseconds;
}
};
Object.defineProperty(RestVirtualDataSource.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(RestVirtualDataSource.prototype, "isSortingSupportedOverride", {
get: function () {
return true;
},
enumerable: false,
configurable: true
});
Object.defineProperty(RestVirtualDataSource.prototype, "isFilteringSupportedOverride", {
get: function () {
return true;
},
enumerable: false,
configurable: true
});
Object.defineProperty(RestVirtualDataSource.prototype, "isGroupingSupportedOverride", {
get: function () {
return this.isAggregationSupportedByServer;
},
enumerable: false,
configurable: true
});
Object.defineProperty(RestVirtualDataSource.prototype, "isAggregationSupportedByServer", {
get: function () {
return this._isAggregationSupportedByServer;
},
set: function (isSupported) {
this._isAggregationSupportedByServer = isSupported;
if (this.actualDataProvider) {
this.actualDataProvider.isAggregationSupported = this.isAggregationSupportedByServer;
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(RestVirtualDataSource.prototype, "enableJsonp", {
get: function () {
return this._enableJsonp;
},
set: function (isEnabled) {
this._enableJsonp = isEnabled;
if (this.actualDataProvider) {
this.actualDataProvider.enableJsonp = this.enableJsonp;
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(RestVirtualDataSource.prototype, "fixedFullCount", {
get: function () {
return this._fixedFullCount;
},
set: function (value) {
this._fixedFullCount = value;
},
enumerable: false,
configurable: true
});
Object.defineProperty(RestVirtualDataSource.prototype, "provideFullCount", {
get: function () {
return this._provideFullCount;
},
set: function (value) {
this._provideFullCount = value;
if (this.actualDataProvider) {
this.actualDataProvider.provideFullCount = this.provideFullCount;
this.queueAutoRefresh();
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(RestVirtualDataSource.prototype, "provideOrderByParameter", {
get: function () {
return this._provideOrderByParameter;
},
set: function (value) {
this._provideOrderByParameter = value;
if (this.actualDataProvider) {
this.actualDataProvider.provideOrderByParameter = this.provideOrderByParameter;
this.queueAutoRefresh();
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(RestVirtualDataSource.prototype, "provideFilterParameter", {
get: function () {
return this._provideFilterParameter;
},
set: function (value) {
this._provideFilterParameter = value;
if (this.actualDataProvider) {
this.actualDataProvider.provideFilterParameter = this.provideFilterParameter;
this.queueAutoRefresh();
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(RestVirtualDataSource.prototype, "provideAggregationParameter", {
get: function () {
return this._provideAggregationParameter;
},
set: function (value) {
this._provideAggregationParameter = value;
if (this.actualDataProvider) {
this.actualDataProvider.provideAggregationParameter = this.provideAggregationParameter;
this.queueAutoRefresh();
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(RestVirtualDataSource.prototype, "provideAggregatedCount", {
get: function () {
return this._provideAggregatedCount;
},
set: function (value) {
this._provideAggregatedCount = value;
if (this.actualDataProvider) {
this.actualDataProvider.provideAggregatedCount = this.provideAggregatedCount;
this.queueAutoRefresh();
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(RestVirtualDataSource.prototype, "provideUri", {
get: function () {
return this._provideUri;
},
set: function (value) {
this._provideUri = value;
if (this.actualDataProvider) {
this.actualDataProvider.provideUri = this.provideUri;
this.queueAutoRefresh();
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(RestVirtualDataSource.prototype, "performFetch", {
get: function () {
return this._performFetch;
},
set: function (value) {
this._performFetch = value;
if (this.actualDataProvider) {
this.actualDataProvider.performFetch = this.performFetch;
this.queueAutoRefresh();
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(RestVirtualDataSource.prototype, "providePagingParameter", {
get: function () {
return this._providePagingParameter;
},
set: function (value) {
this._providePagingParameter = value;
if (this.actualDataProvider) {
this.actualDataProvider.providePagingParameter = this.providePagingParameter;
this.queueAutoRefresh();
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(RestVirtualDataSource.prototype, "provideDesiredPropertiesParameter", {
get: function () {
return this._provideDesiredPropertiesParameter;
},
set: function (value) {
this._provideDesiredPropertiesParameter = value;
if (this.actualDataProvider) {
this.actualDataProvider.provideDesiredPropertiesParameter = this.provideDesiredPropertiesParameter;
this.queueAutoRefresh();
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(RestVirtualDataSource.prototype, "provideItems", {
get: function () {
return this._provideItems;
},
set: function (value) {
this._provideItems = value;
if (this.actualDataProvider) {
this.actualDataProvider.provideItems = this.provideItems;
this.queueAutoRefresh();
}
},
enumerable: false,
configurable: true
});
RestVirtualDataSource.prototype.clone = function () {
var dataSource = new RestVirtualDataSource();
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;
dataSource.fixedFullCount = this.fixedFullCount;
dataSource.provideAggregationParameter = this.provideAggregationParameter;
dataSource.provideAggregatedCount = this.provideAggregatedCount;
dataSource.provideFilterParameter = this.provideFilterParameter;
dataSource.provideFullCount = this.provideFullCount;
dataSource.provideOrderByParameter = this.provideOrderByParameter;
dataSource.provideUri = this.provideUri;
dataSource.performFetch = this.performFetch;
dataSource.providePagingParameter = this.providePagingParameter;
dataSource.provideItems = this.provideItems;
dataSource.provideDesiredPropertiesParameter = this.provideDesiredPropertiesParameter;
return dataSource;
};
return RestVirtualDataSource;
}(VirtualDataSource));
export { RestVirtualDataSource };