igniteui-webcomponents-datasources 7.1.1-beta.1 → 7.1.1-beta.3

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 (74) hide show
  1. package/esm2022/lib/ODataSchemaProvider.js +120 -0
  2. package/esm2022/lib/ODataVirtualDataSourceDataProvider.js +450 -0
  3. package/esm2022/lib/ODataVirtualDataSourceDataProviderWorker.js +710 -0
  4. package/esm2022/lib/ODataVirtualDataSourceDataProviderWorkerSettings.js +83 -0
  5. package/esm2022/lib/ODataVirtualDataSourceProviderTaskDataHolder.js +6 -0
  6. package/esm2022/lib/RestVirtualDataSourceDataProvider.js +535 -0
  7. package/esm2022/lib/RestVirtualDataSourceDataProviderWorker.js +762 -0
  8. package/esm2022/lib/RestVirtualDataSourceDataProviderWorkerSettings.js +159 -0
  9. package/esm2022/lib/RestVirtualDataSourceProviderTaskDataHolder.js +6 -0
  10. package/package.json +14 -10
  11. package/bundles/igniteui-webcomponents-datasources.umd.js +0 -4725
  12. package/bundles/igniteui-webcomponents-datasources.umd.min.js +0 -7
  13. package/esm2015/igniteui-webcomponents-datasources.js +0 -1
  14. package/esm2015/lib/ODataSchemaProvider.js +0 -123
  15. package/esm2015/lib/ODataVirtualDataSourceDataProvider.js +0 -453
  16. package/esm2015/lib/ODataVirtualDataSourceDataProviderWorker.js +0 -713
  17. package/esm2015/lib/ODataVirtualDataSourceDataProviderWorkerSettings.js +0 -86
  18. package/esm2015/lib/ODataVirtualDataSourceProviderTaskDataHolder.js +0 -9
  19. package/esm2015/lib/RestVirtualDataSourceDataProvider.js +0 -538
  20. package/esm2015/lib/RestVirtualDataSourceDataProviderWorker.js +0 -765
  21. package/esm2015/lib/RestVirtualDataSourceDataProviderWorkerSettings.js +0 -162
  22. package/esm2015/lib/RestVirtualDataSourceProviderTaskDataHolder.js +0 -9
  23. package/esm5/igniteui-webcomponents-datasources.js +0 -1
  24. package/esm5/lib/Entity.js +0 -79
  25. package/esm5/lib/EntityProperty.js +0 -41
  26. package/esm5/lib/EntitySet.js +0 -68
  27. package/esm5/lib/ODataDataSourcePage.js +0 -73
  28. package/esm5/lib/ODataSchemaProvider.js +0 -158
  29. package/esm5/lib/ODataVirtualDataSource.js +0 -169
  30. package/esm5/lib/ODataVirtualDataSourceDataProvider.js +0 -558
  31. package/esm5/lib/ODataVirtualDataSourceDataProviderWorker.js +0 -920
  32. package/esm5/lib/ODataVirtualDataSourceDataProviderWorkerSettings.js +0 -130
  33. package/esm5/lib/ODataVirtualDataSourceProviderTaskDataHolder.js +0 -11
  34. package/esm5/lib/RestVirtualDataSource.js +0 -357
  35. package/esm5/lib/RestVirtualDataSourceDataProvider.js +0 -687
  36. package/esm5/lib/RestVirtualDataSourceDataProviderWorker.js +0 -967
  37. package/esm5/lib/RestVirtualDataSourceDataProviderWorkerSettings.js +0 -250
  38. package/esm5/lib/RestVirtualDataSourcePage.js +0 -73
  39. package/esm5/lib/RestVirtualDataSourceProviderTaskDataHolder.js +0 -11
  40. package/esm5/lib/Schema.js +0 -68
  41. package/esm5/lib/util.js +0 -160
  42. package/esm5/public_api.js +0 -18
  43. package/fesm2015/igniteui-webcomponents-datasources.js +0 -3638
  44. package/fesm5/igniteui-webcomponents-datasources.js +0 -4698
  45. package/igniteui-webcomponents-datasources.d.ts +0 -1
  46. /package/{lib → esm2022/lib}/Entity.d.ts +0 -0
  47. /package/{esm2015 → esm2022}/lib/Entity.js +0 -0
  48. /package/{lib → esm2022/lib}/EntityProperty.d.ts +0 -0
  49. /package/{esm2015 → esm2022}/lib/EntityProperty.js +0 -0
  50. /package/{lib → esm2022/lib}/EntitySet.d.ts +0 -0
  51. /package/{esm2015 → esm2022}/lib/EntitySet.js +0 -0
  52. /package/{lib → esm2022/lib}/ODataDataSourcePage.d.ts +0 -0
  53. /package/{esm2015 → esm2022}/lib/ODataDataSourcePage.js +0 -0
  54. /package/{lib → esm2022/lib}/ODataSchemaProvider.d.ts +0 -0
  55. /package/{lib → esm2022/lib}/ODataVirtualDataSource.d.ts +0 -0
  56. /package/{esm2015 → esm2022}/lib/ODataVirtualDataSource.js +0 -0
  57. /package/{lib → esm2022/lib}/ODataVirtualDataSourceDataProvider.d.ts +0 -0
  58. /package/{lib → esm2022/lib}/ODataVirtualDataSourceDataProviderWorker.d.ts +0 -0
  59. /package/{lib → esm2022/lib}/ODataVirtualDataSourceDataProviderWorkerSettings.d.ts +0 -0
  60. /package/{lib → esm2022/lib}/ODataVirtualDataSourceProviderTaskDataHolder.d.ts +0 -0
  61. /package/{lib → esm2022/lib}/RestVirtualDataSource.d.ts +0 -0
  62. /package/{esm2015 → esm2022}/lib/RestVirtualDataSource.js +0 -0
  63. /package/{lib → esm2022/lib}/RestVirtualDataSourceDataProvider.d.ts +0 -0
  64. /package/{lib → esm2022/lib}/RestVirtualDataSourceDataProviderWorker.d.ts +0 -0
  65. /package/{lib → esm2022/lib}/RestVirtualDataSourceDataProviderWorkerSettings.d.ts +0 -0
  66. /package/{lib → esm2022/lib}/RestVirtualDataSourcePage.d.ts +0 -0
  67. /package/{esm2015 → esm2022}/lib/RestVirtualDataSourcePage.js +0 -0
  68. /package/{lib → esm2022/lib}/RestVirtualDataSourceProviderTaskDataHolder.d.ts +0 -0
  69. /package/{lib → esm2022/lib}/Schema.d.ts +0 -0
  70. /package/{esm2015 → esm2022}/lib/Schema.js +0 -0
  71. /package/{lib → esm2022/lib}/util.d.ts +0 -0
  72. /package/{esm2015 → esm2022}/lib/util.js +0 -0
  73. /package/{public_api.d.ts → esm2022/public_api.d.ts} +0 -0
  74. /package/{esm2015 → esm2022}/public_api.js +0 -0
@@ -1,558 +0,0 @@
1
- import { __extends } from "tslib";
2
- import { Base, runOn, markType } from "igniteui-webcomponents-core";
3
- import { IDataSourceVirtualDataProvider_$type } from "igniteui-webcomponents-core";
4
- import { SortDescriptionCollection } from "igniteui-webcomponents-core";
5
- import { FilterExpressionCollection } from "igniteui-webcomponents-core";
6
- import { LinkedList } from "./util";
7
- import { DataSourcePageRequestPriority } from "igniteui-webcomponents-core";
8
- import { ODataVirtualDataSourceDataProviderWorker } from "./ODataVirtualDataSourceDataProviderWorker";
9
- import { ODataVirtualDataSourceDataProviderWorkerSettings } from "./ODataVirtualDataSourceDataProviderWorkerSettings";
10
- import { DataSourceDataProviderSchemaChangedEventArgs } from "igniteui-webcomponents-core";
11
- import { DataSourceSchemaPropertyType } from "igniteui-webcomponents-core";
12
- import { stringContains } from "igniteui-webcomponents-core";
13
- import { SummaryDescriptionCollection } from "igniteui-webcomponents-core";
14
- export var ODataVirtualDataSourceDataProvider = /** @class */ /*@__PURE__*/ (function (_super) {
15
- __extends(ODataVirtualDataSourceDataProvider, _super);
16
- function ODataVirtualDataSourceDataProvider() {
17
- var _this = _super.call(this) || this;
18
- _this._worker = null;
19
- _this._requests = new LinkedList();
20
- _this._callback = null;
21
- _this._pageLoaded = null;
22
- _this._pageSizeRequested = 50;
23
- _this._baseUri = null;
24
- _this._entitySet = null;
25
- _this._timeoutMilliseconds = 10000;
26
- _this.schemaChanged = null;
27
- _this._currentFullCount = 0;
28
- _this._currentSchema = null;
29
- _this._executionContext = null;
30
- _this._updateNotifier = null;
31
- _this._deferAutoRefresh = false;
32
- _this._sortDescriptions = null;
33
- _this._groupDescriptions = null;
34
- _this._propertiesRequested = null;
35
- _this._schemaIncludedProperties = null;
36
- _this._filterExpressions = null;
37
- _this._summaryDescriptions = null;
38
- _this._enableJsonp = true;
39
- _this._schemaFetchQueued = false;
40
- _this._autoRefreshQueued = false;
41
- _this._batchCompleted = null;
42
- _this._sortDescriptions = new SortDescriptionCollection();
43
- _this._sortDescriptions.onChanged = function () { return _this.sortDescriptions_CollectionChanged(null, null); };
44
- _this._groupDescriptions = new SortDescriptionCollection();
45
- _this._groupDescriptions.onChanged = function () { return _this.groupDescriptions_CollectionChanged(null, null); };
46
- _this._filterExpressions = new FilterExpressionCollection();
47
- _this._filterExpressions.onChanged = function () { return _this.filterExpressions_CollectionChanged(null, null); };
48
- _this._summaryDescriptions = new SummaryDescriptionCollection();
49
- _this._summaryDescriptions.onChanged = function () { return _this.summaryDescriptions_CollectionChanged(null, null); };
50
- return _this;
51
- }
52
- ODataVirtualDataSourceDataProvider.prototype.filterExpressions_CollectionChanged = function (sender, e) {
53
- this.queueAutoRefresh();
54
- };
55
- ODataVirtualDataSourceDataProvider.prototype.sortDescriptions_CollectionChanged = function (sender, e) {
56
- this.queueAutoRefresh();
57
- };
58
- ODataVirtualDataSourceDataProvider.prototype.groupDescriptions_CollectionChanged = function (sender, e) {
59
- this.queueAutoRefresh();
60
- };
61
- ODataVirtualDataSourceDataProvider.prototype.summaryDescriptions_CollectionChanged = function (sender, e) {
62
- this.queueAutoRefresh();
63
- };
64
- ODataVirtualDataSourceDataProvider.prototype.addPageRequest = function (pageIndex, priority) {
65
- if (this.deferAutoRefresh) {
66
- return;
67
- }
68
- if (this._worker != null && this._worker.isShutdown) {
69
- this._worker = null;
70
- this._callback = null;
71
- }
72
- if (this._worker == null) {
73
- this.createWorker();
74
- }
75
- if (priority == DataSourcePageRequestPriority.High) {
76
- this._requests.addFirst(pageIndex);
77
- }
78
- else {
79
- this._requests.addLast(pageIndex);
80
- }
81
- if (!this._worker.addPageRequest(pageIndex, priority)) {
82
- this._worker = null;
83
- this._callback = null;
84
- this.addPageRequest(pageIndex, priority);
85
- }
86
- };
87
- ODataVirtualDataSourceDataProvider.prototype.createWorker = function () {
88
- if (!this.valid()) {
89
- return;
90
- }
91
- this._callback = runOn(this, this.raisePageLoaded);
92
- var settings = this.getWorkerSettings();
93
- this._worker = new ODataVirtualDataSourceDataProviderWorker(settings);
94
- };
95
- ODataVirtualDataSourceDataProvider.prototype.valid = function () {
96
- return this.entitySet != null && this.baseUri != null;
97
- };
98
- ODataVirtualDataSourceDataProvider.prototype.getWorkerSettings = function () {
99
- var _this = this;
100
- return ((function () {
101
- var $ret = new ODataVirtualDataSourceDataProviderWorkerSettings();
102
- $ret.baseUri = _this._baseUri;
103
- $ret.entitySet = _this._entitySet;
104
- $ret.pageSizeRequested = _this._pageSizeRequested;
105
- $ret.timeoutMilliseconds = _this._timeoutMilliseconds;
106
- $ret.pageLoaded = _this._callback;
107
- $ret.batchCompleted = _this._batchCompleted;
108
- $ret.executionContext = _this._executionContext;
109
- $ret.sortDescriptions = _this._sortDescriptions;
110
- $ret.groupDescriptions = _this._groupDescriptions;
111
- $ret.filterExpressions = _this._filterExpressions;
112
- $ret.propertiesRequested = _this._propertiesRequested;
113
- $ret.schemaIncludedProperties = _this._schemaIncludedProperties;
114
- $ret.summaryDescriptions = _this._summaryDescriptions;
115
- $ret.summaryScope = _this._summaryScope;
116
- $ret.enableJsonp = _this._enableJsonp;
117
- $ret.isAggregationSupported = _this.isAggregationSupported;
118
- return $ret;
119
- })());
120
- };
121
- ODataVirtualDataSourceDataProvider.prototype.removePageRequest = function (pageIndex) {
122
- var current = this._requests.first;
123
- while (current != null) {
124
- if (current.value == pageIndex) {
125
- this._requests.remove(current);
126
- }
127
- current = current.next;
128
- }
129
- if (this._worker == null) {
130
- return;
131
- }
132
- this._worker.removePageRequest(pageIndex);
133
- };
134
- ODataVirtualDataSourceDataProvider.prototype.removeAllPageRequests = function () {
135
- this._requests.clear();
136
- if (this._worker == null) {
137
- return;
138
- }
139
- this._worker.removeAllPageRequests();
140
- };
141
- ODataVirtualDataSourceDataProvider.prototype.close = function () {
142
- if (this._worker != null) {
143
- this._worker.shutdown();
144
- this._worker = null;
145
- this._callback = null;
146
- }
147
- };
148
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "pageLoaded", {
149
- get: function () {
150
- return this._pageLoaded;
151
- },
152
- set: function (value) {
153
- this._pageLoaded = value;
154
- this.queueAutoRefresh();
155
- },
156
- enumerable: false,
157
- configurable: true
158
- });
159
- ODataVirtualDataSourceDataProvider.prototype.raisePageLoaded = function (page, fullCount, actualPageSize) {
160
- if (this._pageLoaded != null) {
161
- this._currentFullCount = fullCount;
162
- if (this._currentSchema == null) {
163
- var currentSchema = null;
164
- if (page != null) {
165
- currentSchema = page.schema();
166
- }
167
- this._currentSchema = currentSchema;
168
- if (this.schemaChanged != null) {
169
- this.schemaChanged(this, new DataSourceDataProviderSchemaChangedEventArgs(this._currentSchema, this._currentFullCount));
170
- }
171
- }
172
- if (page.pageIndex() != ODataVirtualDataSourceDataProviderWorker.schemaRequestIndex) {
173
- this._pageLoaded(page, fullCount, actualPageSize);
174
- }
175
- }
176
- };
177
- ODataVirtualDataSourceDataProvider.prototype.killWorker = function () {
178
- if (this._worker != null) {
179
- this._worker.shutdown();
180
- this._worker = null;
181
- this._callback = null;
182
- }
183
- };
184
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "pageSizeRequested", {
185
- get: function () {
186
- return this._pageSizeRequested;
187
- },
188
- set: function (value) {
189
- this._pageSizeRequested = value;
190
- this.queueAutoRefresh();
191
- },
192
- enumerable: false,
193
- configurable: true
194
- });
195
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "baseUri", {
196
- get: function () {
197
- return this._baseUri;
198
- },
199
- set: function (value) {
200
- var oldValue = this._baseUri;
201
- this._baseUri = value;
202
- if (oldValue != this._baseUri) {
203
- this.queueAutoRefresh();
204
- if (this.valid() && this.deferAutoRefresh) {
205
- this.queueSchemaFetch();
206
- }
207
- }
208
- },
209
- enumerable: false,
210
- configurable: true
211
- });
212
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "entitySet", {
213
- get: function () {
214
- return this._entitySet;
215
- },
216
- set: function (value) {
217
- var oldValue = this._entitySet;
218
- this._entitySet = value;
219
- if (oldValue != this._entitySet) {
220
- this.queueAutoRefresh();
221
- if (this.valid() && this.deferAutoRefresh) {
222
- this.queueSchemaFetch();
223
- }
224
- }
225
- },
226
- enumerable: false,
227
- configurable: true
228
- });
229
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "timeoutMilliseconds", {
230
- get: function () {
231
- return this._timeoutMilliseconds;
232
- },
233
- set: function (value) {
234
- this._timeoutMilliseconds = value;
235
- this.queueAutoRefresh();
236
- },
237
- enumerable: false,
238
- configurable: true
239
- });
240
- ODataVirtualDataSourceDataProvider.prototype.getItemValue = function (item, valueName) {
241
- var dic = item;
242
- if (dic.has(valueName)) {
243
- return dic.get(valueName);
244
- }
245
- else {
246
- return null;
247
- }
248
- };
249
- ODataVirtualDataSourceDataProvider.prototype.setItemValue = function (item, valueName, value) {
250
- // does nothing for virtual data.
251
- };
252
- ODataVirtualDataSourceDataProvider.prototype.removeItem = function (item) {
253
- // does nothing for virtual data.
254
- };
255
- ODataVirtualDataSourceDataProvider.prototype.addItem = function (item) {
256
- // does nothing for virtual data.
257
- };
258
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "actualCount", {
259
- get: function () {
260
- return this._currentFullCount;
261
- },
262
- enumerable: false,
263
- configurable: true
264
- });
265
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "actualSchema", {
266
- get: function () {
267
- return this._currentSchema;
268
- },
269
- enumerable: false,
270
- configurable: true
271
- });
272
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "executionContext", {
273
- get: function () {
274
- return this._executionContext;
275
- },
276
- set: function (value) {
277
- this._executionContext = value;
278
- this.queueAutoRefresh();
279
- },
280
- enumerable: false,
281
- configurable: true
282
- });
283
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "updateNotifier", {
284
- get: function () {
285
- return this._updateNotifier;
286
- },
287
- set: function (value) {
288
- this._updateNotifier = value;
289
- },
290
- enumerable: false,
291
- configurable: true
292
- });
293
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "deferAutoRefresh", {
294
- get: function () {
295
- return this._deferAutoRefresh;
296
- },
297
- set: function (value) {
298
- this._deferAutoRefresh = value;
299
- if (!this._deferAutoRefresh) {
300
- this.queueAutoRefresh();
301
- }
302
- if (this._deferAutoRefresh && this.valid() && this._currentSchema == null) {
303
- this.queueSchemaFetch();
304
- }
305
- },
306
- enumerable: false,
307
- configurable: true
308
- });
309
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "isSortingSupported", {
310
- get: function () {
311
- return true;
312
- },
313
- enumerable: false,
314
- configurable: true
315
- });
316
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "isGroupingSupported", {
317
- get: function () {
318
- return this.isAggregationSupported;
319
- },
320
- enumerable: false,
321
- configurable: true
322
- });
323
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "isFilteringSupported", {
324
- get: function () {
325
- return true;
326
- },
327
- enumerable: false,
328
- configurable: true
329
- });
330
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "isAggregationSupported", {
331
- get: function () {
332
- return this._isAggregationSupported;
333
- },
334
- set: function (isSupported) {
335
- this._isAggregationSupported = isSupported;
336
- },
337
- enumerable: false,
338
- configurable: true
339
- });
340
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "sortDescriptions", {
341
- get: function () {
342
- return this._sortDescriptions;
343
- },
344
- enumerable: false,
345
- configurable: true
346
- });
347
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "groupDescriptions", {
348
- get: function () {
349
- return this._groupDescriptions;
350
- },
351
- enumerable: false,
352
- configurable: true
353
- });
354
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "propertiesRequested", {
355
- get: function () {
356
- return this._propertiesRequested;
357
- },
358
- set: function (value) {
359
- this._propertiesRequested = value;
360
- this.queueAutoRefresh();
361
- },
362
- enumerable: false,
363
- configurable: true
364
- });
365
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "schemaIncludedProperties", {
366
- get: function () {
367
- return this._schemaIncludedProperties;
368
- },
369
- set: function (value) {
370
- this._schemaIncludedProperties = value;
371
- this.queueAutoRefresh();
372
- },
373
- enumerable: false,
374
- configurable: true
375
- });
376
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "filterExpressions", {
377
- get: function () {
378
- return this._filterExpressions;
379
- },
380
- enumerable: false,
381
- configurable: true
382
- });
383
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "summaryDescriptions", {
384
- get: function () {
385
- return this._summaryDescriptions;
386
- },
387
- enumerable: false,
388
- configurable: true
389
- });
390
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "summaryScope", {
391
- get: function () {
392
- return this._summaryScope;
393
- },
394
- set: function (value) {
395
- this._summaryScope = value;
396
- },
397
- enumerable: false,
398
- configurable: true
399
- });
400
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "enableJsonp", {
401
- get: function () {
402
- return this._enableJsonp;
403
- },
404
- set: function (isEnabled) {
405
- this._enableJsonp = isEnabled;
406
- },
407
- enumerable: false,
408
- configurable: true
409
- });
410
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "notifyUsingSourceIndexes", {
411
- get: function () {
412
- return true;
413
- },
414
- enumerable: false,
415
- configurable: true
416
- });
417
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "isItemIndexLookupSupported", {
418
- get: function () {
419
- return false;
420
- },
421
- enumerable: false,
422
- configurable: true
423
- });
424
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "isKeyIndexLookupSupported", {
425
- get: function () {
426
- return false;
427
- },
428
- enumerable: false,
429
- configurable: true
430
- });
431
- ODataVirtualDataSourceDataProvider.prototype.notifySetItem = function (index, oldItem, newItem) {
432
- if (this.updateNotifier != null) {
433
- this.updateNotifier.notifySetItem(index, oldItem, newItem);
434
- }
435
- };
436
- ODataVirtualDataSourceDataProvider.prototype.notifyClearItems = function () {
437
- if (this.updateNotifier != null) {
438
- this.updateNotifier.notifyClearItems();
439
- }
440
- };
441
- ODataVirtualDataSourceDataProvider.prototype.notifyInsertItem = function (index, newItem) {
442
- if (this.updateNotifier != null) {
443
- this.updateNotifier.notifyInsertItem(index, newItem);
444
- }
445
- };
446
- ODataVirtualDataSourceDataProvider.prototype.notifyRemoveItem = function (index, oldItem) {
447
- if (this.updateNotifier != null) {
448
- this.updateNotifier.notifyRemoveItem(index, oldItem);
449
- }
450
- };
451
- ODataVirtualDataSourceDataProvider.prototype.queueSchemaFetch = function () {
452
- if (this._schemaFetchQueued) {
453
- return;
454
- }
455
- if (this.executionContext != null) {
456
- this._schemaFetchQueued = true;
457
- this.executionContext.enqueueAction(runOn(this, this.doSchemaFetchInternal));
458
- }
459
- };
460
- ODataVirtualDataSourceDataProvider.prototype.doSchemaFetchInternal = function () {
461
- if (!this._schemaFetchQueued) {
462
- return;
463
- }
464
- this._schemaFetchQueued = false;
465
- this.schemaFetchInternal();
466
- };
467
- ODataVirtualDataSourceDataProvider.prototype.schemaFetchInternal = function () {
468
- this.schemaFetchInternalOverride();
469
- };
470
- ODataVirtualDataSourceDataProvider.prototype.schemaFetchInternalOverride = function () {
471
- if (!this.deferAutoRefresh) {
472
- return;
473
- }
474
- this.removeAllPageRequests();
475
- this.killWorker();
476
- this.createWorker();
477
- this.addSchemaRequest();
478
- };
479
- ODataVirtualDataSourceDataProvider.prototype.addSchemaRequest = function () {
480
- this._worker.addPageRequest(ODataVirtualDataSourceDataProviderWorker.schemaRequestIndex, DataSourcePageRequestPriority.High);
481
- };
482
- ODataVirtualDataSourceDataProvider.prototype.queueAutoRefresh = function () {
483
- if (this.deferAutoRefresh) {
484
- return;
485
- }
486
- if (this._autoRefreshQueued) {
487
- return;
488
- }
489
- if (this.executionContext != null) {
490
- this._autoRefreshQueued = true;
491
- this.executionContext.enqueueAction(runOn(this, this.doRefreshInternal));
492
- }
493
- };
494
- ODataVirtualDataSourceDataProvider.prototype.doRefreshInternal = function () {
495
- if (this.deferAutoRefresh) {
496
- this._autoRefreshQueued = false;
497
- return;
498
- }
499
- if (!this._autoRefreshQueued) {
500
- return;
501
- }
502
- this._autoRefreshQueued = false;
503
- this.refreshInternal();
504
- };
505
- ODataVirtualDataSourceDataProvider.prototype.refreshInternal = function () {
506
- this.refreshInternalOverride();
507
- };
508
- ODataVirtualDataSourceDataProvider.prototype.refreshInternalOverride = function () {
509
- this.removeAllPageRequests();
510
- this.killWorker();
511
- this.createWorker();
512
- this._worker.addPageRequest(0, DataSourcePageRequestPriority.Normal);
513
- };
514
- ODataVirtualDataSourceDataProvider.prototype.flushAutoRefresh = function () {
515
- this.doRefreshInternal();
516
- };
517
- ODataVirtualDataSourceDataProvider.prototype.refresh = function () {
518
- this.refreshInternal();
519
- };
520
- ODataVirtualDataSourceDataProvider.prototype.indexOfItem = function (item) {
521
- return -1;
522
- };
523
- ODataVirtualDataSourceDataProvider.prototype.indexOfKey = function (key) {
524
- return -1;
525
- };
526
- ODataVirtualDataSourceDataProvider.prototype.resolveSchemaPropertyType = function (propertyPath) {
527
- if (this.actualSchema == null) {
528
- return DataSourceSchemaPropertyType.ObjectValue;
529
- }
530
- if (stringContains(propertyPath, ".")) {
531
- return DataSourceSchemaPropertyType.ObjectValue;
532
- }
533
- for (var i = 0; i < this.actualSchema.propertyNames.length; i++) {
534
- var name_1 = this.actualSchema.propertyNames[i];
535
- if (name_1 == propertyPath) {
536
- return this.actualSchema.propertyTypes[i];
537
- }
538
- }
539
- return DataSourceSchemaPropertyType.ObjectValue;
540
- };
541
- ODataVirtualDataSourceDataProvider.prototype.createBatchRequest = function (changes) {
542
- if (this._worker) {
543
- this._worker.createBatchRequest(changes);
544
- }
545
- };
546
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "batchCompleted", {
547
- get: function () {
548
- return this._batchCompleted;
549
- },
550
- set: function (value) {
551
- this._batchCompleted = value;
552
- },
553
- enumerable: false,
554
- configurable: true
555
- });
556
- ODataVirtualDataSourceDataProvider.$t = markType(ODataVirtualDataSourceDataProvider, 'ODataVirtualDataSourceDataProvider', Base.$type, [IDataSourceVirtualDataProvider_$type]);
557
- return ODataVirtualDataSourceDataProvider;
558
- }(Base));