igniteui-webcomponents-datasources 1.4.1 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/bundles/igniteui-webcomponents-datasources.umd.js +2279 -1
  2. package/bundles/igniteui-webcomponents-datasources.umd.min.js +7 -2
  3. package/esm2015/igniteui-webcomponents-datasources.js +0 -1
  4. package/esm2015/lib/Entity.js +0 -1
  5. package/esm2015/lib/EntityProperty.js +0 -1
  6. package/esm2015/lib/EntitySet.js +0 -1
  7. package/esm2015/lib/ODataDataSourcePage.js +0 -1
  8. package/esm2015/lib/ODataSchemaProvider.js +0 -1
  9. package/esm2015/lib/ODataVirtualDataSource.js +0 -1
  10. package/esm2015/lib/ODataVirtualDataSourceDataProvider.js +0 -1
  11. package/esm2015/lib/ODataVirtualDataSourceDataProviderWorker.js +0 -1
  12. package/esm2015/lib/ODataVirtualDataSourceDataProviderWorkerSettings.js +0 -1
  13. package/esm2015/lib/ODataVirtualDataSourceProviderTaskDataHolder.js +0 -1
  14. package/esm2015/lib/RestVirtualDataSource.js +272 -0
  15. package/esm2015/lib/RestVirtualDataSourceDataProvider.js +528 -0
  16. package/esm2015/lib/RestVirtualDataSourceDataProviderWorker.js +744 -0
  17. package/esm2015/lib/RestVirtualDataSourceDataProviderWorkerSettings.js +154 -0
  18. package/esm2015/lib/RestVirtualDataSourcePage.js +67 -0
  19. package/esm2015/lib/RestVirtualDataSourceProviderTaskDataHolder.js +8 -0
  20. package/esm2015/lib/Schema.js +0 -1
  21. package/esm2015/lib/util.js +0 -1
  22. package/esm2015/public_api.js +6 -1
  23. package/esm5/igniteui-webcomponents-datasources.js +0 -1
  24. package/esm5/lib/Entity.js +0 -1
  25. package/esm5/lib/EntityProperty.js +0 -1
  26. package/esm5/lib/EntitySet.js +0 -1
  27. package/esm5/lib/ODataDataSourcePage.js +0 -1
  28. package/esm5/lib/ODataSchemaProvider.js +0 -1
  29. package/esm5/lib/ODataVirtualDataSource.js +0 -1
  30. package/esm5/lib/ODataVirtualDataSourceDataProvider.js +0 -1
  31. package/esm5/lib/ODataVirtualDataSourceDataProviderWorker.js +0 -1
  32. package/esm5/lib/ODataVirtualDataSourceDataProviderWorkerSettings.js +0 -1
  33. package/esm5/lib/ODataVirtualDataSourceProviderTaskDataHolder.js +0 -1
  34. package/esm5/lib/RestVirtualDataSource.js +357 -0
  35. package/esm5/lib/RestVirtualDataSourceDataProvider.js +675 -0
  36. package/esm5/lib/RestVirtualDataSourceDataProviderWorker.js +948 -0
  37. package/esm5/lib/RestVirtualDataSourceDataProviderWorkerSettings.js +240 -0
  38. package/esm5/lib/RestVirtualDataSourcePage.js +73 -0
  39. package/esm5/lib/RestVirtualDataSourceProviderTaskDataHolder.js +12 -0
  40. package/esm5/lib/Schema.js +0 -1
  41. package/esm5/lib/util.js +0 -1
  42. package/esm5/public_api.js +6 -1
  43. package/fesm2015/igniteui-webcomponents-datasources.js +1754 -3
  44. package/fesm5/igniteui-webcomponents-datasources.js +2275 -3
  45. package/lib/RestVirtualDataSource.d.ts +60 -0
  46. package/lib/RestVirtualDataSourceDataProvider.d.ts +135 -0
  47. package/lib/RestVirtualDataSourceDataProviderWorker.d.ts +69 -0
  48. package/lib/RestVirtualDataSourceDataProviderWorkerSettings.d.ts +60 -0
  49. package/lib/RestVirtualDataSourcePage.d.ts +19 -0
  50. package/lib/RestVirtualDataSourceProviderTaskDataHolder.d.ts +5 -0
  51. package/package.json +3 -3
  52. package/public_api.d.ts +6 -0
  53. package/bundles/igniteui-webcomponents-datasources.umd.js.map +0 -1
  54. package/bundles/igniteui-webcomponents-datasources.umd.min.js.map +0 -1
  55. package/esm2015/igniteui-webcomponents-datasources.js.map +0 -1
  56. package/esm2015/lib/Entity.js.map +0 -1
  57. package/esm2015/lib/EntityProperty.js.map +0 -1
  58. package/esm2015/lib/EntitySet.js.map +0 -1
  59. package/esm2015/lib/ODataDataSourcePage.js.map +0 -1
  60. package/esm2015/lib/ODataSchemaProvider.js.map +0 -1
  61. package/esm2015/lib/ODataVirtualDataSource.js.map +0 -1
  62. package/esm2015/lib/ODataVirtualDataSourceDataProvider.js.map +0 -1
  63. package/esm2015/lib/ODataVirtualDataSourceDataProviderWorker.js.map +0 -1
  64. package/esm2015/lib/ODataVirtualDataSourceDataProviderWorkerSettings.js.map +0 -1
  65. package/esm2015/lib/ODataVirtualDataSourceProviderTaskDataHolder.js.map +0 -1
  66. package/esm2015/lib/Schema.js.map +0 -1
  67. package/esm2015/lib/util.js.map +0 -1
  68. package/esm2015/public_api.js.map +0 -1
  69. package/esm5/igniteui-webcomponents-datasources.js.map +0 -1
  70. package/esm5/lib/Entity.js.map +0 -1
  71. package/esm5/lib/EntityProperty.js.map +0 -1
  72. package/esm5/lib/EntitySet.js.map +0 -1
  73. package/esm5/lib/ODataDataSourcePage.js.map +0 -1
  74. package/esm5/lib/ODataSchemaProvider.js.map +0 -1
  75. package/esm5/lib/ODataVirtualDataSource.js.map +0 -1
  76. package/esm5/lib/ODataVirtualDataSourceDataProvider.js.map +0 -1
  77. package/esm5/lib/ODataVirtualDataSourceDataProviderWorker.js.map +0 -1
  78. package/esm5/lib/ODataVirtualDataSourceDataProviderWorkerSettings.js.map +0 -1
  79. package/esm5/lib/ODataVirtualDataSourceProviderTaskDataHolder.js.map +0 -1
  80. package/esm5/lib/Schema.js.map +0 -1
  81. package/esm5/lib/util.js.map +0 -1
  82. package/esm5/public_api.js.map +0 -1
  83. package/fesm2015/igniteui-webcomponents-datasources.js.map +0 -1
  84. package/fesm5/igniteui-webcomponents-datasources.js.map +0 -1
@@ -1,4 +1,11 @@
1
- import { fromEnum, XName, DataSourceSchemaPropertyType, XDocument, XmlNodeType, typeCast, XElement, ODataDataSourceSchema, XNamespace, AsyncVirtualDataSourceProviderTaskDataHolder, markType, AsyncVirtualDataSourceProviderWorker, SortDescriptionCollection, ListSortDirection, DataSourceSummaryScope, stringIsNullOrEmpty, Convert, DefaultSectionInformation, SummaryOperand, DefaultSummaryResult, AsyncVirtualDataTask, AsyncDataSourcePageTaskHolder, ODataDataSourceFilterExpressionVisitor, TransactionType, AsyncVirtualDataSourceDataProviderWorkerSettings, Base, FilterExpressionCollection, SummaryDescriptionCollection, DataSourcePageRequestPriority, runOn, DataSourceDataProviderSchemaChangedEventArgs, stringContains, IDataSourceVirtualDataProvider_$type, VirtualDataSource } from 'igniteui-webcomponents-core';
1
+ /*!
2
+ THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE:
3
+ https://www.infragistics.com/legal/license/igultimate-la
4
+ https://www.infragistics.com/legal/license/igultimate-eula
5
+ GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
6
+ */
7
+
8
+ import { fromEnum, XName, DataSourceSchemaPropertyType, XDocument, XmlNodeType, typeCast, XElement, ODataDataSourceSchema, XNamespace, AsyncVirtualDataSourceProviderTaskDataHolder, markType, AsyncVirtualDataSourceProviderWorker, SortDescriptionCollection, ListSortDirection, DataSourceSummaryScope, stringIsNullOrEmpty, Convert, DefaultSectionInformation, SummaryOperand, DefaultSummaryResult, AsyncVirtualDataTask, AsyncDataSourcePageTaskHolder, ODataDataSourceFilterExpressionVisitor, TransactionType, AsyncVirtualDataSourceDataProviderWorkerSettings, Base, FilterExpressionCollection, SummaryDescriptionCollection, DataSourcePageRequestPriority, runOn, DataSourceDataProviderSchemaChangedEventArgs, stringContains, IDataSourceVirtualDataProvider_$type, VirtualDataSource, LocalDataSource } from 'igniteui-webcomponents-core';
2
9
 
3
10
  class EntityProperty {
4
11
  constructor(name, schemaType) {
@@ -1813,5 +1820,1749 @@ class ODataVirtualDataSource extends VirtualDataSource {
1813
1820
  }
1814
1821
  }
1815
1822
 
1816
- export { Entity, EntityProperty, EntitySet, LinkedList, LinkedListNode, ODataDataSourcePage, ODataSchemaProvider, ODataVirtualDataSource, ODataVirtualDataSourceDataProvider, ODataVirtualDataSourceDataProviderWorker, ODataVirtualDataSourceDataProviderWorkerSettings, ODataVirtualDataSourceProviderTaskDataHolder, Schema, first, toArray };
1817
- //# sourceMappingURL=igniteui-webcomponents-datasources.js.map
1823
+ let RestVirtualDataSourceProviderTaskDataHolder = /*@__PURE__*/ (() => {
1824
+ class RestVirtualDataSourceProviderTaskDataHolder extends AsyncVirtualDataSourceProviderTaskDataHolder {
1825
+ }
1826
+ RestVirtualDataSourceProviderTaskDataHolder.$t = /*@__PURE__*/ markType(RestVirtualDataSourceProviderTaskDataHolder, 'ODataVirtualDataSourceProviderTaskDataHolder', AsyncVirtualDataSourceProviderTaskDataHolder.$type);
1827
+ return RestVirtualDataSourceProviderTaskDataHolder;
1828
+ })();
1829
+
1830
+ class RestVirtualDataSourcePage {
1831
+ constructor(sourceData_, schema, groupInformation, summaryInformation, pageIndex) {
1832
+ this._actualData = null;
1833
+ this._schema = null;
1834
+ this._pageIndex = 0;
1835
+ this._groupInformation = null;
1836
+ this._summaryInformation = null;
1837
+ if (sourceData_ == null) {
1838
+ this._actualData = null;
1839
+ }
1840
+ else {
1841
+ let count = (sourceData_.items.length);
1842
+ this._actualData = [];
1843
+ let dateProps = new Set();
1844
+ for (let i = 0; i < schema.propertyNames.length; i++) {
1845
+ if (schema.propertyTypes[i] == DataSourceSchemaPropertyType.DateTimeValue || schema.propertyTypes[i] == DataSourceSchemaPropertyType.DateTimeOffsetValue) {
1846
+ dateProps.add(schema.propertyNames[i]);
1847
+ }
1848
+ }
1849
+ let value_;
1850
+ for (let i_ = 0; i_ < count; i_++) {
1851
+ let currItem_ = sourceData_.items[i_];
1852
+ let dict = new Map();
1853
+ let properties = Array.from(Object.keys(currItem_));
1854
+ let values = (properties.map((k) => currItem_[k]));
1855
+ for (let i1 = 0; i1 < properties.length; i1++) {
1856
+ value_ = values[i1];
1857
+ if (dateProps.has(properties[i1])) {
1858
+ value_ = new Date(value_);
1859
+ }
1860
+ dict.set(properties[i1], value_);
1861
+ }
1862
+ this._actualData[i_] = dict;
1863
+ }
1864
+ }
1865
+ this._schema = schema;
1866
+ this._groupInformation = groupInformation;
1867
+ this._summaryInformation = summaryInformation;
1868
+ this._pageIndex = pageIndex;
1869
+ }
1870
+ count() {
1871
+ return this._actualData.length;
1872
+ }
1873
+ getItemAtIndex(index) {
1874
+ return this._actualData[index];
1875
+ }
1876
+ getItemValueAtIndex(index, valueName) {
1877
+ let item = this._actualData[index];
1878
+ if (!item.has(valueName)) {
1879
+ return null;
1880
+ }
1881
+ return item.get(valueName);
1882
+ }
1883
+ pageIndex() {
1884
+ return this._pageIndex;
1885
+ }
1886
+ schema() {
1887
+ return this._schema;
1888
+ }
1889
+ getGroupInformation() {
1890
+ return this._groupInformation;
1891
+ }
1892
+ getSummaryInformation() {
1893
+ return this._summaryInformation;
1894
+ }
1895
+ }
1896
+
1897
+ let RestVirtualDataSourceDataProviderWorker = /*@__PURE__*/ (() => {
1898
+ class RestVirtualDataSourceDataProviderWorker extends AsyncVirtualDataSourceProviderWorker {
1899
+ constructor(settings) {
1900
+ super(settings);
1901
+ this._baseUri = null;
1902
+ this._entitySet = null;
1903
+ this._sortDescriptions = null;
1904
+ this._groupDescriptions = null;
1905
+ this._filterExpressions = null;
1906
+ this._summaryDescriptions = null;
1907
+ this._desiredPropeties = null;
1908
+ this._enableJsonp = true;
1909
+ this._isAggregationSupported = false;
1910
+ this._provideFullCount = null;
1911
+ this._provideOrderByParameter = null;
1912
+ this._provideFilterParameter = null;
1913
+ this._provideAggregationParameter = null;
1914
+ this._provideAggregatedCount = null;
1915
+ this._providePagingParameter = null;
1916
+ this._provideDesiredPropertiesParameter = null;
1917
+ this._provideUri = null;
1918
+ this._performFetch = null;
1919
+ this._fixedFullCount = -1;
1920
+ this._groupInformation = null;
1921
+ this._summaryInformation = null;
1922
+ this._filterString = null;
1923
+ this._selectedString = null;
1924
+ this.doWork = this.doWork.bind(this);
1925
+ this._baseUri = settings.baseUri;
1926
+ this._entitySet = settings.entitySet;
1927
+ this._sortDescriptions = settings.sortDescriptions;
1928
+ this._groupDescriptions = settings.groupDescriptions;
1929
+ if (this._groupDescriptions != null && this._groupDescriptions.size() > 0) {
1930
+ this._sortDescriptions = new SortDescriptionCollection();
1931
+ for (let sd of this.iter(settings.sortDescriptions)) {
1932
+ this._sortDescriptions.add(sd);
1933
+ }
1934
+ for (let i = 0; i < this._groupDescriptions.size(); i++) {
1935
+ this._sortDescriptions.insert(i, this._groupDescriptions.get(i));
1936
+ }
1937
+ }
1938
+ this._filterExpressions = settings.filterExpressions;
1939
+ this._desiredPropeties = settings.propertiesRequested;
1940
+ this._summaryDescriptions = settings.summaryDescriptions;
1941
+ this._fixedFullCount = settings.fixedFullCount;
1942
+ this._summaryScope = settings.summaryScope;
1943
+ this._enableJsonp = settings.enableJsonp;
1944
+ this._provideFullCount = settings.provideFullCount;
1945
+ this._performFetch = settings.performFetch;
1946
+ this._provideAggregationParameter = settings.provideAggregationParameter;
1947
+ this._provideFilterParameter = settings.provideFilterParameter;
1948
+ this._provideOrderByParameter = settings.provideOrderByParameter;
1949
+ this._provideUri = settings.provideUri;
1950
+ this._providePagingParameter = settings.providePagingParameter;
1951
+ this._provideDesiredPropertiesParameter = settings.provideDesiredPropertiesParameter;
1952
+ this._provideItems = settings.provideItems;
1953
+ this._provideAggregatedCount = settings.provideAggregatedCount;
1954
+ if (!this._provideItems) {
1955
+ this._provideItems = (res) => {
1956
+ return res ? res.items : null;
1957
+ };
1958
+ }
1959
+ if (!this._provideFullCount) {
1960
+ this._provideFullCount = (p) => {
1961
+ if (p.fullCount) {
1962
+ return p.fullCount;
1963
+ }
1964
+ else {
1965
+ return this._fixedFullCount >= 0 ? this._fixedFullCount : 0;
1966
+ }
1967
+ };
1968
+ }
1969
+ if (!this._provideOrderByParameter) {
1970
+ this._provideOrderByParameter = (args, orderByString, orderBy) => {
1971
+ args.push({ name: "orderBy", value: encodeURIComponent(orderByString) });
1972
+ };
1973
+ }
1974
+ if (!this._providePagingParameter) {
1975
+ this._providePagingParameter = (args, skip, take) => {
1976
+ args.push({ name: "skip", value: skip });
1977
+ args.push({ name: "take", value: take });
1978
+ };
1979
+ }
1980
+ if (!this._provideAggregationParameter) {
1981
+ this._provideAggregationParameter = (args, fetchCountOnly, groupByString, groupBy, summaryString, summary) => {
1982
+ args.push({ name: "groupBy", value: groupByString });
1983
+ args.push({ name: "aggregate", value: "count" });
1984
+ };
1985
+ }
1986
+ if (!this._provideUri) {
1987
+ this._provideUri = (baseUri, entitySet, args) => {
1988
+ let requestUri = baseUri;
1989
+ requestUri += "/" + entitySet;
1990
+ if (args.length > 0) {
1991
+ requestUri += "?";
1992
+ }
1993
+ let argsString = "";
1994
+ for (var i = 0; i < args.length; i++) {
1995
+ if (i > 0) {
1996
+ argsString += "&";
1997
+ }
1998
+ argsString += args[i].name + "=" + args[i].value;
1999
+ }
2000
+ return requestUri + argsString;
2001
+ };
2002
+ }
2003
+ this._isAggregationSupported = settings.isAggregationSupported;
2004
+ window.setTimeout(this.doWork, 100);
2005
+ }
2006
+ get sortDescriptions() {
2007
+ return this._sortDescriptions;
2008
+ }
2009
+ get filterExpressions() {
2010
+ return this._filterExpressions;
2011
+ }
2012
+ get desiredProperties() {
2013
+ return this._desiredPropeties;
2014
+ }
2015
+ initialize() {
2016
+ super.initialize();
2017
+ }
2018
+ getTaskDataHolder() {
2019
+ let holder = new RestVirtualDataSourceProviderTaskDataHolder();
2020
+ return holder;
2021
+ }
2022
+ getCompletedTaskData(holder, completed) {
2023
+ super.getCompletedTaskData(holder, completed);
2024
+ }
2025
+ removeCompletedTaskData(holder, completed) {
2026
+ super.removeCompletedTaskData(holder, completed);
2027
+ }
2028
+ getTasksData(holder) {
2029
+ super.getTasksData(holder);
2030
+ }
2031
+ *iter(coll) {
2032
+ for (let i = 0; i < coll.size(); i++) {
2033
+ yield coll.get(i);
2034
+ }
2035
+ }
2036
+ *iterFilter(coll) {
2037
+ for (let i = 0; i < coll.size(); i++) {
2038
+ yield coll.get(i);
2039
+ }
2040
+ }
2041
+ *iterSummaries(summaries) {
2042
+ for (let i = 0; i < summaries.size(); i++) {
2043
+ yield summaries.get(i);
2044
+ }
2045
+ }
2046
+ processCompletedTask(completedTask, currentDelay, pageIndex, taskDataHolder) {
2047
+ let h = taskDataHolder;
2048
+ let schema = null;
2049
+ let result = null;
2050
+ let schemaFetchCount = -1;
2051
+ let task = completedTask.task;
2052
+ try {
2053
+ if (task.hasErrors) {
2054
+ this.retryIndex(pageIndex, currentDelay);
2055
+ return;
2056
+ }
2057
+ if (pageIndex == RestVirtualDataSourceDataProviderWorker.schemaRequestIndex) {
2058
+ result = task.result;
2059
+ schemaFetchCount = (this._provideFullCount(result));
2060
+ }
2061
+ else {
2062
+ result = task.result;
2063
+ }
2064
+ }
2065
+ catch (e) {
2066
+ this.retryIndex(pageIndex, currentDelay);
2067
+ return;
2068
+ }
2069
+ if (schemaFetchCount >= 0) {
2070
+ this.actualCount = schemaFetchCount;
2071
+ }
2072
+ else {
2073
+ this.actualCount = (this._provideFullCount(result));
2074
+ }
2075
+ schema = this.actualSchema;
2076
+ if (schema == null) {
2077
+ let requests = 0;
2078
+ this.resolveSchema((s) => {
2079
+ // resolveSchema success callback
2080
+ this.actualSchema = s;
2081
+ if (this._isAggregationSupported && (this._groupDescriptions.size() !== 0 || this._summaryDescriptions.size() !== 0)) {
2082
+ if (this._groupDescriptions.size() > 0) {
2083
+ requests++;
2084
+ this.resolveGroupInformation((g) => {
2085
+ // group info success
2086
+ requests--;
2087
+ if (requests === 0) {
2088
+ this.finishProcessingCompletedTask(task, pageIndex, s, result);
2089
+ }
2090
+ }, () => {
2091
+ // group info failure
2092
+ this.retryIndex(pageIndex, currentDelay);
2093
+ return;
2094
+ });
2095
+ }
2096
+ if (this._summaryDescriptions.size() > 0) {
2097
+ requests++;
2098
+ this.resolveSummaryInformation((g) => {
2099
+ // summary info success
2100
+ requests--;
2101
+ if (requests === 0) {
2102
+ this.finishProcessingCompletedTask(task, pageIndex, s, result);
2103
+ }
2104
+ }, () => {
2105
+ // summary info failure
2106
+ this.retryIndex(pageIndex, currentDelay);
2107
+ return;
2108
+ });
2109
+ }
2110
+ }
2111
+ else {
2112
+ this.finishProcessingCompletedTask(task, pageIndex, s, result);
2113
+ }
2114
+ }, () => {
2115
+ // resolveSchema failure callback
2116
+ this.retryIndex(pageIndex, currentDelay);
2117
+ return;
2118
+ });
2119
+ return;
2120
+ }
2121
+ this.finishProcessingCompletedTask(task, pageIndex, schema, result);
2122
+ }
2123
+ finishProcessingCompletedTask(task, pageIndex, schema, result) {
2124
+ let executionContext;
2125
+ let pageLoaded;
2126
+ let groupInformation;
2127
+ let summaryInformation;
2128
+ this.actualSchema = schema;
2129
+ executionContext = this.executionContext;
2130
+ groupInformation = this._groupInformation;
2131
+ summaryInformation = this._summaryInformation;
2132
+ pageLoaded = this.pageLoaded;
2133
+ let page = null;
2134
+ if (result != null) {
2135
+ page = new RestVirtualDataSourcePage(result, schema, groupInformation, summaryInformation, pageIndex);
2136
+ if (!this.isLastPage(pageIndex) && page.count() > 0 && !this.populatedActualPageSize) {
2137
+ this.populatedActualPageSize = true;
2138
+ this.actualPageSize = page.count();
2139
+ }
2140
+ }
2141
+ else {
2142
+ page = new RestVirtualDataSourcePage(null, schema, groupInformation, summaryInformation, pageIndex);
2143
+ }
2144
+ if (this.pageLoaded != null) {
2145
+ if (this.executionContext != null) {
2146
+ if (executionContext == null || pageLoaded == null) {
2147
+ this.shutdown();
2148
+ return;
2149
+ }
2150
+ executionContext.execute(() => pageLoaded(page, this.actualCount, this.actualPageSize));
2151
+ }
2152
+ else {
2153
+ if (pageLoaded == null) {
2154
+ this.shutdown();
2155
+ return;
2156
+ }
2157
+ pageLoaded(page, this.actualCount, this.actualPageSize);
2158
+ }
2159
+ }
2160
+ }
2161
+ resolveGroupInformation(finishAction, failureAction) {
2162
+ if (this._groupInformation != null) {
2163
+ finishAction(this._groupInformation);
2164
+ return;
2165
+ }
2166
+ let orderBy = "";
2167
+ let groupBy = "";
2168
+ let filter = null;
2169
+ let summary = "";
2170
+ if (this._groupDescriptions == null || this._groupDescriptions.size() == 0) {
2171
+ finishAction(null);
2172
+ return;
2173
+ }
2174
+ if (this._provideAggregationParameter == null) {
2175
+ finishAction(null);
2176
+ return;
2177
+ }
2178
+ filter = this._filterString;
2179
+ this.updateFilterString();
2180
+ if (this._groupDescriptions != null) {
2181
+ let first1 = true;
2182
+ for (let group of this.iter(this._groupDescriptions)) {
2183
+ if (first1) {
2184
+ first1 = false;
2185
+ }
2186
+ else {
2187
+ orderBy += ", ";
2188
+ groupBy += ", ";
2189
+ }
2190
+ groupBy += group.propertyName;
2191
+ if (group.direction === ListSortDirection.Descending) {
2192
+ orderBy += group.propertyName + " desc";
2193
+ }
2194
+ else {
2195
+ orderBy += group.propertyName + " asc";
2196
+ }
2197
+ }
2198
+ }
2199
+ if (this._summaryScope === DataSourceSummaryScope.Both || this._summaryScope === DataSourceSummaryScope.Groups) {
2200
+ let summaryParameters = this.getSummaryQueryParameters(true);
2201
+ if (!stringIsNullOrEmpty(summaryParameters)) {
2202
+ summary = ", " + summaryParameters;
2203
+ }
2204
+ }
2205
+ let args = [];
2206
+ if (this._provideOrderByParameter) {
2207
+ this._provideOrderByParameter(args, orderBy, this._groupDescriptions);
2208
+ }
2209
+ if (this._provideFilterParameter && filter != null) {
2210
+ this._provideFilterParameter(args, filter, this._filterExpressions);
2211
+ }
2212
+ if (this._provideAggregationParameter) {
2213
+ this._provideAggregationParameter(args, true, groupBy, this._groupDescriptions, summary, this._summaryDescriptions);
2214
+ }
2215
+ var uri = this._provideUri(this._baseUri, this._entitySet, args);
2216
+ try {
2217
+ let groupInformation = [];
2218
+ let success_ = (data, response) => this.groupSuccess(data, response, finishAction, failureAction, groupInformation);
2219
+ let failure_ = (err) => this.groupError(err, finishAction, failureAction, groupInformation);
2220
+ let run_ = null;
2221
+ var headers = { 'Content-Type': 'application/json', Accept: 'application/json' };
2222
+ var request = {
2223
+ requestUri: uri,
2224
+ enableJsonpCallback: this._enableJsonp,
2225
+ method: 'GET',
2226
+ headers: headers,
2227
+ data: null
2228
+ };
2229
+ run_ = () => {
2230
+ this.fetchUri(request, success_, failure_);
2231
+ };
2232
+ run_();
2233
+ }
2234
+ catch (e) {
2235
+ failureAction();
2236
+ }
2237
+ }
2238
+ fetchUri(request, success, failure) {
2239
+ if (this._performFetch) {
2240
+ this._performFetch(request, success, failure);
2241
+ }
2242
+ else {
2243
+ fetch(request.requestUri, {
2244
+ method: request.method,
2245
+ headers: request.headers,
2246
+ }).then((res) => {
2247
+ res.json().then((j) => {
2248
+ success(j, res);
2249
+ });
2250
+ }).catch((e) => {
2251
+ failure(e);
2252
+ });
2253
+ }
2254
+ }
2255
+ groupError(err, finishAction, failureAction, groupInformation) {
2256
+ this._groupInformation = null;
2257
+ }
2258
+ groupSuccess(data, response, finishAction, failureAction, groupInformation) {
2259
+ let groupNames = [];
2260
+ for (let group of this.iter(this._groupDescriptions)) {
2261
+ groupNames.push(group.propertyName);
2262
+ }
2263
+ let groupNamesArray = groupNames;
2264
+ let items = this._provideItems(data);
2265
+ if (items && items.length > 0) {
2266
+ let currentIndex = 0;
2267
+ for (let i = 0; i < items.length; i++) {
2268
+ this.addGroup(groupInformation, groupNames, groupNames, currentIndex, items[i]);
2269
+ }
2270
+ }
2271
+ this._groupInformation = groupInformation;
2272
+ finishAction(this._groupInformation);
2273
+ }
2274
+ addGroup(groupInformation, groupNames, groupNamesArray, currentIndex, group) {
2275
+ let groupValues = [];
2276
+ for (let name of groupNames) {
2277
+ if (group[name]) {
2278
+ groupValues.push(group[name]);
2279
+ }
2280
+ }
2281
+ let groupCount = 0;
2282
+ //todo: make this customizable
2283
+ if (this._provideAggregatedCount) {
2284
+ let ct = this._provideAggregatedCount(group);
2285
+ }
2286
+ else {
2287
+ if (group["aggregatedCount"]) {
2288
+ groupCount = Convert.toInt321(group["aggregatedCount"]);
2289
+ }
2290
+ }
2291
+ let summaryResults = null;
2292
+ if (this._summaryScope == DataSourceSummaryScope.Both || this._summaryScope == DataSourceSummaryScope.Groups) {
2293
+ summaryResults = this.createSummaryResults(group);
2294
+ }
2295
+ let groupInfo = new DefaultSectionInformation(currentIndex, currentIndex + (groupCount - 1), groupNamesArray, groupValues, summaryResults);
2296
+ groupInformation.push(groupInfo);
2297
+ }
2298
+ resolveSummaryInformation(finishAction, failureAction) {
2299
+ if (this._summaryInformation != null) {
2300
+ finishAction(this._summaryInformation);
2301
+ return;
2302
+ }
2303
+ let filter = null;
2304
+ let summary = null;
2305
+ if (this._summaryDescriptions == null ||
2306
+ this._summaryDescriptions.size() == 0 ||
2307
+ this._summaryScope == DataSourceSummaryScope.Groups ||
2308
+ this._summaryScope == DataSourceSummaryScope.None) {
2309
+ finishAction(null);
2310
+ return;
2311
+ }
2312
+ filter = this._filterString;
2313
+ this.updateFilterString();
2314
+ summary = this.getSummaryQueryParameters(false);
2315
+ let args = [];
2316
+ // if (this._provideOrderByParameter) {
2317
+ // args.push({ name: "orderBy", value: this._provideOrderByParameter(orderBy, this._sortDescriptions) });
2318
+ // }
2319
+ if (this._provideFilterParameter && filter != null) {
2320
+ this._provideFilterParameter(args, filter, this._filterExpressions);
2321
+ }
2322
+ if (this._provideAggregationParameter) {
2323
+ this._provideAggregationParameter(args, true, null, null, summary, this._summaryDescriptions);
2324
+ }
2325
+ var uri = this._provideUri(this._baseUri, this._entitySet, args);
2326
+ // let commandText = this._entitySet + "?$apply=";
2327
+ // if (!stringIsNullOrEmpty(filter)) {
2328
+ // commandText += "filter(" + filter + ")/";
2329
+ // }
2330
+ // commandText += "aggregate(" + summary + ")";
2331
+ try {
2332
+ let summaryInformation = [];
2333
+ let success_ = (data, response) => this.summarySuccess(data, response, finishAction, failureAction, summaryInformation);
2334
+ let failure_ = (err) => this.summaryError(err, finishAction, failureAction, summaryInformation);
2335
+ let run_ = null;
2336
+ var headers = { 'Content-Type': 'application/json', Accept: 'application/json' };
2337
+ var request = {
2338
+ requestUri: uri,
2339
+ enableJsonpCallback: this._enableJsonp,
2340
+ method: 'GET',
2341
+ headers: headers,
2342
+ data: null
2343
+ };
2344
+ run_ = () => {
2345
+ this.fetchUri(request, success_, failure_);
2346
+ };
2347
+ run_();
2348
+ }
2349
+ catch (e) {
2350
+ failureAction();
2351
+ }
2352
+ }
2353
+ summarySuccess(data, response, finishAction, failureAction, summaryInformation) {
2354
+ if (data && data.value && data.value.length > 0) {
2355
+ summaryInformation = this.createSummaryResults(data.value[0]);
2356
+ }
2357
+ this._summaryInformation = summaryInformation;
2358
+ finishAction(this._summaryInformation);
2359
+ }
2360
+ summaryError(err, finishAction, failureAction, summaryInformation) {
2361
+ this._summaryInformation = null;
2362
+ }
2363
+ getSummaryQueryParameters(ignoreCount) {
2364
+ let result = "";
2365
+ if (this._summaryDescriptions != null) {
2366
+ let first = true;
2367
+ let countExists = false;
2368
+ for (let summary of this.iterSummaries(this._summaryDescriptions)) {
2369
+ if (summary.operand == SummaryOperand.Count && (ignoreCount || countExists)) {
2370
+ continue;
2371
+ }
2372
+ if (!first) {
2373
+ result += ", ";
2374
+ }
2375
+ switch (summary.operand) {
2376
+ case SummaryOperand.Average:
2377
+ result += summary.propertyName + " with average as " + summary.propertyName + "Average";
2378
+ break;
2379
+ case SummaryOperand.Min:
2380
+ result += summary.propertyName + " with min as " + summary.propertyName + "Min";
2381
+ break;
2382
+ case SummaryOperand.Max:
2383
+ result += summary.propertyName + " with max as " + summary.propertyName + "Max";
2384
+ break;
2385
+ case SummaryOperand.Sum:
2386
+ result += summary.propertyName + " with sum as " + summary.propertyName + "Sum";
2387
+ break;
2388
+ case SummaryOperand.Count:
2389
+ result += "$count as $__count";
2390
+ countExists = true;
2391
+ break;
2392
+ }
2393
+ first = false;
2394
+ }
2395
+ }
2396
+ return result;
2397
+ }
2398
+ createSummaryResults(data) {
2399
+ let summaryResults = [];
2400
+ for (let summary of this.iterSummaries(this._summaryDescriptions)) {
2401
+ let summaryName = summary.propertyName;
2402
+ switch (summary.operand) {
2403
+ case SummaryOperand.Average:
2404
+ summaryName += "Average";
2405
+ break;
2406
+ case SummaryOperand.Min:
2407
+ summaryName += "Min";
2408
+ break;
2409
+ case SummaryOperand.Max:
2410
+ summaryName += "Max";
2411
+ break;
2412
+ case SummaryOperand.Sum:
2413
+ summaryName += "Sum";
2414
+ break;
2415
+ case SummaryOperand.Count:
2416
+ summaryName = "$__count";
2417
+ break;
2418
+ }
2419
+ let summaryValue = null;
2420
+ if (data && data[summaryName]) {
2421
+ summaryValue = data[summaryName];
2422
+ }
2423
+ let summaryResult = new DefaultSummaryResult(summary.propertyName, summary.operand, summaryValue);
2424
+ summaryResults.push(summaryResult);
2425
+ }
2426
+ return summaryResults;
2427
+ }
2428
+ resolveSchemaFromItems(items) {
2429
+ let lds = new LocalDataSource();
2430
+ lds.dataSource = items;
2431
+ lds.flushAutoRefresh();
2432
+ return lds.actualSchema;
2433
+ }
2434
+ resolveSchema(finishAction, failureAction) {
2435
+ if (!this._provideItems || !this._providePagingParameter) {
2436
+ failureAction("required providers for items and paging are not specified");
2437
+ return;
2438
+ }
2439
+ let success_ = (res) => {
2440
+ let items = this._provideItems(res);
2441
+ if (items && items.length > 0) {
2442
+ let schema = this.resolveSchemaFromItems(items);
2443
+ finishAction(schema);
2444
+ }
2445
+ else {
2446
+ failureAction("could not find items to resolve schema");
2447
+ }
2448
+ };
2449
+ let failure_ = (e) => failureAction(e);
2450
+ let args = [];
2451
+ if (this._providePagingParameter) {
2452
+ this._providePagingParameter(args, 0, this.actualPageSize);
2453
+ }
2454
+ let uri = this._provideUri(this._baseUri, this._entitySet, args);
2455
+ try {
2456
+ let run_ = null;
2457
+ var headers = { 'Content-Type': 'application/json', Accept: 'application/json' };
2458
+ var request = {
2459
+ requestUri: uri,
2460
+ enableJsonpCallback: this._enableJsonp,
2461
+ method: 'GET',
2462
+ headers: headers,
2463
+ data: null
2464
+ };
2465
+ run_ = () => {
2466
+ this.fetchUri(request, success_, failure_);
2467
+ };
2468
+ run_();
2469
+ }
2470
+ catch (e) {
2471
+ failureAction(e);
2472
+ }
2473
+ }
2474
+ makeTaskForRequest(request, retryDelay) {
2475
+ let args = [];
2476
+ // if (this._provideAggregationParameter) {
2477
+ // args.push({ name: "apply", value: this._provideAggregationParameter(true, groupBy, this._groupDescriptions, summary, this._summaryDescriptions) });
2478
+ // }
2479
+ let actualPageSize = 0;
2480
+ let sortDescriptions = null;
2481
+ actualPageSize = this.actualPageSize;
2482
+ sortDescriptions = this.sortDescriptions;
2483
+ //let requestUrl: string = this._baseUri;
2484
+ //requestUrl += "/" + this._entitySet;
2485
+ let queryStarted = false;
2486
+ this.updateFilterString();
2487
+ if (this._filterString != null) {
2488
+ if (this._provideFilterParameter) {
2489
+ this._provideFilterParameter(args, this._filterString, this._filterExpressions);
2490
+ }
2491
+ }
2492
+ if (this.sortDescriptions != null) {
2493
+ let sortString = null;
2494
+ for (let sort of this.iter(this.sortDescriptions)) {
2495
+ if (sortString == null) {
2496
+ sortString = "";
2497
+ }
2498
+ else {
2499
+ sortString += ", ";
2500
+ }
2501
+ if (sort.direction == ListSortDirection.Descending) {
2502
+ sortString += sort.propertyName + " desc";
2503
+ }
2504
+ else {
2505
+ sortString += sort.propertyName;
2506
+ }
2507
+ }
2508
+ if (sortString != null) {
2509
+ if (this._provideOrderByParameter) {
2510
+ this._provideOrderByParameter(args, sortString, this._sortDescriptions);
2511
+ }
2512
+ }
2513
+ }
2514
+ if (this.desiredProperties != null && this.desiredProperties.length > 0) {
2515
+ let selectString = "";
2516
+ let first = true;
2517
+ let $t = this.desiredProperties;
2518
+ for (let i = 0; i < $t.length; i++) {
2519
+ let select = $t[i];
2520
+ if (first) {
2521
+ first = false;
2522
+ }
2523
+ else {
2524
+ selectString += ", ";
2525
+ }
2526
+ selectString += select;
2527
+ }
2528
+ if (this._provideDesiredPropertiesParameter) {
2529
+ this._provideDesiredPropertiesParameter(args, selectString, this._desiredPropeties);
2530
+ }
2531
+ }
2532
+ if (this._providePagingParameter) {
2533
+ if (request.index == RestVirtualDataSourceDataProviderWorker.schemaRequestIndex) {
2534
+ this._providePagingParameter(args, 0, actualPageSize);
2535
+ }
2536
+ else {
2537
+ this._providePagingParameter(args, request.index * actualPageSize, actualPageSize);
2538
+ }
2539
+ }
2540
+ let task = new AsyncVirtualDataTask();
2541
+ let uri = this._provideUri(this._baseUri, this._entitySet, args);
2542
+ if (request.index == RestVirtualDataSourceDataProviderWorker.schemaRequestIndex) {
2543
+ this.executeRequest(uri, queryStarted, 0, actualPageSize, task);
2544
+ }
2545
+ else {
2546
+ this.executeRequest(uri, queryStarted, request.index * actualPageSize, actualPageSize, task);
2547
+ }
2548
+ request.taskHolder = new AsyncDataSourcePageTaskHolder();
2549
+ request.taskHolder.task = task;
2550
+ this.tasks.add(request);
2551
+ }
2552
+ updateFilterString() {
2553
+ if (this.filterExpressions != null && this.filterExpressions.size() > 0 && this._filterString == null) {
2554
+ let sb = "";
2555
+ let first = true;
2556
+ for (let expr of this.iterFilter(this.filterExpressions)) {
2557
+ if (first) {
2558
+ first = false;
2559
+ }
2560
+ else {
2561
+ sb += " AND ";
2562
+ }
2563
+ let visitor = new ODataDataSourceFilterExpressionVisitor(0);
2564
+ visitor.visit(expr);
2565
+ let txt = visitor.toString();
2566
+ if (this.filterExpressions.size() > 1) {
2567
+ txt = "(" + txt + ")";
2568
+ }
2569
+ sb += (txt);
2570
+ }
2571
+ this._filterString = sb;
2572
+ }
2573
+ }
2574
+ executeRequest(requestUrl, queryStarted, skip, top, task) {
2575
+ // if (!queryStarted) {
2576
+ // queryStarted = true;
2577
+ // requestUrl += "?";
2578
+ // } else {
2579
+ // requestUrl += "&";
2580
+ // }
2581
+ // requestUrl += "$skip=" + skip + "&$top=" + top + "&$count=true";
2582
+ let requestUrl_ = requestUrl;
2583
+ let self_ = this;
2584
+ let success_ = (data, response) => this.success(task, data, response);
2585
+ let failure_ = (err) => this.error(task, err);
2586
+ let run_ = null;
2587
+ var headers = { 'Content-Type': 'application/json', Accept: 'application/json' };
2588
+ var request = {
2589
+ requestUri: requestUrl_,
2590
+ enableJsonpCallback: this._enableJsonp,
2591
+ method: 'GET',
2592
+ headers: headers,
2593
+ data: null
2594
+ };
2595
+ run_ = () => {
2596
+ this.fetchUri(request, success_, failure_);
2597
+ };
2598
+ task.run = run_;
2599
+ }
2600
+ success(t, data, response) {
2601
+ t.result = data;
2602
+ t.isCompleted = true;
2603
+ }
2604
+ error(t, result) {
2605
+ t.isCompleted = true;
2606
+ t.hasErrors = true;
2607
+ }
2608
+ createBatchRequest(changes) {
2609
+ //TODO: updates
2610
+ }
2611
+ getRequestUriWithKey(key) {
2612
+ let result = "";
2613
+ const keys = Object.keys(key);
2614
+ for (let i = 0; i < keys.length; i++) {
2615
+ if (i > 0) {
2616
+ result += ",";
2617
+ }
2618
+ result += `${keys[i]}=${key[keys[i]]}`;
2619
+ }
2620
+ return `${this._entitySet}(${result})`;
2621
+ }
2622
+ }
2623
+ RestVirtualDataSourceDataProviderWorker.schemaRequestIndex = -1;
2624
+ return RestVirtualDataSourceDataProviderWorker;
2625
+ })();
2626
+
2627
+ let RestVirtualDataSourceDataProviderWorkerSettings = /*@__PURE__*/ (() => {
2628
+ class RestVirtualDataSourceDataProviderWorkerSettings extends AsyncVirtualDataSourceDataProviderWorkerSettings {
2629
+ constructor() {
2630
+ super(...arguments);
2631
+ this._baseUri = null;
2632
+ this._entitySet = null;
2633
+ this._sortDescriptions = null;
2634
+ this._filterExpressions = null;
2635
+ this._propertiesRequested = null;
2636
+ this._groupDescriptions = null;
2637
+ this._summaryDescriptions = null;
2638
+ this._fixedFullCount = -1;
2639
+ this._provideFullCount = null;
2640
+ this._provideOrderByParameter = null;
2641
+ this._provideFilterParameter = null;
2642
+ this._provideAggregationParameter = null;
2643
+ this._provideAggregatedCount = null;
2644
+ this._provideUri = null;
2645
+ this._providePagingParameter = null;
2646
+ this._provideDesiredPropertiesParameter = null;
2647
+ this._performFetch = null;
2648
+ }
2649
+ get baseUri() {
2650
+ return this._baseUri;
2651
+ }
2652
+ set baseUri(value) {
2653
+ this._baseUri = value;
2654
+ }
2655
+ get entitySet() {
2656
+ return this._entitySet;
2657
+ }
2658
+ set entitySet(value) {
2659
+ this._entitySet = value;
2660
+ }
2661
+ get sortDescriptions() {
2662
+ return this._sortDescriptions;
2663
+ }
2664
+ set sortDescriptions(value) {
2665
+ this._sortDescriptions = value;
2666
+ }
2667
+ get filterExpressions() {
2668
+ return this._filterExpressions;
2669
+ }
2670
+ set filterExpressions(value) {
2671
+ this._filterExpressions = value;
2672
+ }
2673
+ get propertiesRequested() {
2674
+ return this._propertiesRequested;
2675
+ }
2676
+ set propertiesRequested(value) {
2677
+ this._propertiesRequested = value;
2678
+ }
2679
+ get groupDescriptions() {
2680
+ return this._groupDescriptions;
2681
+ }
2682
+ set groupDescriptions(value) {
2683
+ this._groupDescriptions = value;
2684
+ }
2685
+ get summaryDescriptions() {
2686
+ return this._summaryDescriptions;
2687
+ }
2688
+ set summaryDescriptions(value) {
2689
+ this._summaryDescriptions = value;
2690
+ }
2691
+ get summaryScope() {
2692
+ return this._summaryscope;
2693
+ }
2694
+ set summaryScope(value) {
2695
+ this._summaryscope = value;
2696
+ }
2697
+ get enableJsonp() {
2698
+ return this._enableJsonp;
2699
+ }
2700
+ set enableJsonp(isEnabled) {
2701
+ this._enableJsonp = isEnabled;
2702
+ }
2703
+ get isAggregationSupported() {
2704
+ return this._isAggregationSupported;
2705
+ }
2706
+ set isAggregationSupported(isSupported) {
2707
+ this._isAggregationSupported = isSupported;
2708
+ }
2709
+ get fixedFullCount() {
2710
+ return this._fixedFullCount;
2711
+ }
2712
+ set fixedFullCount(value) {
2713
+ this._fixedFullCount = value;
2714
+ }
2715
+ get provideFullCount() {
2716
+ return this._provideFullCount;
2717
+ }
2718
+ set provideFullCount(value) {
2719
+ this._provideFullCount = value;
2720
+ }
2721
+ get provideOrderByParameter() {
2722
+ return this._provideOrderByParameter;
2723
+ }
2724
+ set provideOrderByParameter(value) {
2725
+ this._provideOrderByParameter = value;
2726
+ }
2727
+ get provideFilterParameter() {
2728
+ return this._provideFilterParameter;
2729
+ }
2730
+ set provideFilterParameter(value) {
2731
+ this._provideFilterParameter = value;
2732
+ }
2733
+ get provideAggregationParameter() {
2734
+ return this._provideAggregationParameter;
2735
+ }
2736
+ set provideAggregationParameter(value) {
2737
+ this._provideAggregationParameter = value;
2738
+ }
2739
+ get provideAggregatedCount() {
2740
+ return this._provideAggregatedCount;
2741
+ }
2742
+ set provideAggregatedCount(value) {
2743
+ this._provideAggregatedCount = value;
2744
+ }
2745
+ get provideUri() {
2746
+ return this._provideUri;
2747
+ }
2748
+ set provideUri(value) {
2749
+ this._provideUri = value;
2750
+ }
2751
+ get providePagingParameter() {
2752
+ return this._providePagingParameter;
2753
+ }
2754
+ set providePagingParameter(value) {
2755
+ this._providePagingParameter = value;
2756
+ }
2757
+ get provideDesiredPropertiesParameter() {
2758
+ return this._provideDesiredPropertiesParameter;
2759
+ }
2760
+ set provideDesiredPropertiesParameter(value) {
2761
+ this._provideDesiredPropertiesParameter = value;
2762
+ }
2763
+ get provideItems() {
2764
+ return this._provideItems;
2765
+ }
2766
+ set provideItems(value) {
2767
+ this._provideItems = value;
2768
+ }
2769
+ get performFetch() {
2770
+ return this._performFetch;
2771
+ }
2772
+ set performFetch(value) {
2773
+ this._performFetch = value;
2774
+ }
2775
+ }
2776
+ RestVirtualDataSourceDataProviderWorkerSettings.$t = /*@__PURE__*/ markType(RestVirtualDataSourceDataProviderWorkerSettings, 'RestVirtualDataSourceDataProviderWorkerSettings', AsyncVirtualDataSourceDataProviderWorkerSettings.$type);
2777
+ return RestVirtualDataSourceDataProviderWorkerSettings;
2778
+ })();
2779
+
2780
+ let RestVirtualDataSourceDataProvider = /*@__PURE__*/ (() => {
2781
+ class RestVirtualDataSourceDataProvider extends Base {
2782
+ constructor() {
2783
+ super();
2784
+ this._worker = null;
2785
+ this._requests = new LinkedList();
2786
+ this._callback = null;
2787
+ this._pageLoaded = null;
2788
+ this._pageSizeRequested = 50;
2789
+ this._baseUri = null;
2790
+ this._entitySet = null;
2791
+ this._timeoutMilliseconds = 10000;
2792
+ this.schemaChanged = null;
2793
+ this._currentFullCount = 0;
2794
+ this._currentSchema = null;
2795
+ this._executionContext = null;
2796
+ this._updateNotifier = null;
2797
+ this._deferAutoRefresh = false;
2798
+ this._sortDescriptions = null;
2799
+ this._groupDescriptions = null;
2800
+ this._propertiesRequested = null;
2801
+ this._filterExpressions = null;
2802
+ this._summaryDescriptions = null;
2803
+ this._enableJsonp = true;
2804
+ this._fixedFullCount = -1;
2805
+ this._provideFullCount = null;
2806
+ this._provideOrderByParameter = null;
2807
+ this._provideFilterParameter = null;
2808
+ this._provideAggregationParameter = null;
2809
+ this._provideAggregatedCount = null;
2810
+ this._provideUri = null;
2811
+ this._performFetch = null;
2812
+ this._providePagingParameter = null;
2813
+ this._provideDesiredPropertiesParameter = null;
2814
+ this._schemaFetchQueued = false;
2815
+ this._autoRefreshQueued = false;
2816
+ this._sortDescriptions = new SortDescriptionCollection();
2817
+ this._sortDescriptions.onChanged = () => this.sortDescriptions_CollectionChanged(null, null);
2818
+ this._groupDescriptions = new SortDescriptionCollection();
2819
+ this._groupDescriptions.onChanged = () => this.groupDescriptions_CollectionChanged(null, null);
2820
+ this._filterExpressions = new FilterExpressionCollection();
2821
+ this._filterExpressions.onChanged = () => this.filterExpressions_CollectionChanged(null, null);
2822
+ this._summaryDescriptions = new SummaryDescriptionCollection();
2823
+ this._summaryDescriptions.onChanged = () => this.summaryDescriptions_CollectionChanged(null, null);
2824
+ }
2825
+ filterExpressions_CollectionChanged(sender, e) {
2826
+ this.queueAutoRefresh();
2827
+ }
2828
+ sortDescriptions_CollectionChanged(sender, e) {
2829
+ this.queueAutoRefresh();
2830
+ }
2831
+ groupDescriptions_CollectionChanged(sender, e) {
2832
+ this.queueAutoRefresh();
2833
+ }
2834
+ summaryDescriptions_CollectionChanged(sender, e) {
2835
+ this.queueAutoRefresh();
2836
+ }
2837
+ addPageRequest(pageIndex, priority) {
2838
+ if (this.deferAutoRefresh) {
2839
+ return;
2840
+ }
2841
+ if (this._worker != null && this._worker.isShutdown) {
2842
+ this._worker = null;
2843
+ this._callback = null;
2844
+ }
2845
+ if (this._worker == null) {
2846
+ this.createWorker();
2847
+ }
2848
+ if (priority == DataSourcePageRequestPriority.High) {
2849
+ this._requests.addFirst(pageIndex);
2850
+ }
2851
+ else {
2852
+ this._requests.addLast(pageIndex);
2853
+ }
2854
+ if (!this._worker.addPageRequest(pageIndex, priority)) {
2855
+ this._worker = null;
2856
+ this._callback = null;
2857
+ this.addPageRequest(pageIndex, priority);
2858
+ }
2859
+ }
2860
+ createWorker() {
2861
+ if (!this.valid()) {
2862
+ return;
2863
+ }
2864
+ this._callback = runOn(this, this.raisePageLoaded);
2865
+ let settings = this.getWorkerSettings();
2866
+ this._worker = new RestVirtualDataSourceDataProviderWorker(settings);
2867
+ }
2868
+ valid() {
2869
+ return this.entitySet != null && this.baseUri != null;
2870
+ }
2871
+ getWorkerSettings() {
2872
+ return ((() => {
2873
+ let $ret = new RestVirtualDataSourceDataProviderWorkerSettings();
2874
+ $ret.baseUri = this._baseUri;
2875
+ $ret.entitySet = this._entitySet;
2876
+ $ret.pageSizeRequested = this._pageSizeRequested;
2877
+ $ret.timeoutMilliseconds = this._timeoutMilliseconds;
2878
+ $ret.pageLoaded = this._callback;
2879
+ $ret.executionContext = this._executionContext;
2880
+ $ret.sortDescriptions = this._sortDescriptions;
2881
+ $ret.groupDescriptions = this._groupDescriptions;
2882
+ $ret.filterExpressions = this._filterExpressions;
2883
+ $ret.propertiesRequested = this._propertiesRequested;
2884
+ $ret.summaryDescriptions = this._summaryDescriptions;
2885
+ $ret.summaryScope = this._summaryScope;
2886
+ $ret.enableJsonp = this._enableJsonp;
2887
+ $ret.isAggregationSupported = this.isAggregationSupported;
2888
+ $ret.performFetch = this.performFetch;
2889
+ $ret.provideAggregationParameter = this.provideAggregationParameter;
2890
+ $ret.provideAggregatedCount = this.provideAggregatedCount;
2891
+ $ret.provideDesiredPropertiesParameter = this.provideDesiredPropertiesParameter;
2892
+ $ret.provideFilterParameter = this.provideFilterParameter;
2893
+ $ret.provideFullCount = this.provideFullCount;
2894
+ $ret.provideItems = this.provideItems;
2895
+ $ret.provideOrderByParameter = this.provideOrderByParameter;
2896
+ $ret.providePagingParameter = this.providePagingParameter;
2897
+ $ret.provideUri = this.provideUri;
2898
+ $ret.fixedFullCount = this.fixedFullCount;
2899
+ return $ret;
2900
+ })());
2901
+ }
2902
+ removePageRequest(pageIndex) {
2903
+ let current = this._requests.first;
2904
+ while (current != null) {
2905
+ if (current.value == pageIndex) {
2906
+ this._requests.remove(current);
2907
+ }
2908
+ current = current.next;
2909
+ }
2910
+ if (this._worker == null) {
2911
+ return;
2912
+ }
2913
+ this._worker.removePageRequest(pageIndex);
2914
+ }
2915
+ removeAllPageRequests() {
2916
+ this._requests.clear();
2917
+ if (this._worker == null) {
2918
+ return;
2919
+ }
2920
+ this._worker.removeAllPageRequests();
2921
+ }
2922
+ close() {
2923
+ if (this._worker != null) {
2924
+ this._worker.shutdown();
2925
+ this._worker = null;
2926
+ this._callback = null;
2927
+ }
2928
+ }
2929
+ get pageLoaded() {
2930
+ return this._pageLoaded;
2931
+ }
2932
+ set pageLoaded(value) {
2933
+ this._pageLoaded = value;
2934
+ this.queueAutoRefresh();
2935
+ }
2936
+ raisePageLoaded(page, fullCount, actualPageSize) {
2937
+ if (this._pageLoaded != null) {
2938
+ this._currentFullCount = fullCount;
2939
+ if (this._currentSchema == null) {
2940
+ let currentSchema = null;
2941
+ if (page != null) {
2942
+ currentSchema = page.schema();
2943
+ }
2944
+ this._currentSchema = currentSchema;
2945
+ if (this.schemaChanged != null) {
2946
+ this.schemaChanged(this, new DataSourceDataProviderSchemaChangedEventArgs(this._currentSchema, this._currentFullCount));
2947
+ }
2948
+ }
2949
+ if (page.pageIndex() != RestVirtualDataSourceDataProviderWorker.schemaRequestIndex) {
2950
+ this._pageLoaded(page, fullCount, actualPageSize);
2951
+ }
2952
+ }
2953
+ }
2954
+ killWorker() {
2955
+ if (this._worker != null) {
2956
+ this._worker.shutdown();
2957
+ this._worker = null;
2958
+ this._callback = null;
2959
+ }
2960
+ }
2961
+ get pageSizeRequested() {
2962
+ return this._pageSizeRequested;
2963
+ }
2964
+ set pageSizeRequested(value) {
2965
+ this._pageSizeRequested = value;
2966
+ this.queueAutoRefresh();
2967
+ }
2968
+ get baseUri() {
2969
+ return this._baseUri;
2970
+ }
2971
+ set baseUri(value) {
2972
+ let oldValue = this._baseUri;
2973
+ this._baseUri = value;
2974
+ if (oldValue != this._baseUri) {
2975
+ this.queueAutoRefresh();
2976
+ if (this.valid() && this.deferAutoRefresh) {
2977
+ this.queueSchemaFetch();
2978
+ }
2979
+ }
2980
+ }
2981
+ get entitySet() {
2982
+ return this._entitySet;
2983
+ }
2984
+ set entitySet(value) {
2985
+ let oldValue = this._entitySet;
2986
+ this._entitySet = value;
2987
+ if (oldValue != this._entitySet) {
2988
+ this.queueAutoRefresh();
2989
+ if (this.valid() && this.deferAutoRefresh) {
2990
+ this.queueSchemaFetch();
2991
+ }
2992
+ }
2993
+ }
2994
+ get timeoutMilliseconds() {
2995
+ return this._timeoutMilliseconds;
2996
+ }
2997
+ set timeoutMilliseconds(value) {
2998
+ this._timeoutMilliseconds = value;
2999
+ this.queueAutoRefresh();
3000
+ }
3001
+ getItemValue(item, valueName) {
3002
+ let dic = item;
3003
+ if (dic.has(valueName)) {
3004
+ return dic.get(valueName);
3005
+ }
3006
+ else {
3007
+ return null;
3008
+ }
3009
+ }
3010
+ get actualCount() {
3011
+ return this._currentFullCount;
3012
+ }
3013
+ get actualSchema() {
3014
+ return this._currentSchema;
3015
+ }
3016
+ get executionContext() {
3017
+ return this._executionContext;
3018
+ }
3019
+ set executionContext(value) {
3020
+ this._executionContext = value;
3021
+ this.queueAutoRefresh();
3022
+ }
3023
+ get updateNotifier() {
3024
+ return this._updateNotifier;
3025
+ }
3026
+ set updateNotifier(value) {
3027
+ this._updateNotifier = value;
3028
+ }
3029
+ get deferAutoRefresh() {
3030
+ return this._deferAutoRefresh;
3031
+ }
3032
+ set deferAutoRefresh(value) {
3033
+ this._deferAutoRefresh = value;
3034
+ if (!this._deferAutoRefresh) {
3035
+ this.queueAutoRefresh();
3036
+ }
3037
+ if (this._deferAutoRefresh && this.valid() && this._currentSchema == null) {
3038
+ this.queueSchemaFetch();
3039
+ }
3040
+ }
3041
+ get isSortingSupported() {
3042
+ return true;
3043
+ }
3044
+ get isGroupingSupported() {
3045
+ return this.isAggregationSupported;
3046
+ }
3047
+ get isFilteringSupported() {
3048
+ return true;
3049
+ }
3050
+ get isAggregationSupported() {
3051
+ return this._isAggregationSupported;
3052
+ }
3053
+ set isAggregationSupported(isSupported) {
3054
+ this._isAggregationSupported = isSupported;
3055
+ }
3056
+ get sortDescriptions() {
3057
+ return this._sortDescriptions;
3058
+ }
3059
+ get groupDescriptions() {
3060
+ return this._groupDescriptions;
3061
+ }
3062
+ get propertiesRequested() {
3063
+ return this._propertiesRequested;
3064
+ }
3065
+ set propertiesRequested(value) {
3066
+ this._propertiesRequested = value;
3067
+ this.queueAutoRefresh();
3068
+ }
3069
+ get filterExpressions() {
3070
+ return this._filterExpressions;
3071
+ }
3072
+ get summaryDescriptions() {
3073
+ return this._summaryDescriptions;
3074
+ }
3075
+ get summaryScope() {
3076
+ return this._summaryScope;
3077
+ }
3078
+ set summaryScope(value) {
3079
+ this._summaryScope = value;
3080
+ }
3081
+ get enableJsonp() {
3082
+ return this._enableJsonp;
3083
+ }
3084
+ set enableJsonp(isEnabled) {
3085
+ this._enableJsonp = isEnabled;
3086
+ }
3087
+ get fixedFullCount() {
3088
+ return this._fixedFullCount;
3089
+ }
3090
+ set fixedFullCount(value) {
3091
+ this._fixedFullCount = value;
3092
+ }
3093
+ get provideFullCount() {
3094
+ return this._provideFullCount;
3095
+ }
3096
+ set provideFullCount(value) {
3097
+ this._provideFullCount = value;
3098
+ }
3099
+ get provideOrderByParameter() {
3100
+ return this._provideOrderByParameter;
3101
+ }
3102
+ set provideOrderByParameter(value) {
3103
+ this._provideOrderByParameter = value;
3104
+ }
3105
+ get provideFilterParameter() {
3106
+ return this._provideFilterParameter;
3107
+ }
3108
+ set provideFilterParameter(value) {
3109
+ this._provideFilterParameter = value;
3110
+ }
3111
+ get provideAggregationParameter() {
3112
+ return this._provideAggregationParameter;
3113
+ }
3114
+ set provideAggregationParameter(value) {
3115
+ this._provideAggregationParameter = value;
3116
+ }
3117
+ get provideAggregatedCount() {
3118
+ return this._provideAggregatedCount;
3119
+ }
3120
+ set provideAggregatedCount(value) {
3121
+ this._provideAggregatedCount = value;
3122
+ }
3123
+ get provideUri() {
3124
+ return this._provideUri;
3125
+ }
3126
+ set provideUri(value) {
3127
+ this._provideUri = value;
3128
+ }
3129
+ get performFetch() {
3130
+ return this._performFetch;
3131
+ }
3132
+ set performFetch(value) {
3133
+ this._performFetch = value;
3134
+ }
3135
+ get providePagingParameter() {
3136
+ return this._providePagingParameter;
3137
+ }
3138
+ set providePagingParameter(value) {
3139
+ this._providePagingParameter = value;
3140
+ }
3141
+ get provideDesiredPropertiesParameter() {
3142
+ return this._provideDesiredPropertiesParameter;
3143
+ }
3144
+ set provideDesiredPropertiesParameter(value) {
3145
+ this._provideDesiredPropertiesParameter = value;
3146
+ }
3147
+ get provideItems() {
3148
+ return this._provideItems;
3149
+ }
3150
+ set provideItems(value) {
3151
+ this._provideItems = value;
3152
+ }
3153
+ get notifyUsingSourceIndexes() {
3154
+ return true;
3155
+ }
3156
+ get isItemIndexLookupSupported() {
3157
+ return false;
3158
+ }
3159
+ get isKeyIndexLookupSupported() {
3160
+ return false;
3161
+ }
3162
+ notifySetItem(index, oldItem, newItem) {
3163
+ if (this.updateNotifier != null) {
3164
+ this.updateNotifier.notifySetItem(index, oldItem, newItem);
3165
+ }
3166
+ }
3167
+ notifyClearItems() {
3168
+ if (this.updateNotifier != null) {
3169
+ this.updateNotifier.notifyClearItems();
3170
+ }
3171
+ }
3172
+ notifyInsertItem(index, newItem) {
3173
+ if (this.updateNotifier != null) {
3174
+ this.updateNotifier.notifyInsertItem(index, newItem);
3175
+ }
3176
+ }
3177
+ notifyRemoveItem(index, oldItem) {
3178
+ if (this.updateNotifier != null) {
3179
+ this.updateNotifier.notifyRemoveItem(index, oldItem);
3180
+ }
3181
+ }
3182
+ queueSchemaFetch() {
3183
+ if (this._schemaFetchQueued) {
3184
+ return;
3185
+ }
3186
+ if (this.executionContext != null) {
3187
+ this._schemaFetchQueued = true;
3188
+ this.executionContext.enqueueAction(runOn(this, this.doSchemaFetchInternal));
3189
+ }
3190
+ }
3191
+ doSchemaFetchInternal() {
3192
+ if (!this._schemaFetchQueued) {
3193
+ return;
3194
+ }
3195
+ this._schemaFetchQueued = false;
3196
+ this.schemaFetchInternal();
3197
+ }
3198
+ schemaFetchInternal() {
3199
+ this.schemaFetchInternalOverride();
3200
+ }
3201
+ schemaFetchInternalOverride() {
3202
+ if (!this.deferAutoRefresh) {
3203
+ return;
3204
+ }
3205
+ this.removeAllPageRequests();
3206
+ this.killWorker();
3207
+ this.createWorker();
3208
+ this.addSchemaRequest();
3209
+ }
3210
+ addSchemaRequest() {
3211
+ this._worker.addPageRequest(RestVirtualDataSourceDataProviderWorker.schemaRequestIndex, DataSourcePageRequestPriority.High);
3212
+ }
3213
+ queueAutoRefresh() {
3214
+ if (this.deferAutoRefresh) {
3215
+ return;
3216
+ }
3217
+ if (this._autoRefreshQueued) {
3218
+ return;
3219
+ }
3220
+ if (this.executionContext != null) {
3221
+ this._autoRefreshQueued = true;
3222
+ this.executionContext.enqueueAction(runOn(this, this.doRefreshInternal));
3223
+ }
3224
+ }
3225
+ doRefreshInternal() {
3226
+ if (this.deferAutoRefresh) {
3227
+ this._autoRefreshQueued = false;
3228
+ return;
3229
+ }
3230
+ if (!this._autoRefreshQueued) {
3231
+ return;
3232
+ }
3233
+ this._autoRefreshQueued = false;
3234
+ this.refreshInternal();
3235
+ }
3236
+ refreshInternal() {
3237
+ this.refreshInternalOverride();
3238
+ }
3239
+ refreshInternalOverride() {
3240
+ this.removeAllPageRequests();
3241
+ this.killWorker();
3242
+ this.createWorker();
3243
+ this._worker.addPageRequest(0, DataSourcePageRequestPriority.Normal);
3244
+ }
3245
+ flushAutoRefresh() {
3246
+ this.doRefreshInternal();
3247
+ }
3248
+ refresh() {
3249
+ this.refreshInternal();
3250
+ }
3251
+ indexOfItem(item) {
3252
+ return -1;
3253
+ }
3254
+ indexOfKey(key) {
3255
+ return -1;
3256
+ }
3257
+ resolveSchemaPropertyType(propertyPath) {
3258
+ if (this.actualSchema == null) {
3259
+ return DataSourceSchemaPropertyType.ObjectValue;
3260
+ }
3261
+ if (stringContains(propertyPath, ".")) {
3262
+ return DataSourceSchemaPropertyType.ObjectValue;
3263
+ }
3264
+ for (let i = 0; i < this.actualSchema.propertyNames.length; i++) {
3265
+ let name = this.actualSchema.propertyNames[i];
3266
+ if (name == propertyPath) {
3267
+ return this.actualSchema.propertyTypes[i];
3268
+ }
3269
+ }
3270
+ return DataSourceSchemaPropertyType.ObjectValue;
3271
+ }
3272
+ setItemValue(item, valueName, value) {
3273
+ // does nothing.
3274
+ }
3275
+ removeItem(item) {
3276
+ // does nothing.
3277
+ }
3278
+ addItem(item) {
3279
+ // does nothing.
3280
+ }
3281
+ createBatchRequest(changes) {
3282
+ if (this._worker != null) {
3283
+ this._worker.createBatchRequest(changes);
3284
+ }
3285
+ }
3286
+ get batchCompleted() {
3287
+ return this._batchCompleted;
3288
+ }
3289
+ set batchCompleted(v) {
3290
+ this._batchCompleted = v;
3291
+ }
3292
+ }
3293
+ RestVirtualDataSourceDataProvider.$t = /*@__PURE__*/ markType(RestVirtualDataSourceDataProvider, 'ODataVirtualDataSourceDataProvider', Base.$type, [IDataSourceVirtualDataProvider_$type]);
3294
+ return RestVirtualDataSourceDataProvider;
3295
+ })();
3296
+
3297
+ class RestVirtualDataSource extends VirtualDataSource {
3298
+ constructor() {
3299
+ super();
3300
+ this._baseUri = null;
3301
+ this._isFilteringSupportedByServer = false;
3302
+ this._entitySet = null;
3303
+ this._timeoutMilliseconds = 10000;
3304
+ this._isAggregationSupportedByServer = false;
3305
+ this._enableJsonp = true;
3306
+ this._fixedFullCount = -1;
3307
+ this._provideFullCount = null;
3308
+ this._provideOrderByParameter = null;
3309
+ this._provideFilterParameter = null;
3310
+ this._provideAggregationParameter = null;
3311
+ this._provideAggregatedCount = null;
3312
+ this._provideUri = null;
3313
+ this._performFetch = null;
3314
+ this._providePagingParameter = null;
3315
+ this._provideDesiredPropertiesParameter = null;
3316
+ this.dataProvider = ((() => {
3317
+ let $ret = new RestVirtualDataSourceDataProvider();
3318
+ $ret.executionContext = this.executionContext;
3319
+ $ret.enableJsonp = this.enableJsonp;
3320
+ $ret.isAggregationSupported = this.isGroupingSupported;
3321
+ return $ret;
3322
+ })());
3323
+ this.externalDataSource = this;
3324
+ }
3325
+ onBaseUriChanged(oldValue, newValue) {
3326
+ if (this.actualDataProvider) {
3327
+ this.actualDataProvider.baseUri = this.baseUri;
3328
+ this.queueAutoRefresh();
3329
+ }
3330
+ }
3331
+ get baseUri() {
3332
+ return this._baseUri;
3333
+ }
3334
+ set baseUri(value) {
3335
+ let oldValue = this._baseUri;
3336
+ this._baseUri = value;
3337
+ if (oldValue != this._baseUri) {
3338
+ this.onBaseUriChanged(oldValue, this._baseUri);
3339
+ }
3340
+ }
3341
+ onEntitySetChanged(oldValue, newValue) {
3342
+ if (this.actualDataProvider) {
3343
+ this.actualDataProvider.entitySet = this.entitySet;
3344
+ this.queueAutoRefresh();
3345
+ }
3346
+ this.queueAutoRefresh();
3347
+ }
3348
+ set isFilteringSupportedByServer(v) {
3349
+ this._isFilteringSupportedByServer = v;
3350
+ }
3351
+ get isFilteringSupportedByServer() {
3352
+ return this._isFilteringSupportedByServer;
3353
+ }
3354
+ get_isFilteringSupported() {
3355
+ if (this._isFilteringSupportedByServer) {
3356
+ return true;
3357
+ }
3358
+ return false;
3359
+ }
3360
+ get entitySet() {
3361
+ return this._entitySet;
3362
+ }
3363
+ set entitySet(value) {
3364
+ let oldValue = this._entitySet;
3365
+ this._entitySet = value;
3366
+ if (this._entitySet != oldValue) {
3367
+ this.onEntitySetChanged(oldValue, this._entitySet);
3368
+ }
3369
+ }
3370
+ onTimeoutMillisecondsChanged(oldValue, newValue) {
3371
+ if (this.actualDataProvider) {
3372
+ this.actualDataProvider.timeoutMilliseconds = this.timeoutMilliseconds;
3373
+ }
3374
+ }
3375
+ get timeoutMilliseconds() {
3376
+ return this._timeoutMilliseconds;
3377
+ }
3378
+ set timeoutMilliseconds(value) {
3379
+ let oldValue = this._timeoutMilliseconds;
3380
+ this._timeoutMilliseconds = value;
3381
+ if (oldValue != this._timeoutMilliseconds) {
3382
+ this.onTimeoutMillisecondsChanged(oldValue, this._timeoutMilliseconds);
3383
+ }
3384
+ }
3385
+ get isSortingSupportedOverride() {
3386
+ return true;
3387
+ }
3388
+ get isFilteringSupportedOverride() {
3389
+ return true;
3390
+ }
3391
+ get isGroupingSupportedOverride() {
3392
+ return this.isAggregationSupportedByServer;
3393
+ }
3394
+ get isAggregationSupportedByServer() {
3395
+ return this._isAggregationSupportedByServer;
3396
+ }
3397
+ set isAggregationSupportedByServer(isSupported) {
3398
+ this._isAggregationSupportedByServer = isSupported;
3399
+ if (this.actualDataProvider) {
3400
+ this.actualDataProvider.isAggregationSupported = this.isAggregationSupportedByServer;
3401
+ }
3402
+ }
3403
+ get enableJsonp() {
3404
+ return this._enableJsonp;
3405
+ }
3406
+ set enableJsonp(isEnabled) {
3407
+ this._enableJsonp = isEnabled;
3408
+ if (this.actualDataProvider) {
3409
+ this.actualDataProvider.enableJsonp = this.enableJsonp;
3410
+ }
3411
+ }
3412
+ get fixedFullCount() {
3413
+ return this._fixedFullCount;
3414
+ }
3415
+ set fixedFullCount(value) {
3416
+ this._fixedFullCount = value;
3417
+ }
3418
+ get provideFullCount() {
3419
+ return this._provideFullCount;
3420
+ }
3421
+ set provideFullCount(value) {
3422
+ this._provideFullCount = value;
3423
+ if (this.actualDataProvider) {
3424
+ this.actualDataProvider.provideFullCount = this.provideFullCount;
3425
+ this.queueAutoRefresh();
3426
+ }
3427
+ }
3428
+ get provideOrderByParameter() {
3429
+ return this._provideOrderByParameter;
3430
+ }
3431
+ set provideOrderByParameter(value) {
3432
+ this._provideOrderByParameter = value;
3433
+ if (this.actualDataProvider) {
3434
+ this.actualDataProvider.provideOrderByParameter = this.provideOrderByParameter;
3435
+ this.queueAutoRefresh();
3436
+ }
3437
+ }
3438
+ get provideFilterParameter() {
3439
+ return this._provideFilterParameter;
3440
+ }
3441
+ set provideFilterParameter(value) {
3442
+ this._provideFilterParameter = value;
3443
+ if (this.actualDataProvider) {
3444
+ this.actualDataProvider.provideFilterParameter = this.provideFilterParameter;
3445
+ this.queueAutoRefresh();
3446
+ }
3447
+ }
3448
+ get provideAggregationParameter() {
3449
+ return this._provideAggregationParameter;
3450
+ }
3451
+ set provideAggregationParameter(value) {
3452
+ this._provideAggregationParameter = value;
3453
+ if (this.actualDataProvider) {
3454
+ this.actualDataProvider.provideAggregationParameter = this.provideAggregationParameter;
3455
+ this.queueAutoRefresh();
3456
+ }
3457
+ }
3458
+ get provideAggregatedCount() {
3459
+ return this._provideAggregatedCount;
3460
+ }
3461
+ set provideAggregatedCount(value) {
3462
+ this._provideAggregatedCount = value;
3463
+ if (this.actualDataProvider) {
3464
+ this.actualDataProvider.provideAggregatedCount = this.provideAggregatedCount;
3465
+ this.queueAutoRefresh();
3466
+ }
3467
+ }
3468
+ get provideUri() {
3469
+ return this._provideUri;
3470
+ }
3471
+ set provideUri(value) {
3472
+ this._provideUri = value;
3473
+ if (this.actualDataProvider) {
3474
+ this.actualDataProvider.provideUri = this.provideUri;
3475
+ this.queueAutoRefresh();
3476
+ }
3477
+ }
3478
+ get performFetch() {
3479
+ return this._performFetch;
3480
+ }
3481
+ set performFetch(value) {
3482
+ this._performFetch = value;
3483
+ if (this.actualDataProvider) {
3484
+ this.actualDataProvider.performFetch = this.performFetch;
3485
+ this.queueAutoRefresh();
3486
+ }
3487
+ }
3488
+ get providePagingParameter() {
3489
+ return this._providePagingParameter;
3490
+ }
3491
+ set providePagingParameter(value) {
3492
+ this._providePagingParameter = value;
3493
+ if (this.actualDataProvider) {
3494
+ this.actualDataProvider.providePagingParameter = this.providePagingParameter;
3495
+ this.queueAutoRefresh();
3496
+ }
3497
+ }
3498
+ get provideDesiredPropertiesParameter() {
3499
+ return this._provideDesiredPropertiesParameter;
3500
+ }
3501
+ set provideDesiredPropertiesParameter(value) {
3502
+ this._provideDesiredPropertiesParameter = value;
3503
+ if (this.actualDataProvider) {
3504
+ this.actualDataProvider.provideDesiredPropertiesParameter = this.provideDesiredPropertiesParameter;
3505
+ this.queueAutoRefresh();
3506
+ }
3507
+ }
3508
+ get provideItems() {
3509
+ return this._provideItems;
3510
+ }
3511
+ set provideItems(value) {
3512
+ this._provideItems = value;
3513
+ if (this.actualDataProvider) {
3514
+ this.actualDataProvider.provideItems = this.provideItems;
3515
+ this.queueAutoRefresh();
3516
+ }
3517
+ }
3518
+ clone() {
3519
+ let dataSource = new RestVirtualDataSource();
3520
+ dataSource.executionContext = this.executionContext;
3521
+ dataSource.includeSummaryRowsInSection = this.includeSummaryRowsInSection;
3522
+ dataSource.isSectionCollapsable = this.isSectionCollapsable;
3523
+ dataSource.isSectionExpandedDefault = this.isSectionExpandedDefault;
3524
+ //dataSource.isSectionHeaderNormalRow = this.isSectionHeaderNormalRow;
3525
+ dataSource.isSectionSummaryRowsAtBottom = this.isSectionSummaryRowsAtBottom;
3526
+ //dataSource.isSectionContentVisible = this.isSectionContentVisible;
3527
+ dataSource.primaryKey = this.primaryKey;
3528
+ dataSource.propertiesRequested = this.propertiesRequested;
3529
+ dataSource.sectionHeaderDisplayMode = this.sectionHeaderDisplayMode;
3530
+ dataSource.shouldEmitSectionFooters = this.shouldEmitSectionFooters;
3531
+ dataSource.shouldEmitSectionHeaders = this.shouldEmitSectionHeaders;
3532
+ dataSource.shouldEmitShiftedRows = this.shouldEmitShiftedRows;
3533
+ dataSource.summaryScope = this.summaryScope;
3534
+ for (var i = 0; i < this.groupDescriptions.size(); i++) {
3535
+ dataSource.groupDescriptions.add(this.groupDescriptions.get(i));
3536
+ }
3537
+ for (var i = 0; i < this.sortDescriptions.size(); i++) {
3538
+ dataSource.sortDescriptions.add(this.sortDescriptions.get(i));
3539
+ }
3540
+ for (var i = 0; i < this.filterExpressions.size(); i++) {
3541
+ dataSource.filterExpressions.add(this.filterExpressions.get(i));
3542
+ }
3543
+ for (var i = 0; i < this.summaryDescriptions.size(); i++) {
3544
+ dataSource.summaryDescriptions.add(this.summaryDescriptions.get(i));
3545
+ }
3546
+ dataSource.pageSizeRequested = this.pageSizeRequested;
3547
+ dataSource.maxCachedPages = this.maxCachedPages;
3548
+ dataSource.baseUri = this.baseUri;
3549
+ dataSource.entitySet = this.entitySet;
3550
+ dataSource.timeoutMilliseconds = this.timeoutMilliseconds;
3551
+ dataSource.isAggregationSupportedByServer = this.isAggregationSupportedByServer;
3552
+ dataSource.enableJsonp = this.enableJsonp;
3553
+ dataSource.fixedFullCount = this.fixedFullCount;
3554
+ dataSource.provideAggregationParameter = this.provideAggregationParameter;
3555
+ dataSource.provideAggregatedCount = this.provideAggregatedCount;
3556
+ dataSource.provideFilterParameter = this.provideFilterParameter;
3557
+ dataSource.provideFullCount = this.provideFullCount;
3558
+ dataSource.provideOrderByParameter = this.provideOrderByParameter;
3559
+ dataSource.provideUri = this.provideUri;
3560
+ dataSource.performFetch = this.performFetch;
3561
+ dataSource.providePagingParameter = this.providePagingParameter;
3562
+ dataSource.provideItems = this.provideItems;
3563
+ dataSource.provideDesiredPropertiesParameter = this.provideDesiredPropertiesParameter;
3564
+ return dataSource;
3565
+ }
3566
+ }
3567
+
3568
+ export { Entity, EntityProperty, EntitySet, LinkedList, LinkedListNode, ODataDataSourcePage, ODataSchemaProvider, ODataVirtualDataSource, ODataVirtualDataSourceDataProvider, ODataVirtualDataSourceDataProviderWorker, ODataVirtualDataSourceDataProviderWorkerSettings, ODataVirtualDataSourceProviderTaskDataHolder, RestVirtualDataSource, RestVirtualDataSourceDataProvider, RestVirtualDataSourceDataProviderWorker, RestVirtualDataSourceDataProviderWorkerSettings, RestVirtualDataSourcePage, RestVirtualDataSourceProviderTaskDataHolder, Schema, first, toArray };