igniteui-webcomponents-datasources 7.1.1-beta.0 → 7.1.1-beta.2

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 (66) hide show
  1. package/fesm2022/igniteui-webcomponents-datasources.mjs +3611 -0
  2. package/igniteui-webcomponents-datasources.d.ts +754 -1
  3. package/package.json +13 -9
  4. package/bundles/igniteui-webcomponents-datasources.umd.js +0 -4725
  5. package/bundles/igniteui-webcomponents-datasources.umd.min.js +0 -7
  6. package/esm2015/igniteui-webcomponents-datasources.js +0 -1
  7. package/esm2015/lib/Entity.js +0 -65
  8. package/esm2015/lib/EntityProperty.js +0 -27
  9. package/esm2015/lib/EntitySet.js +0 -50
  10. package/esm2015/lib/ODataDataSourcePage.js +0 -67
  11. package/esm2015/lib/ODataSchemaProvider.js +0 -123
  12. package/esm2015/lib/ODataVirtualDataSource.js +0 -132
  13. package/esm2015/lib/ODataVirtualDataSourceDataProvider.js +0 -453
  14. package/esm2015/lib/ODataVirtualDataSourceDataProviderWorker.js +0 -713
  15. package/esm2015/lib/ODataVirtualDataSourceDataProviderWorkerSettings.js +0 -86
  16. package/esm2015/lib/ODataVirtualDataSourceProviderTaskDataHolder.js +0 -9
  17. package/esm2015/lib/RestVirtualDataSource.js +0 -272
  18. package/esm2015/lib/RestVirtualDataSourceDataProvider.js +0 -538
  19. package/esm2015/lib/RestVirtualDataSourceDataProviderWorker.js +0 -765
  20. package/esm2015/lib/RestVirtualDataSourceDataProviderWorkerSettings.js +0 -162
  21. package/esm2015/lib/RestVirtualDataSourcePage.js +0 -67
  22. package/esm2015/lib/RestVirtualDataSourceProviderTaskDataHolder.js +0 -9
  23. package/esm2015/lib/Schema.js +0 -54
  24. package/esm2015/lib/util.js +0 -116
  25. package/esm2015/public_api.js +0 -18
  26. package/esm5/igniteui-webcomponents-datasources.js +0 -1
  27. package/esm5/lib/Entity.js +0 -79
  28. package/esm5/lib/EntityProperty.js +0 -41
  29. package/esm5/lib/EntitySet.js +0 -68
  30. package/esm5/lib/ODataDataSourcePage.js +0 -73
  31. package/esm5/lib/ODataSchemaProvider.js +0 -158
  32. package/esm5/lib/ODataVirtualDataSource.js +0 -169
  33. package/esm5/lib/ODataVirtualDataSourceDataProvider.js +0 -558
  34. package/esm5/lib/ODataVirtualDataSourceDataProviderWorker.js +0 -920
  35. package/esm5/lib/ODataVirtualDataSourceDataProviderWorkerSettings.js +0 -130
  36. package/esm5/lib/ODataVirtualDataSourceProviderTaskDataHolder.js +0 -11
  37. package/esm5/lib/RestVirtualDataSource.js +0 -357
  38. package/esm5/lib/RestVirtualDataSourceDataProvider.js +0 -687
  39. package/esm5/lib/RestVirtualDataSourceDataProviderWorker.js +0 -967
  40. package/esm5/lib/RestVirtualDataSourceDataProviderWorkerSettings.js +0 -250
  41. package/esm5/lib/RestVirtualDataSourcePage.js +0 -73
  42. package/esm5/lib/RestVirtualDataSourceProviderTaskDataHolder.js +0 -11
  43. package/esm5/lib/Schema.js +0 -68
  44. package/esm5/lib/util.js +0 -160
  45. package/esm5/public_api.js +0 -18
  46. package/fesm2015/igniteui-webcomponents-datasources.js +0 -3638
  47. package/fesm5/igniteui-webcomponents-datasources.js +0 -4698
  48. package/lib/Entity.d.ts +0 -14
  49. package/lib/EntityProperty.d.ts +0 -12
  50. package/lib/EntitySet.d.ts +0 -15
  51. package/lib/ODataDataSourcePage.d.ts +0 -19
  52. package/lib/ODataSchemaProvider.d.ts +0 -12
  53. package/lib/ODataVirtualDataSource.d.ts +0 -28
  54. package/lib/ODataVirtualDataSourceDataProvider.d.ts +0 -120
  55. package/lib/ODataVirtualDataSourceDataProviderWorker.d.ts +0 -57
  56. package/lib/ODataVirtualDataSourceDataProviderWorkerSettings.d.ts +0 -42
  57. package/lib/ODataVirtualDataSourceProviderTaskDataHolder.d.ts +0 -5
  58. package/lib/RestVirtualDataSource.d.ts +0 -86
  59. package/lib/RestVirtualDataSourceDataProvider.d.ts +0 -171
  60. package/lib/RestVirtualDataSourceDataProviderWorker.d.ts +0 -70
  61. package/lib/RestVirtualDataSourceDataProviderWorkerSettings.d.ts +0 -93
  62. package/lib/RestVirtualDataSourcePage.d.ts +0 -19
  63. package/lib/RestVirtualDataSourceProviderTaskDataHolder.d.ts +0 -5
  64. package/lib/Schema.d.ts +0 -15
  65. package/lib/util.d.ts +0 -27
  66. package/public_api.d.ts +0 -18
@@ -1,4725 +0,0 @@
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
- (function (global, factory) {
9
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('igniteui-webcomponents-core'), require('tslib')) :
10
- typeof define === 'function' && define.amd ? define(['exports', 'igniteui-webcomponents-core', 'tslib'], factory) :
11
- (global = global || self, factory(global['igniteui-webcomponents-datasources'] = {}, global.igniteuiWebcomponentsCore, global.tslib));
12
- }(this, (function (exports, igniteuiWebcomponentsCore, tslib) { 'use strict';
13
-
14
- var EntityProperty = /** @class */ /*@__PURE__*/ (function () {
15
- function EntityProperty(name, schemaType) {
16
- this._name = null;
17
- this._isNullable = false;
18
- this._type = null;
19
- this.name = name;
20
- this.type = schemaType;
21
- }
22
- Object.defineProperty(EntityProperty.prototype, "name", {
23
- get: function () {
24
- return this._name;
25
- },
26
- set: function (value) {
27
- this._name = value;
28
- },
29
- enumerable: false,
30
- configurable: true
31
- });
32
- Object.defineProperty(EntityProperty.prototype, "isNullable", {
33
- get: function () {
34
- return this._isNullable;
35
- },
36
- set: function (value) {
37
- this._isNullable = value;
38
- },
39
- enumerable: false,
40
- configurable: true
41
- });
42
- Object.defineProperty(EntityProperty.prototype, "type", {
43
- get: function () {
44
- return this._type;
45
- },
46
- set: function (value) {
47
- this._type = value;
48
- },
49
- enumerable: false,
50
- configurable: true
51
- });
52
- return EntityProperty;
53
- }());
54
-
55
- function toArray(en) {
56
- return Array.from(igniteuiWebcomponentsCore.fromEnum(en));
57
- }
58
- function first(iter) {
59
- var e_1, _a;
60
- try {
61
- for (var iter_1 = tslib.__values(iter), iter_1_1 = iter_1.next(); !iter_1_1.done; iter_1_1 = iter_1.next()) {
62
- var v = iter_1_1.value;
63
- return v;
64
- }
65
- }
66
- catch (e_1_1) {
67
- e_1 = { error: e_1_1 };
68
- }
69
- finally {
70
- try {
71
- if (iter_1_1 && !iter_1_1.done && (_a = iter_1.return))
72
- _a.call(iter_1);
73
- }
74
- finally {
75
- if (e_1)
76
- throw e_1.error;
77
- }
78
- }
79
- throw new Error("Iterable contained no elements, expected at least one");
80
- }
81
- var LinkedList = /** @class */ /*@__PURE__*/ (function () {
82
- function LinkedList() {
83
- }
84
- Object.defineProperty(LinkedList.prototype, "first", {
85
- get: function () {
86
- return this._first;
87
- },
88
- enumerable: false,
89
- configurable: true
90
- });
91
- Object.defineProperty(LinkedList.prototype, "last", {
92
- get: function () {
93
- return this._last;
94
- },
95
- enumerable: false,
96
- configurable: true
97
- });
98
- LinkedList.prototype.addFirst = function (item) {
99
- if (this._first == null) {
100
- this._first = new LinkedListNode(item);
101
- this._last = this._first;
102
- }
103
- else {
104
- var oldFirst = this._first;
105
- this._first = new LinkedListNode(item);
106
- this._first.next = oldFirst;
107
- oldFirst.prev = this._first;
108
- }
109
- };
110
- LinkedList.prototype.addLast = function (item) {
111
- if (this._last == null) {
112
- this._first = new LinkedListNode(item);
113
- this._last = this._first;
114
- }
115
- else {
116
- var oldLast = this._last;
117
- this._last = new LinkedListNode(item);
118
- this._last.prev = oldLast;
119
- oldLast.next = this._last;
120
- }
121
- };
122
- LinkedList.prototype.removeFirst = function () {
123
- this.remove(this.first);
124
- };
125
- LinkedList.prototype.clear = function () {
126
- this._first = null;
127
- this._last = null;
128
- };
129
- LinkedList.prototype.contains = function (value) {
130
- var curr = this.first;
131
- while (curr != null) {
132
- if (curr.value === value) {
133
- return true;
134
- }
135
- curr = curr.next;
136
- }
137
- return false;
138
- };
139
- LinkedList.prototype.removeValue = function (value) {
140
- var curr = this.first;
141
- while (curr != null) {
142
- if (curr.value === value) {
143
- this.remove(curr);
144
- return;
145
- }
146
- curr = curr.next;
147
- }
148
- };
149
- LinkedList.prototype.remove = function (node) {
150
- if (this._first == node) {
151
- this._first = node.next;
152
- if (node.next != null) {
153
- node.next.prev = null;
154
- }
155
- }
156
- if (this._last == node) {
157
- this._last = node.prev;
158
- if (node.prev != null) {
159
- node.prev.next = null;
160
- }
161
- }
162
- if (node.prev != null) {
163
- node.prev.next = node.next;
164
- }
165
- if (node.next != null) {
166
- node.next.prev = node.prev;
167
- }
168
- node.next = null;
169
- node.prev = null;
170
- };
171
- return LinkedList;
172
- }());
173
- var LinkedListNode = /** @class */ /*@__PURE__*/ (function () {
174
- function LinkedListNode(item) {
175
- if (item !== undefined) {
176
- this.value = item;
177
- }
178
- }
179
- Object.defineProperty(LinkedListNode.prototype, "value", {
180
- get: function () {
181
- return this._value;
182
- },
183
- set: function (value) {
184
- this._value = value;
185
- },
186
- enumerable: false,
187
- configurable: true
188
- });
189
- Object.defineProperty(LinkedListNode.prototype, "prev", {
190
- get: function () {
191
- return this._prev;
192
- },
193
- set: function (value) {
194
- this._prev = value;
195
- },
196
- enumerable: false,
197
- configurable: true
198
- });
199
- Object.defineProperty(LinkedListNode.prototype, "next", {
200
- get: function () {
201
- return this._next;
202
- },
203
- set: function (value) {
204
- this._next = value;
205
- },
206
- enumerable: false,
207
- configurable: true
208
- });
209
- return LinkedListNode;
210
- }());
211
-
212
- var Entity = /** @class */ /*@__PURE__*/ (function () {
213
- function Entity(name, entityNode) {
214
- this._properties = null;
215
- this._primaryKey = null;
216
- this._name = null;
217
- this.name = name;
218
- this.loadProperties(entityNode);
219
- this.loadPrimaryKey(entityNode);
220
- }
221
- Object.defineProperty(Entity.prototype, "name", {
222
- get: function () {
223
- return this._name;
224
- },
225
- set: function (value) {
226
- this._name = value;
227
- },
228
- enumerable: false,
229
- configurable: true
230
- });
231
- Object.defineProperty(Entity.prototype, "properties", {
232
- get: function () {
233
- if (null == this._properties) {
234
- this._properties = new Map();
235
- }
236
- return this._properties;
237
- },
238
- enumerable: false,
239
- configurable: true
240
- });
241
- Object.defineProperty(Entity.prototype, "primaryKey", {
242
- get: function () {
243
- if (null == this._primaryKey) {
244
- this._primaryKey = [];
245
- }
246
- return this._primaryKey;
247
- },
248
- enumerable: false,
249
- configurable: true
250
- });
251
- Entity.prototype.loadProperties = function (entityNode) {
252
- var children = toArray(entityNode.elements());
253
- var elementCount = children.length;
254
- var nameAttr = igniteuiWebcomponentsCore.XName.get("Name", "");
255
- var typeAttr = igniteuiWebcomponentsCore.XName.get("Type", "");
256
- for (var i = 0; i < elementCount; i++) {
257
- var node = children[i];
258
- if (node.name.localName == "Property") {
259
- var name_1 = node.attribute(nameAttr).value;
260
- var type = node.attribute(typeAttr).value;
261
- this.properties.set(name_1, new EntityProperty(name_1, type));
262
- }
263
- }
264
- ;
265
- };
266
- Entity.prototype.loadPrimaryKey = function (entityNode) {
267
- var children = toArray(entityNode.elements());
268
- var elementCount = children.length;
269
- var nameAttr = igniteuiWebcomponentsCore.XName.get("Name", "");
270
- for (var i = 0; i < elementCount; i++) {
271
- var node = children[i];
272
- if (node.name.localName == "Key") {
273
- var subChildren = toArray(node.elements());
274
- var keyNodeCOunt = subChildren.length;
275
- for (var j = 0; j < keyNodeCOunt; j++) {
276
- var keyNode = subChildren[j];
277
- if (keyNode.name.localName == "PropertyRef") {
278
- this.primaryKey.push(keyNode.attribute(nameAttr).value);
279
- }
280
- }
281
- }
282
- }
283
- ;
284
- };
285
- return Entity;
286
- }());
287
-
288
- var EntitySet = /** @class */ /*@__PURE__*/ (function () {
289
- function EntitySet(name, entityType) {
290
- this._entityName = null;
291
- this._entityNamespace = null;
292
- this._entityType = null;
293
- this._name = null;
294
- this.name = name;
295
- this.entityType = entityType;
296
- if (entityType.indexOf(".") >= 0) {
297
- var parts = entityType.split('.');
298
- if (parts.length == 2) {
299
- this.entityNamespace = parts[0];
300
- this.entityName = parts[1];
301
- }
302
- else {
303
- var i = entityType.lastIndexOf('.');
304
- this.entityNamespace = entityType.substr(0, i);
305
- this.entityName = entityType.substr(i + 1);
306
- }
307
- }
308
- else {
309
- this.entityNamespace = entityType;
310
- this.entityName = entityType;
311
- }
312
- }
313
- Object.defineProperty(EntitySet.prototype, "entityName", {
314
- get: function () {
315
- return this._entityName;
316
- },
317
- set: function (value) {
318
- this._entityName = value;
319
- },
320
- enumerable: false,
321
- configurable: true
322
- });
323
- Object.defineProperty(EntitySet.prototype, "entityNamespace", {
324
- get: function () {
325
- return this._entityNamespace;
326
- },
327
- set: function (value) {
328
- this._entityNamespace = value;
329
- },
330
- enumerable: false,
331
- configurable: true
332
- });
333
- Object.defineProperty(EntitySet.prototype, "entityType", {
334
- get: function () {
335
- return this._entityType;
336
- },
337
- set: function (value) {
338
- this._entityType = value;
339
- },
340
- enumerable: false,
341
- configurable: true
342
- });
343
- Object.defineProperty(EntitySet.prototype, "name", {
344
- get: function () {
345
- return this._name;
346
- },
347
- set: function (value) {
348
- this._name = value;
349
- },
350
- enumerable: false,
351
- configurable: true
352
- });
353
- return EntitySet;
354
- }());
355
-
356
- var ODataDataSourcePage = /** @class */ /*@__PURE__*/ (function () {
357
- function ODataDataSourcePage(sourceData_, schema, groupInformation, summaryInformation, pageIndex) {
358
- this._actualData = null;
359
- this._schema = null;
360
- this._pageIndex = 0;
361
- this._groupInformation = null;
362
- this._summaryInformation = null;
363
- if (sourceData_ == null) {
364
- this._actualData = null;
365
- }
366
- else {
367
- var count = (sourceData_.value.length);
368
- this._actualData = [];
369
- var dateProps = new Set();
370
- for (var i = 0; i < schema.propertyNames.length; i++) {
371
- if (schema.propertyTypes[i] == igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.DateTimeValue || schema.propertyTypes[i] == igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.DateTimeOffsetValue) {
372
- dateProps.add(schema.propertyNames[i]);
373
- }
374
- }
375
- var value_ = void 0;
376
- var _loop_1 = function (i_) {
377
- var currItem_ = sourceData_.value[i_];
378
- var dict = new Map();
379
- var properties = Array.from(Object.keys(currItem_));
380
- var values = (properties.map(function (k) { return currItem_[k]; }));
381
- for (var i1 = 0; i1 < properties.length; i1++) {
382
- value_ = values[i1];
383
- if (dateProps.has(properties[i1])) {
384
- value_ = new Date(value_);
385
- }
386
- dict.set(properties[i1], value_);
387
- }
388
- this_1._actualData[i_] = dict;
389
- };
390
- var this_1 = this;
391
- for (var i_ = 0; i_ < count; i_++) {
392
- _loop_1(i_);
393
- }
394
- }
395
- this._schema = schema;
396
- this._groupInformation = groupInformation;
397
- this._summaryInformation = summaryInformation;
398
- this._pageIndex = pageIndex;
399
- }
400
- ODataDataSourcePage.prototype.count = function () {
401
- return this._actualData.length;
402
- };
403
- ODataDataSourcePage.prototype.getItemAtIndex = function (index) {
404
- return this._actualData[index];
405
- };
406
- ODataDataSourcePage.prototype.getItemValueAtIndex = function (index, valueName) {
407
- var item = this._actualData[index];
408
- if (!item.has(valueName)) {
409
- return null;
410
- }
411
- return item.get(valueName);
412
- };
413
- ODataDataSourcePage.prototype.pageIndex = function () {
414
- return this._pageIndex;
415
- };
416
- ODataDataSourcePage.prototype.schema = function () {
417
- return this._schema;
418
- };
419
- ODataDataSourcePage.prototype.getGroupInformation = function () {
420
- return this._groupInformation;
421
- };
422
- ODataDataSourcePage.prototype.getSummaryInformation = function () {
423
- return this._summaryInformation;
424
- };
425
- return ODataDataSourcePage;
426
- }());
427
-
428
- var Schema = /** @class */ /*@__PURE__*/ (function () {
429
- function Schema(namespace, entityTypeElements, entitySetElements) {
430
- this._entities = null;
431
- this._entitySets = null;
432
- this._namespace = null;
433
- this.namespace = namespace;
434
- this.loadEntities(entityTypeElements);
435
- this.loadEntitySets(entitySetElements);
436
- }
437
- Object.defineProperty(Schema.prototype, "entities", {
438
- get: function () {
439
- if (null == this._entities) {
440
- this._entities = new Map();
441
- }
442
- return this._entities;
443
- },
444
- enumerable: false,
445
- configurable: true
446
- });
447
- Object.defineProperty(Schema.prototype, "entitySets", {
448
- get: function () {
449
- if (null == this._entitySets) {
450
- this._entitySets = new Map();
451
- }
452
- return this._entitySets;
453
- },
454
- enumerable: false,
455
- configurable: true
456
- });
457
- Object.defineProperty(Schema.prototype, "namespace", {
458
- get: function () {
459
- return this._namespace;
460
- },
461
- set: function (value) {
462
- this._namespace = value;
463
- },
464
- enumerable: false,
465
- configurable: true
466
- });
467
- Schema.prototype.loadEntities = function (entityTypeElements) {
468
- var list = entityTypeElements;
469
- var elementCount = list.length;
470
- var name = igniteuiWebcomponentsCore.XName.get("Name", "");
471
- for (var i = 0; i < elementCount; i++) {
472
- var node = list[i];
473
- var entity = new Entity(node.attribute(name).value, node);
474
- this.entities.set(entity.name, entity);
475
- }
476
- ;
477
- };
478
- Schema.prototype.loadEntitySets = function (entitySetElements) {
479
- var list = entitySetElements;
480
- var elementCount = list.length;
481
- var nameAttr = igniteuiWebcomponentsCore.XName.get("Name", "");
482
- var entityType = igniteuiWebcomponentsCore.XName.get("EntityType", "");
483
- for (var i = 0; i < elementCount; i++) {
484
- var node = list[i];
485
- var entitySet = new EntitySet(node.attribute(nameAttr).value, node.attribute(entityType).value);
486
- this.entitySets.set(entitySet.name, entitySet);
487
- }
488
- ;
489
- };
490
- return Schema;
491
- }());
492
-
493
- var ODataSchemaProvider = /** @class */ /*@__PURE__*/ (function () {
494
- function ODataSchemaProvider(metadataDocument) {
495
- this._entityTypeSchemaNamespace = null;
496
- this._entitySetSchemaNamespace = null;
497
- this._schema = null;
498
- if (null == metadataDocument) {
499
- return;
500
- }
501
- var xmlDoc = igniteuiWebcomponentsCore.XDocument.parse(metadataDocument);
502
- var schemaElements = toArray(first(igniteuiWebcomponentsCore.fromEnum(first(igniteuiWebcomponentsCore.fromEnum(xmlDoc.elements())).elements())).elements1(igniteuiWebcomponentsCore.XName.get("Schema", ODataSchemaProvider.nS.namespaceName)));
503
- if (null == schemaElements) {
504
- return;
505
- }
506
- var entitySetElements = null;
507
- var entityTypeElements = null;
508
- var elementCount = schemaElements.length;
509
- var entityContainer = igniteuiWebcomponentsCore.XName.get("EntityContainer", ODataSchemaProvider.nS.namespaceName);
510
- var entitySet = igniteuiWebcomponentsCore.XName.get("EntitySet", ODataSchemaProvider.nS.namespaceName);
511
- var namespaceAttribute = igniteuiWebcomponentsCore.XName.get("Namespace", "");
512
- var entityType = igniteuiWebcomponentsCore.XName.get("EntityType", ODataSchemaProvider.nS.namespaceName);
513
- for (var i = 0; i < elementCount; i++) {
514
- var node = schemaElements[i];
515
- if (node.nodeType != igniteuiWebcomponentsCore.XmlNodeType.Element) {
516
- continue;
517
- }
518
- var schemaElement = schemaElements[i];
519
- if (null == entitySetElements) {
520
- var nodes = toArray(schemaElement.elements1(entityContainer));
521
- if (null != nodes && nodes.length > 0) {
522
- entitySetElements = toArray((igniteuiWebcomponentsCore.typeCast(igniteuiWebcomponentsCore.XElement.$type, nodes[0])).elements1(entitySet));
523
- if (null != entitySetElements) {
524
- this._entitySetSchemaNamespace = schemaElement.attribute(namespaceAttribute).value;
525
- }
526
- }
527
- }
528
- if (null == entityTypeElements) {
529
- entityTypeElements = toArray(schemaElement.elements1(entityType));
530
- if (null != entityTypeElements) {
531
- this._entityTypeSchemaNamespace = schemaElement.attribute(namespaceAttribute).value;
532
- }
533
- }
534
- }
535
- if (null == entitySetElements || null == entityTypeElements) {
536
- return;
537
- }
538
- this.schema = new Schema(this._entityTypeSchemaNamespace, entityTypeElements, entitySetElements);
539
- }
540
- Object.defineProperty(ODataSchemaProvider.prototype, "schema", {
541
- get: function () {
542
- return this._schema;
543
- },
544
- set: function (value) {
545
- this._schema = value;
546
- },
547
- enumerable: false,
548
- configurable: true
549
- });
550
- ODataSchemaProvider.prototype.getODataDataSourceSchema = function (entitySet) {
551
- var e_1, _a, e_2, _b;
552
- if (this.schema == null) {
553
- return null;
554
- }
555
- var valueNames = [];
556
- var valueTypes = [];
557
- var primaryKey = [];
558
- var es = this.schema.entitySets.get(entitySet);
559
- if (null != es) {
560
- var entity = this.schema.entities.get(es.entityName);
561
- if (null != entity) {
562
- try {
563
- for (var _c = tslib.__values(entity.properties.values()), _d = _c.next(); !_d.done; _d = _c.next()) {
564
- var property = _d.value;
565
- valueNames.push(property.name);
566
- if (property.type == "Edm.String") {
567
- valueTypes.push(igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.StringValue);
568
- }
569
- else if (property.type == "Edm.Int16" || property.type == "Edm.Int32") {
570
- valueTypes.push(igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.IntValue);
571
- }
572
- else if (property.type == "Edm.Double") {
573
- valueTypes.push(igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.DoubleValue);
574
- }
575
- else if (property.type == "Edm.Single") {
576
- valueTypes.push(igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.SingleValue);
577
- }
578
- else if (property.type == "Edm.Boolean") {
579
- valueTypes.push(igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.BooleanValue);
580
- }
581
- else if (property.type == "Edm.Byte") {
582
- valueTypes.push(igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.ShortValue);
583
- }
584
- else if (property.type == "Edm.DateTime" || property.type == "Edm.DateTimeOffset") {
585
- valueTypes.push(igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.DateTimeValue);
586
- }
587
- else if (property.type == "Edm.Int64") {
588
- valueTypes.push(igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.LongValue);
589
- }
590
- else if (property.type == "Edm.Decimal") {
591
- valueTypes.push(igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.DecimalValue);
592
- }
593
- else if (property.type == "Edm.SByte") {
594
- valueTypes.push(igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.ShortValue);
595
- }
596
- else {
597
- valueTypes.push(igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.ObjectValue);
598
- }
599
- }
600
- }
601
- catch (e_1_1) {
602
- e_1 = { error: e_1_1 };
603
- }
604
- finally {
605
- try {
606
- if (_d && !_d.done && (_a = _c.return))
607
- _a.call(_c);
608
- }
609
- finally {
610
- if (e_1)
611
- throw e_1.error;
612
- }
613
- }
614
- try {
615
- for (var _e = tslib.__values(entity.primaryKey), _f = _e.next(); !_f.done; _f = _e.next()) {
616
- var k = _f.value;
617
- primaryKey.push(k);
618
- }
619
- }
620
- catch (e_2_1) {
621
- e_2 = { error: e_2_1 };
622
- }
623
- finally {
624
- try {
625
- if (_f && !_f.done && (_b = _e.return))
626
- _b.call(_e);
627
- }
628
- finally {
629
- if (e_2)
630
- throw e_2.error;
631
- }
632
- }
633
- }
634
- }
635
- return new igniteuiWebcomponentsCore.ODataDataSourceSchema(valueNames, valueTypes, primaryKey);
636
- };
637
- ODataSchemaProvider.nS = igniteuiWebcomponentsCore.XNamespace.get("http://docs.oasis-open.org/odata/ns/edm");
638
- return ODataSchemaProvider;
639
- }());
640
-
641
- var ODataVirtualDataSourceProviderTaskDataHolder = /** @class */ /*@__PURE__*/ (function (_super) {
642
- tslib.__extends(ODataVirtualDataSourceProviderTaskDataHolder, _super);
643
- function ODataVirtualDataSourceProviderTaskDataHolder() {
644
- return _super !== null && _super.apply(this, arguments) || this;
645
- }
646
- ODataVirtualDataSourceProviderTaskDataHolder.$t = igniteuiWebcomponentsCore.markType(ODataVirtualDataSourceProviderTaskDataHolder, 'ODataVirtualDataSourceProviderTaskDataHolder', igniteuiWebcomponentsCore.AsyncVirtualDataSourceProviderTaskDataHolder.$type);
647
- return ODataVirtualDataSourceProviderTaskDataHolder;
648
- }(igniteuiWebcomponentsCore.AsyncVirtualDataSourceProviderTaskDataHolder));
649
-
650
- var ODataVirtualDataSourceDataProviderWorker = /** @class */ /*@__PURE__*/ (function (_super) {
651
- tslib.__extends(ODataVirtualDataSourceDataProviderWorker, _super);
652
- function ODataVirtualDataSourceDataProviderWorker(settings) {
653
- var e_1, _a;
654
- var _this = _super.call(this, settings) || this;
655
- _this._baseUri = null;
656
- _this._entitySet = null;
657
- _this._sortDescriptions = null;
658
- _this._groupDescriptions = null;
659
- _this._filterExpressions = null;
660
- _this._summaryDescriptions = null;
661
- _this._desiredPropeties = null;
662
- _this._schemaIncludedProperties = null;
663
- _this._enableJsonp = true;
664
- _this._isAggregationSupported = false;
665
- _this._groupInformation = null;
666
- _this._summaryInformation = null;
667
- _this._filterString = null;
668
- _this._selectedString = null;
669
- _this.doWork = _this.doWork.bind(_this);
670
- _this._baseUri = settings.baseUri;
671
- _this._entitySet = settings.entitySet;
672
- _this._sortDescriptions = settings.sortDescriptions;
673
- _this._groupDescriptions = settings.groupDescriptions;
674
- if (_this._groupDescriptions != null && _this._groupDescriptions.size() > 0) {
675
- _this._sortDescriptions = new igniteuiWebcomponentsCore.SortDescriptionCollection();
676
- try {
677
- for (var _b = tslib.__values(_this.iter(settings.sortDescriptions)), _c = _b.next(); !_c.done; _c = _b.next()) {
678
- var sd = _c.value;
679
- _this._sortDescriptions.add(sd);
680
- }
681
- }
682
- catch (e_1_1) {
683
- e_1 = { error: e_1_1 };
684
- }
685
- finally {
686
- try {
687
- if (_c && !_c.done && (_a = _b.return))
688
- _a.call(_b);
689
- }
690
- finally {
691
- if (e_1)
692
- throw e_1.error;
693
- }
694
- }
695
- for (var i = 0; i < _this._groupDescriptions.size(); i++) {
696
- _this._sortDescriptions.insert(i, _this._groupDescriptions.get(i));
697
- }
698
- }
699
- _this._filterExpressions = settings.filterExpressions;
700
- _this._desiredPropeties = settings.propertiesRequested;
701
- if (settings.schemaIncludedProperties != null) {
702
- _this._schemaIncludedProperties = new Set();
703
- for (var i = 0; i < settings.schemaIncludedProperties.length; i++) {
704
- _this._schemaIncludedProperties.add(settings.schemaIncludedProperties[i]);
705
- }
706
- }
707
- _this._summaryDescriptions = settings.summaryDescriptions;
708
- _this._summaryScope = settings.summaryScope;
709
- _this._enableJsonp = settings.enableJsonp;
710
- _this._isAggregationSupported = settings.isAggregationSupported;
711
- window.setTimeout(_this.doWork, 100);
712
- return _this;
713
- }
714
- Object.defineProperty(ODataVirtualDataSourceDataProviderWorker.prototype, "sortDescriptions", {
715
- get: function () {
716
- return this._sortDescriptions;
717
- },
718
- enumerable: false,
719
- configurable: true
720
- });
721
- Object.defineProperty(ODataVirtualDataSourceDataProviderWorker.prototype, "filterExpressions", {
722
- get: function () {
723
- return this._filterExpressions;
724
- },
725
- enumerable: false,
726
- configurable: true
727
- });
728
- Object.defineProperty(ODataVirtualDataSourceDataProviderWorker.prototype, "desiredProperties", {
729
- get: function () {
730
- return this._desiredPropeties;
731
- },
732
- enumerable: false,
733
- configurable: true
734
- });
735
- ODataVirtualDataSourceDataProviderWorker.prototype.initialize = function () {
736
- _super.prototype.initialize.call(this);
737
- };
738
- ODataVirtualDataSourceDataProviderWorker.prototype.getTaskDataHolder = function () {
739
- var holder = new ODataVirtualDataSourceProviderTaskDataHolder();
740
- return holder;
741
- };
742
- ODataVirtualDataSourceDataProviderWorker.prototype.getCompletedTaskData = function (holder, completed) {
743
- _super.prototype.getCompletedTaskData.call(this, holder, completed);
744
- };
745
- ODataVirtualDataSourceDataProviderWorker.prototype.removeCompletedTaskData = function (holder, completed) {
746
- _super.prototype.removeCompletedTaskData.call(this, holder, completed);
747
- };
748
- ODataVirtualDataSourceDataProviderWorker.prototype.getTasksData = function (holder) {
749
- _super.prototype.getTasksData.call(this, holder);
750
- };
751
- ODataVirtualDataSourceDataProviderWorker.prototype.iter = function (coll) {
752
- var i;
753
- return tslib.__generator(this, function (_a) {
754
- switch (_a.label) {
755
- case 0:
756
- i = 0;
757
- _a.label = 1;
758
- case 1:
759
- if (!(i < coll.size()))
760
- return [3 /*break*/, 4];
761
- return [4 /*yield*/, coll.get(i)];
762
- case 2:
763
- _a.sent();
764
- _a.label = 3;
765
- case 3:
766
- i++;
767
- return [3 /*break*/, 1];
768
- case 4: return [2 /*return*/];
769
- }
770
- });
771
- };
772
- ODataVirtualDataSourceDataProviderWorker.prototype.iterFilter = function (coll) {
773
- var i;
774
- return tslib.__generator(this, function (_a) {
775
- switch (_a.label) {
776
- case 0:
777
- i = 0;
778
- _a.label = 1;
779
- case 1:
780
- if (!(i < coll.size()))
781
- return [3 /*break*/, 4];
782
- return [4 /*yield*/, coll.get(i)];
783
- case 2:
784
- _a.sent();
785
- _a.label = 3;
786
- case 3:
787
- i++;
788
- return [3 /*break*/, 1];
789
- case 4: return [2 /*return*/];
790
- }
791
- });
792
- };
793
- ODataVirtualDataSourceDataProviderWorker.prototype.iterSummaries = function (summaries) {
794
- var i;
795
- return tslib.__generator(this, function (_a) {
796
- switch (_a.label) {
797
- case 0:
798
- i = 0;
799
- _a.label = 1;
800
- case 1:
801
- if (!(i < summaries.size()))
802
- return [3 /*break*/, 4];
803
- return [4 /*yield*/, summaries.get(i)];
804
- case 2:
805
- _a.sent();
806
- _a.label = 3;
807
- case 3:
808
- i++;
809
- return [3 /*break*/, 1];
810
- case 4: return [2 /*return*/];
811
- }
812
- });
813
- };
814
- ODataVirtualDataSourceDataProviderWorker.prototype.processCompletedTask = function (completedTask, currentDelay, pageIndex, taskDataHolder) {
815
- var _this = this;
816
- var h = taskDataHolder;
817
- var schema = null;
818
- var result = null;
819
- var schemaFetchCount = -1;
820
- var task = completedTask.task;
821
- try {
822
- if (task.hasErrors) {
823
- this.retryIndex(pageIndex, currentDelay);
824
- return;
825
- }
826
- if (pageIndex == ODataVirtualDataSourceDataProviderWorker.schemaRequestIndex) {
827
- result = task.result;
828
- schemaFetchCount = (result['@odata.count']);
829
- }
830
- else {
831
- result = task.result;
832
- }
833
- }
834
- catch (e) {
835
- this.retryIndex(pageIndex, currentDelay);
836
- return;
837
- }
838
- if (schemaFetchCount >= 0) {
839
- this.actualCount = schemaFetchCount;
840
- }
841
- else {
842
- this.actualCount = (result['@odata.count']);
843
- }
844
- schema = this.actualSchema;
845
- if (schema == null) {
846
- var requests_1 = 0;
847
- this.resolveSchema(function (s) {
848
- // resolveSchema success callback
849
- _this.actualSchema = s;
850
- if (_this._isAggregationSupported && (_this._groupDescriptions.size() !== 0 || _this._summaryDescriptions.size() !== 0)) {
851
- if (_this._groupDescriptions.size() > 0) {
852
- requests_1++;
853
- _this.resolveGroupInformation(function (g) {
854
- // group info success
855
- requests_1--;
856
- if (requests_1 === 0) {
857
- _this.finishProcessingCompletedTask(task, pageIndex, s, result);
858
- }
859
- }, function () {
860
- // group info failure
861
- _this.retryIndex(pageIndex, currentDelay);
862
- return;
863
- });
864
- }
865
- if (_this._summaryDescriptions.size() > 0) {
866
- requests_1++;
867
- _this.resolveSummaryInformation(function (g) {
868
- // summary info success
869
- requests_1--;
870
- if (requests_1 === 0) {
871
- _this.finishProcessingCompletedTask(task, pageIndex, s, result);
872
- }
873
- }, function () {
874
- // summary info failure
875
- _this.retryIndex(pageIndex, currentDelay);
876
- return;
877
- });
878
- }
879
- }
880
- else {
881
- _this.finishProcessingCompletedTask(task, pageIndex, s, result);
882
- }
883
- }, function () {
884
- // resolveSchema failure callback
885
- _this.retryIndex(pageIndex, currentDelay);
886
- return;
887
- });
888
- return;
889
- }
890
- this.finishProcessingCompletedTask(task, pageIndex, schema, result);
891
- };
892
- ODataVirtualDataSourceDataProviderWorker.prototype.finishProcessingCompletedTask = function (task, pageIndex, schema, result) {
893
- var _this = this;
894
- var executionContext;
895
- var pageLoaded;
896
- var groupInformation;
897
- var summaryInformation;
898
- this.actualSchema = schema;
899
- executionContext = this.executionContext;
900
- groupInformation = this._groupInformation;
901
- summaryInformation = this._summaryInformation;
902
- pageLoaded = this.pageLoaded;
903
- var page = null;
904
- if (result != null) {
905
- page = new ODataDataSourcePage(result, schema, groupInformation, summaryInformation, pageIndex);
906
- if (!this.isLastPage(pageIndex) && page.count() > 0 && !this.populatedActualPageSize) {
907
- this.populatedActualPageSize = true;
908
- this.actualPageSize = page.count();
909
- }
910
- }
911
- else {
912
- page = new ODataDataSourcePage(null, schema, groupInformation, summaryInformation, pageIndex);
913
- }
914
- if (this.pageLoaded != null) {
915
- if (this.executionContext != null) {
916
- if (executionContext == null || pageLoaded == null) {
917
- this.shutdown();
918
- return;
919
- }
920
- executionContext.execute(function () { return pageLoaded(page, _this.actualCount, _this.actualPageSize); });
921
- }
922
- else {
923
- if (pageLoaded == null) {
924
- this.shutdown();
925
- return;
926
- }
927
- pageLoaded(page, this.actualCount, this.actualPageSize);
928
- }
929
- }
930
- };
931
- ODataVirtualDataSourceDataProviderWorker.prototype.resolveGroupInformation = function (finishAction, failureAction) {
932
- var e_2, _a;
933
- var _this = this;
934
- if (this._groupInformation != null) {
935
- finishAction(this._groupInformation);
936
- return;
937
- }
938
- var orderBy = "";
939
- var groupBy = "";
940
- var filter = null;
941
- var summary = "";
942
- if (this._groupDescriptions == null || this._groupDescriptions.size() == 0) {
943
- finishAction(null);
944
- return;
945
- }
946
- filter = this._filterString;
947
- this.updateFilterString();
948
- if (this._groupDescriptions != null) {
949
- var first1 = true;
950
- try {
951
- for (var _b = tslib.__values(this.iter(this._groupDescriptions)), _c = _b.next(); !_c.done; _c = _b.next()) {
952
- var group = _c.value;
953
- if (first1) {
954
- first1 = false;
955
- }
956
- else {
957
- orderBy += ", ";
958
- groupBy += ", ";
959
- }
960
- groupBy += group.propertyName;
961
- if (group.direction === igniteuiWebcomponentsCore.ListSortDirection.Descending) {
962
- orderBy += group.propertyName + " desc";
963
- }
964
- else {
965
- orderBy += group.propertyName + " asc";
966
- }
967
- }
968
- }
969
- catch (e_2_1) {
970
- e_2 = { error: e_2_1 };
971
- }
972
- finally {
973
- try {
974
- if (_c && !_c.done && (_a = _b.return))
975
- _a.call(_b);
976
- }
977
- finally {
978
- if (e_2)
979
- throw e_2.error;
980
- }
981
- }
982
- }
983
- if (this._summaryScope === igniteuiWebcomponentsCore.DataSourceSummaryScope.Both || this._summaryScope === igniteuiWebcomponentsCore.DataSourceSummaryScope.Groups) {
984
- var summaryParameters = this.getSummaryQueryParameters(true);
985
- if (!igniteuiWebcomponentsCore.stringIsNullOrEmpty(summaryParameters)) {
986
- summary = ", " + summaryParameters;
987
- }
988
- }
989
- var commandText = this._entitySet + "?$orderby=" + orderBy + "&$apply=";
990
- if (!igniteuiWebcomponentsCore.stringIsNullOrEmpty(filter)) {
991
- commandText += "filter(" + filter + ")/";
992
- }
993
- commandText += "groupby((" + groupBy + "), aggregate($count as $__count" + summary + "))";
994
- try {
995
- var groupInformation_1 = [];
996
- var success_1 = function (data, response) { return _this.groupSuccess(data, response, finishAction, failureAction, groupInformation_1); };
997
- var failure_1 = function (err) { return _this.groupError(err, finishAction, failureAction, groupInformation_1); };
998
- var run_ = null;
999
- var headers = { 'Content-Type': 'application/json', Accept: 'application/json' };
1000
- var request = {
1001
- requestUri: this._baseUri + "/" + commandText,
1002
- enableJsonpCallback: this._enableJsonp,
1003
- method: 'GET',
1004
- headers: headers,
1005
- data: null
1006
- };
1007
- run_ = function () {
1008
- odatajs.oData.request(request, success_1, failure_1);
1009
- };
1010
- run_();
1011
- }
1012
- catch (e) {
1013
- failureAction();
1014
- }
1015
- };
1016
- ODataVirtualDataSourceDataProviderWorker.prototype.groupError = function (err, finishAction, failureAction, groupInformation) {
1017
- this._groupInformation = null;
1018
- };
1019
- ODataVirtualDataSourceDataProviderWorker.prototype.groupSuccess = function (data, response, finishAction, failureAction, groupInformation) {
1020
- var e_3, _a;
1021
- var groupNames = [];
1022
- try {
1023
- for (var _b = tslib.__values(this.iter(this._groupDescriptions)), _c = _b.next(); !_c.done; _c = _b.next()) {
1024
- var group = _c.value;
1025
- groupNames.push(group.propertyName);
1026
- }
1027
- }
1028
- catch (e_3_1) {
1029
- e_3 = { error: e_3_1 };
1030
- }
1031
- finally {
1032
- try {
1033
- if (_c && !_c.done && (_a = _b.return))
1034
- _a.call(_b);
1035
- }
1036
- finally {
1037
- if (e_3)
1038
- throw e_3.error;
1039
- }
1040
- }
1041
- var groupNamesArray = groupNames;
1042
- if (data && data.value && data.value.length > 0) {
1043
- var currentIndex = 0;
1044
- for (var i = 0; i < data.value.length; i++) {
1045
- this.addGroup(groupInformation, groupNames, groupNames, currentIndex, data.value[i]);
1046
- }
1047
- }
1048
- this._groupInformation = groupInformation;
1049
- finishAction(this._groupInformation);
1050
- };
1051
- ODataVirtualDataSourceDataProviderWorker.prototype.addGroup = function (groupInformation, groupNames, groupNamesArray, currentIndex, group) {
1052
- var e_4, _a;
1053
- var groupValues = [];
1054
- try {
1055
- for (var groupNames_1 = tslib.__values(groupNames), groupNames_1_1 = groupNames_1.next(); !groupNames_1_1.done; groupNames_1_1 = groupNames_1.next()) {
1056
- var name_1 = groupNames_1_1.value;
1057
- if (group[name_1]) {
1058
- groupValues.push(group[name_1]);
1059
- }
1060
- }
1061
- }
1062
- catch (e_4_1) {
1063
- e_4 = { error: e_4_1 };
1064
- }
1065
- finally {
1066
- try {
1067
- if (groupNames_1_1 && !groupNames_1_1.done && (_a = groupNames_1.return))
1068
- _a.call(groupNames_1);
1069
- }
1070
- finally {
1071
- if (e_4)
1072
- throw e_4.error;
1073
- }
1074
- }
1075
- var groupCount = 0;
1076
- if (group["$__count"]) {
1077
- groupCount = igniteuiWebcomponentsCore.Convert.toInt321(group["$__count"]);
1078
- }
1079
- var summaryResults = null;
1080
- if (this._summaryScope == igniteuiWebcomponentsCore.DataSourceSummaryScope.Both || this._summaryScope == igniteuiWebcomponentsCore.DataSourceSummaryScope.Groups) {
1081
- summaryResults = this.createSummaryResults(group);
1082
- }
1083
- var groupInfo = new igniteuiWebcomponentsCore.DefaultSectionInformation(currentIndex, currentIndex + (groupCount - 1), groupNamesArray, groupValues, summaryResults);
1084
- groupInformation.push(groupInfo);
1085
- };
1086
- ODataVirtualDataSourceDataProviderWorker.prototype.resolveSummaryInformation = function (finishAction, failureAction) {
1087
- var _this = this;
1088
- if (this._summaryInformation != null) {
1089
- finishAction(this._summaryInformation);
1090
- return;
1091
- }
1092
- var filter = null;
1093
- var summary = null;
1094
- if (this._summaryDescriptions == null ||
1095
- this._summaryDescriptions.size() == 0 ||
1096
- this._summaryScope == igniteuiWebcomponentsCore.DataSourceSummaryScope.Groups ||
1097
- this._summaryScope == igniteuiWebcomponentsCore.DataSourceSummaryScope.None) {
1098
- finishAction(null);
1099
- return;
1100
- }
1101
- filter = this._filterString;
1102
- this.updateFilterString();
1103
- summary = this.getSummaryQueryParameters(false);
1104
- var commandText = this._entitySet + "?$apply=";
1105
- if (!igniteuiWebcomponentsCore.stringIsNullOrEmpty(filter)) {
1106
- commandText += "filter(" + filter + ")/";
1107
- }
1108
- commandText += "aggregate(" + summary + ")";
1109
- try {
1110
- var summaryInformation_1 = [];
1111
- var success_2 = function (data, response) { return _this.summarySuccess(data, response, finishAction, failureAction, summaryInformation_1); };
1112
- var failure_2 = function (err) { return _this.summaryError(err, finishAction, failureAction, summaryInformation_1); };
1113
- var run_ = null;
1114
- var headers = { 'Content-Type': 'application/json', Accept: 'application/json' };
1115
- var request = {
1116
- requestUri: this._baseUri + "/" + commandText,
1117
- enableJsonpCallback: this._enableJsonp,
1118
- method: 'GET',
1119
- headers: headers,
1120
- data: null
1121
- };
1122
- run_ = function () {
1123
- odatajs.oData.request(request, success_2, failure_2);
1124
- };
1125
- run_();
1126
- }
1127
- catch (e) {
1128
- failureAction();
1129
- }
1130
- };
1131
- ODataVirtualDataSourceDataProviderWorker.prototype.summarySuccess = function (data, response, finishAction, failureAction, summaryInformation) {
1132
- if (data && data.value && data.value.length > 0) {
1133
- summaryInformation = this.createSummaryResults(data.value[0]);
1134
- }
1135
- this._summaryInformation = summaryInformation;
1136
- finishAction(this._summaryInformation);
1137
- };
1138
- ODataVirtualDataSourceDataProviderWorker.prototype.summaryError = function (err, finishAction, failureAction, summaryInformation) {
1139
- this._summaryInformation = null;
1140
- };
1141
- ODataVirtualDataSourceDataProviderWorker.prototype.getSummaryQueryParameters = function (ignoreCount) {
1142
- var e_5, _a;
1143
- var result = "";
1144
- if (this._summaryDescriptions != null) {
1145
- var first = true;
1146
- var countExists = false;
1147
- try {
1148
- for (var _b = tslib.__values(this.iterSummaries(this._summaryDescriptions)), _c = _b.next(); !_c.done; _c = _b.next()) {
1149
- var summary = _c.value;
1150
- if (summary.operand == igniteuiWebcomponentsCore.DataSourceSummaryOperand.Count && (ignoreCount || countExists)) {
1151
- continue;
1152
- }
1153
- if (!first) {
1154
- result += ", ";
1155
- }
1156
- switch (summary.operand) {
1157
- case igniteuiWebcomponentsCore.DataSourceSummaryOperand.Average:
1158
- result += summary.propertyName + " with average as " + summary.propertyName + "Average";
1159
- break;
1160
- case igniteuiWebcomponentsCore.DataSourceSummaryOperand.Min:
1161
- result += summary.propertyName + " with min as " + summary.propertyName + "Min";
1162
- break;
1163
- case igniteuiWebcomponentsCore.DataSourceSummaryOperand.Max:
1164
- result += summary.propertyName + " with max as " + summary.propertyName + "Max";
1165
- break;
1166
- case igniteuiWebcomponentsCore.DataSourceSummaryOperand.Sum:
1167
- result += summary.propertyName + " with sum as " + summary.propertyName + "Sum";
1168
- break;
1169
- case igniteuiWebcomponentsCore.DataSourceSummaryOperand.Count:
1170
- result += "$count as $__count";
1171
- countExists = true;
1172
- break;
1173
- }
1174
- first = false;
1175
- }
1176
- }
1177
- catch (e_5_1) {
1178
- e_5 = { error: e_5_1 };
1179
- }
1180
- finally {
1181
- try {
1182
- if (_c && !_c.done && (_a = _b.return))
1183
- _a.call(_b);
1184
- }
1185
- finally {
1186
- if (e_5)
1187
- throw e_5.error;
1188
- }
1189
- }
1190
- }
1191
- return result;
1192
- };
1193
- ODataVirtualDataSourceDataProviderWorker.prototype.createSummaryResults = function (data) {
1194
- var e_6, _a;
1195
- var summaryResults = [];
1196
- try {
1197
- for (var _b = tslib.__values(this.iterSummaries(this._summaryDescriptions)), _c = _b.next(); !_c.done; _c = _b.next()) {
1198
- var summary = _c.value;
1199
- var summaryName = summary.propertyName;
1200
- switch (summary.operand) {
1201
- case igniteuiWebcomponentsCore.DataSourceSummaryOperand.Average:
1202
- summaryName += "Average";
1203
- break;
1204
- case igniteuiWebcomponentsCore.DataSourceSummaryOperand.Min:
1205
- summaryName += "Min";
1206
- break;
1207
- case igniteuiWebcomponentsCore.DataSourceSummaryOperand.Max:
1208
- summaryName += "Max";
1209
- break;
1210
- case igniteuiWebcomponentsCore.DataSourceSummaryOperand.Sum:
1211
- summaryName += "Sum";
1212
- break;
1213
- case igniteuiWebcomponentsCore.DataSourceSummaryOperand.Count:
1214
- summaryName = "$__count";
1215
- break;
1216
- }
1217
- var summaryValue = null;
1218
- if (data && data[summaryName]) {
1219
- summaryValue = data[summaryName];
1220
- }
1221
- var summaryResult = new igniteuiWebcomponentsCore.DefaultSummaryResult(summary.propertyName, summary.operand, summaryValue);
1222
- summaryResults.push(summaryResult);
1223
- }
1224
- }
1225
- catch (e_6_1) {
1226
- e_6 = { error: e_6_1 };
1227
- }
1228
- finally {
1229
- try {
1230
- if (_c && !_c.done && (_a = _b.return))
1231
- _a.call(_b);
1232
- }
1233
- finally {
1234
- if (e_6)
1235
- throw e_6.error;
1236
- }
1237
- }
1238
- return summaryResults;
1239
- };
1240
- ODataVirtualDataSourceDataProviderWorker.prototype.resolveSchema = function (finishAction, failureAction) {
1241
- var _this = this;
1242
- var success_ = function (res) {
1243
- var sp = new ODataSchemaProvider(res);
1244
- var schema = sp.getODataDataSourceSchema(_this._entitySet);
1245
- if (_this._schemaIncludedProperties != null) {
1246
- var propertyNames = [];
1247
- var propertyTypes = [];
1248
- for (var i = 0; i < schema.propertyNames.length; i++) {
1249
- if (!_this._schemaIncludedProperties.has(schema.propertyNames[i])) {
1250
- continue;
1251
- }
1252
- propertyNames.push(schema.propertyNames[i]);
1253
- propertyTypes.push(schema.propertyTypes[i]);
1254
- }
1255
- schema = new igniteuiWebcomponentsCore.ODataDataSourceSchema(propertyNames, propertyTypes, schema.primaryKey);
1256
- }
1257
- finishAction(schema);
1258
- };
1259
- var failure_ = function () { return failureAction(); };
1260
- var baseUri_ = this._baseUri;
1261
- var request = new XMLHttpRequest();
1262
- request.onreadystatechange = function () {
1263
- if (request.readyState === 4) {
1264
- if (request.status === 200) {
1265
- success_(request.responseText);
1266
- }
1267
- else {
1268
- failure_();
1269
- }
1270
- }
1271
- };
1272
- request.open('Get', baseUri_ + '/$metadata');
1273
- request.send();
1274
- ;
1275
- };
1276
- ODataVirtualDataSourceDataProviderWorker.prototype.makeTaskForRequest = function (request, retryDelay) {
1277
- var e_7, _a;
1278
- var actualPageSize = 0;
1279
- var sortDescriptions = null;
1280
- actualPageSize = this.actualPageSize;
1281
- sortDescriptions = this.sortDescriptions;
1282
- var requestUrl = this._baseUri;
1283
- requestUrl += "/" + this._entitySet;
1284
- var queryStarted = false;
1285
- this.updateFilterString();
1286
- if (this._filterString != null) {
1287
- if (!queryStarted) {
1288
- queryStarted = true;
1289
- requestUrl += "?";
1290
- }
1291
- else {
1292
- requestUrl += "&";
1293
- }
1294
- requestUrl += "$filter=" + this._filterString;
1295
- }
1296
- if (this.sortDescriptions != null) {
1297
- var sortString = null;
1298
- try {
1299
- for (var _b = tslib.__values(this.iter(this.sortDescriptions)), _c = _b.next(); !_c.done; _c = _b.next()) {
1300
- var sort = _c.value;
1301
- if (sortString == null) {
1302
- sortString = "";
1303
- }
1304
- else {
1305
- sortString += ", ";
1306
- }
1307
- if (sort.direction == igniteuiWebcomponentsCore.ListSortDirection.Descending) {
1308
- sortString += sort.propertyName + " desc";
1309
- }
1310
- else {
1311
- sortString += sort.propertyName;
1312
- }
1313
- }
1314
- }
1315
- catch (e_7_1) {
1316
- e_7 = { error: e_7_1 };
1317
- }
1318
- finally {
1319
- try {
1320
- if (_c && !_c.done && (_a = _b.return))
1321
- _a.call(_b);
1322
- }
1323
- finally {
1324
- if (e_7)
1325
- throw e_7.error;
1326
- }
1327
- }
1328
- if (sortString != null) {
1329
- if (!queryStarted) {
1330
- queryStarted = true;
1331
- requestUrl += "?";
1332
- }
1333
- else {
1334
- requestUrl += "&";
1335
- }
1336
- requestUrl += "$orderby=" + sortString;
1337
- }
1338
- }
1339
- if (this.desiredProperties != null && this.desiredProperties.length > 0) {
1340
- var selectString = "";
1341
- var first = true;
1342
- var $t = this.desiredProperties;
1343
- for (var i = 0; i < $t.length; i++) {
1344
- var select = $t[i];
1345
- if (first) {
1346
- first = false;
1347
- }
1348
- else {
1349
- selectString += ", ";
1350
- }
1351
- selectString += select;
1352
- }
1353
- if (!queryStarted) {
1354
- queryStarted = true;
1355
- requestUrl += "?";
1356
- }
1357
- else {
1358
- requestUrl += "&";
1359
- }
1360
- requestUrl += "$select=" + selectString;
1361
- }
1362
- var task = new igniteuiWebcomponentsCore.AsyncVirtualDataTask();
1363
- if (request.index == ODataVirtualDataSourceDataProviderWorker.schemaRequestIndex) {
1364
- this.executeRequest(requestUrl, queryStarted, 0, actualPageSize, task);
1365
- }
1366
- else {
1367
- this.executeRequest(requestUrl, queryStarted, request.index * actualPageSize, actualPageSize, task);
1368
- }
1369
- request.taskHolder = new igniteuiWebcomponentsCore.AsyncDataSourcePageTaskHolder();
1370
- request.taskHolder.task = task;
1371
- this.tasks.add(request);
1372
- };
1373
- ODataVirtualDataSourceDataProviderWorker.prototype.updateFilterString = function () {
1374
- var e_8, _a;
1375
- if (this.filterExpressions != null && this.filterExpressions.size() > 0 && this._filterString == null) {
1376
- var sb = "";
1377
- var first = true;
1378
- try {
1379
- for (var _b = tslib.__values(this.iterFilter(this.filterExpressions)), _c = _b.next(); !_c.done; _c = _b.next()) {
1380
- var expr = _c.value;
1381
- if (first) {
1382
- first = false;
1383
- }
1384
- else {
1385
- sb += " AND ";
1386
- }
1387
- var visitor = new igniteuiWebcomponentsCore.ODataDataSourceFilterExpressionVisitor(0);
1388
- visitor.visit(expr);
1389
- var txt = visitor.toString();
1390
- if (this.filterExpressions.size() > 1) {
1391
- txt = "(" + txt + ")";
1392
- }
1393
- sb += (txt);
1394
- }
1395
- }
1396
- catch (e_8_1) {
1397
- e_8 = { error: e_8_1 };
1398
- }
1399
- finally {
1400
- try {
1401
- if (_c && !_c.done && (_a = _b.return))
1402
- _a.call(_b);
1403
- }
1404
- finally {
1405
- if (e_8)
1406
- throw e_8.error;
1407
- }
1408
- }
1409
- this._filterString = sb;
1410
- }
1411
- };
1412
- ODataVirtualDataSourceDataProviderWorker.prototype.executeRequest = function (requestUrl, queryStarted, skip, top, task) {
1413
- var _this = this;
1414
- if (!queryStarted) {
1415
- queryStarted = true;
1416
- requestUrl += "?";
1417
- }
1418
- else {
1419
- requestUrl += "&";
1420
- }
1421
- requestUrl += "$skip=" + skip + "&$top=" + top + "&$count=true";
1422
- var requestUrl_ = requestUrl;
1423
- var self_ = this;
1424
- var success_ = function (data, response) { return _this.success(task, data, response); };
1425
- var failure_ = function (err) { return _this.error(task, err); };
1426
- var run_ = null;
1427
- var headers = { 'Content-Type': 'application/json', Accept: 'application/json' };
1428
- var request = {
1429
- requestUri: requestUrl_,
1430
- enableJsonpCallback: this._enableJsonp,
1431
- method: 'GET',
1432
- headers: headers,
1433
- data: null
1434
- };
1435
- run_ = function () {
1436
- odatajs.oData.request(request, success_, failure_);
1437
- };
1438
- task.run = run_;
1439
- };
1440
- ODataVirtualDataSourceDataProviderWorker.prototype.success = function (t, data, response) {
1441
- t.result = data;
1442
- t.isCompleted = true;
1443
- };
1444
- ODataVirtualDataSourceDataProviderWorker.prototype.error = function (t, result) {
1445
- t.isCompleted = true;
1446
- t.hasErrors = true;
1447
- };
1448
- ODataVirtualDataSourceDataProviderWorker.prototype.createBatchRequest = function (changes) {
1449
- var requests = [];
1450
- for (var i = 0; i < changes.length; i++) {
1451
- var c = changes[i];
1452
- var headers = { "Content-Type": "application/json", "odata-version": "4.0" };
1453
- if (c.transactionType === igniteuiWebcomponentsCore.TransactionType.Add) {
1454
- requests.push({
1455
- method: "POST",
1456
- id: "r".concat(i),
1457
- atomicityGroup: "g1",
1458
- url: "".concat(this._baseUri, "/").concat(this._entitySet),
1459
- headers: headers,
1460
- body: c.value,
1461
- });
1462
- }
1463
- else if (c.transactionType === igniteuiWebcomponentsCore.TransactionType.Update) {
1464
- if (c.version) {
1465
- headers["If-Match"] = c.version;
1466
- }
1467
- requests.push({
1468
- method: "PATCH",
1469
- id: "r".concat(i),
1470
- atomicityGroup: "g1",
1471
- url: "".concat(this._baseUri, "/").concat(this.getRequestUriWithKey(c.id)),
1472
- headers: headers,
1473
- body: c.value,
1474
- });
1475
- }
1476
- else if (c.transactionType === igniteuiWebcomponentsCore.TransactionType.Delete) {
1477
- if (c.version) {
1478
- headers["If-Match"] = c.version;
1479
- }
1480
- requests.push({
1481
- method: "DELETE",
1482
- id: "r".concat(i),
1483
- atomicityGroup: "g1",
1484
- url: "".concat(this._baseUri, "/").concat(this.getRequestUriWithKey(c.id)),
1485
- headers: headers,
1486
- });
1487
- }
1488
- }
1489
- var request = {
1490
- requestUri: "".concat(this._baseUri, "/$batch"),
1491
- method: "POST",
1492
- headers: { "Content-Type": "application/json" },
1493
- body: JSON.stringify({ requests: requests })
1494
- };
1495
- var self = this;
1496
- odatajs.oData.request(request, function (data) {
1497
- if (data && data.responses) {
1498
- if (data.responses.length > 0) {
1499
- var success = true;
1500
- var messages = [];
1501
- var _loop_1 = function (i) {
1502
- if (data.responses[i].status !== 200 &&
1503
- data.responses[i].status !== 204) {
1504
- success = false;
1505
- var failedRequest = requests.filter(function (r) { return r.id == data.responses[i].id; })[0];
1506
- if (failedRequest) {
1507
- var msg = "".concat(failedRequest.method, " request failed with code ").concat(data.responses[i].status);
1508
- messages.push(msg);
1509
- console.error(msg);
1510
- }
1511
- return "break";
1512
- }
1513
- };
1514
- for (var i = 0; i < data.responses.length; i++) {
1515
- var state_1 = _loop_1(i);
1516
- if (state_1 === "break")
1517
- break;
1518
- }
1519
- if (success) {
1520
- self.batchCompleted(true, true, null);
1521
- }
1522
- else {
1523
- self.batchCompleted(false, true, messages);
1524
- }
1525
- }
1526
- else {
1527
- self.batchCompleted(false, true, null);
1528
- }
1529
- }
1530
- }, function (error) {
1531
- var messages = [];
1532
- if (error && error.message) {
1533
- messages.push(error.message);
1534
- }
1535
- self.batchCompleted(false, true, messages);
1536
- });
1537
- };
1538
- ODataVirtualDataSourceDataProviderWorker.prototype.getRequestUriWithKey = function (key) {
1539
- var result = "";
1540
- var keys = Object.keys(key);
1541
- for (var i = 0; i < keys.length; i++) {
1542
- if (i > 0) {
1543
- result += ",";
1544
- }
1545
- result += "".concat(keys[i], "=").concat(key[keys[i]]);
1546
- }
1547
- return "".concat(this._entitySet, "(").concat(result, ")");
1548
- };
1549
- ODataVirtualDataSourceDataProviderWorker.schemaRequestIndex = -1;
1550
- return ODataVirtualDataSourceDataProviderWorker;
1551
- }(igniteuiWebcomponentsCore.AsyncVirtualDataSourceProviderWorker));
1552
-
1553
- var ODataVirtualDataSourceDataProviderWorkerSettings = /** @class */ /*@__PURE__*/ (function (_super) {
1554
- tslib.__extends(ODataVirtualDataSourceDataProviderWorkerSettings, _super);
1555
- function ODataVirtualDataSourceDataProviderWorkerSettings() {
1556
- var _this = _super !== null && _super.apply(this, arguments) || this;
1557
- _this._baseUri = null;
1558
- _this._entitySet = null;
1559
- _this._sortDescriptions = null;
1560
- _this._filterExpressions = null;
1561
- _this._propertiesRequested = null;
1562
- _this._schemaIncludedProperties = null;
1563
- _this._groupDescriptions = null;
1564
- _this._summaryDescriptions = null;
1565
- return _this;
1566
- }
1567
- Object.defineProperty(ODataVirtualDataSourceDataProviderWorkerSettings.prototype, "baseUri", {
1568
- get: function () {
1569
- return this._baseUri;
1570
- },
1571
- set: function (value) {
1572
- this._baseUri = value;
1573
- },
1574
- enumerable: false,
1575
- configurable: true
1576
- });
1577
- Object.defineProperty(ODataVirtualDataSourceDataProviderWorkerSettings.prototype, "entitySet", {
1578
- get: function () {
1579
- return this._entitySet;
1580
- },
1581
- set: function (value) {
1582
- this._entitySet = value;
1583
- },
1584
- enumerable: false,
1585
- configurable: true
1586
- });
1587
- Object.defineProperty(ODataVirtualDataSourceDataProviderWorkerSettings.prototype, "sortDescriptions", {
1588
- get: function () {
1589
- return this._sortDescriptions;
1590
- },
1591
- set: function (value) {
1592
- this._sortDescriptions = value;
1593
- },
1594
- enumerable: false,
1595
- configurable: true
1596
- });
1597
- Object.defineProperty(ODataVirtualDataSourceDataProviderWorkerSettings.prototype, "filterExpressions", {
1598
- get: function () {
1599
- return this._filterExpressions;
1600
- },
1601
- set: function (value) {
1602
- this._filterExpressions = value;
1603
- },
1604
- enumerable: false,
1605
- configurable: true
1606
- });
1607
- Object.defineProperty(ODataVirtualDataSourceDataProviderWorkerSettings.prototype, "propertiesRequested", {
1608
- get: function () {
1609
- return this._propertiesRequested;
1610
- },
1611
- set: function (value) {
1612
- this._propertiesRequested = value;
1613
- },
1614
- enumerable: false,
1615
- configurable: true
1616
- });
1617
- Object.defineProperty(ODataVirtualDataSourceDataProviderWorkerSettings.prototype, "schemaIncludedProperties", {
1618
- get: function () {
1619
- return this._schemaIncludedProperties;
1620
- },
1621
- set: function (value) {
1622
- this._schemaIncludedProperties = value;
1623
- },
1624
- enumerable: false,
1625
- configurable: true
1626
- });
1627
- Object.defineProperty(ODataVirtualDataSourceDataProviderWorkerSettings.prototype, "groupDescriptions", {
1628
- get: function () {
1629
- return this._groupDescriptions;
1630
- },
1631
- set: function (value) {
1632
- this._groupDescriptions = value;
1633
- },
1634
- enumerable: false,
1635
- configurable: true
1636
- });
1637
- Object.defineProperty(ODataVirtualDataSourceDataProviderWorkerSettings.prototype, "summaryDescriptions", {
1638
- get: function () {
1639
- return this._summaryDescriptions;
1640
- },
1641
- set: function (value) {
1642
- this._summaryDescriptions = value;
1643
- },
1644
- enumerable: false,
1645
- configurable: true
1646
- });
1647
- Object.defineProperty(ODataVirtualDataSourceDataProviderWorkerSettings.prototype, "summaryScope", {
1648
- get: function () {
1649
- return this._summaryscope;
1650
- },
1651
- set: function (value) {
1652
- this._summaryscope = value;
1653
- },
1654
- enumerable: false,
1655
- configurable: true
1656
- });
1657
- Object.defineProperty(ODataVirtualDataSourceDataProviderWorkerSettings.prototype, "enableJsonp", {
1658
- get: function () {
1659
- return this._enableJsonp;
1660
- },
1661
- set: function (isEnabled) {
1662
- this._enableJsonp = isEnabled;
1663
- },
1664
- enumerable: false,
1665
- configurable: true
1666
- });
1667
- Object.defineProperty(ODataVirtualDataSourceDataProviderWorkerSettings.prototype, "isAggregationSupported", {
1668
- get: function () {
1669
- return this._isAggregationSupported;
1670
- },
1671
- set: function (isSupported) {
1672
- this._isAggregationSupported = isSupported;
1673
- },
1674
- enumerable: false,
1675
- configurable: true
1676
- });
1677
- ODataVirtualDataSourceDataProviderWorkerSettings.$t = igniteuiWebcomponentsCore.markType(ODataVirtualDataSourceDataProviderWorkerSettings, 'ODataVirtualDataSourceDataProviderWorkerSettings', igniteuiWebcomponentsCore.AsyncVirtualDataSourceDataProviderWorkerSettings.$type);
1678
- return ODataVirtualDataSourceDataProviderWorkerSettings;
1679
- }(igniteuiWebcomponentsCore.AsyncVirtualDataSourceDataProviderWorkerSettings));
1680
-
1681
- var ODataVirtualDataSourceDataProvider = /** @class */ /*@__PURE__*/ (function (_super) {
1682
- tslib.__extends(ODataVirtualDataSourceDataProvider, _super);
1683
- function ODataVirtualDataSourceDataProvider() {
1684
- var _this = _super.call(this) || this;
1685
- _this._worker = null;
1686
- _this._requests = new LinkedList();
1687
- _this._callback = null;
1688
- _this._pageLoaded = null;
1689
- _this._pageSizeRequested = 50;
1690
- _this._baseUri = null;
1691
- _this._entitySet = null;
1692
- _this._timeoutMilliseconds = 10000;
1693
- _this.schemaChanged = null;
1694
- _this._currentFullCount = 0;
1695
- _this._currentSchema = null;
1696
- _this._executionContext = null;
1697
- _this._updateNotifier = null;
1698
- _this._deferAutoRefresh = false;
1699
- _this._sortDescriptions = null;
1700
- _this._groupDescriptions = null;
1701
- _this._propertiesRequested = null;
1702
- _this._schemaIncludedProperties = null;
1703
- _this._filterExpressions = null;
1704
- _this._summaryDescriptions = null;
1705
- _this._enableJsonp = true;
1706
- _this._schemaFetchQueued = false;
1707
- _this._autoRefreshQueued = false;
1708
- _this._batchCompleted = null;
1709
- _this._sortDescriptions = new igniteuiWebcomponentsCore.SortDescriptionCollection();
1710
- _this._sortDescriptions.onChanged = function () { return _this.sortDescriptions_CollectionChanged(null, null); };
1711
- _this._groupDescriptions = new igniteuiWebcomponentsCore.SortDescriptionCollection();
1712
- _this._groupDescriptions.onChanged = function () { return _this.groupDescriptions_CollectionChanged(null, null); };
1713
- _this._filterExpressions = new igniteuiWebcomponentsCore.FilterExpressionCollection();
1714
- _this._filterExpressions.onChanged = function () { return _this.filterExpressions_CollectionChanged(null, null); };
1715
- _this._summaryDescriptions = new igniteuiWebcomponentsCore.SummaryDescriptionCollection();
1716
- _this._summaryDescriptions.onChanged = function () { return _this.summaryDescriptions_CollectionChanged(null, null); };
1717
- return _this;
1718
- }
1719
- ODataVirtualDataSourceDataProvider.prototype.filterExpressions_CollectionChanged = function (sender, e) {
1720
- this.queueAutoRefresh();
1721
- };
1722
- ODataVirtualDataSourceDataProvider.prototype.sortDescriptions_CollectionChanged = function (sender, e) {
1723
- this.queueAutoRefresh();
1724
- };
1725
- ODataVirtualDataSourceDataProvider.prototype.groupDescriptions_CollectionChanged = function (sender, e) {
1726
- this.queueAutoRefresh();
1727
- };
1728
- ODataVirtualDataSourceDataProvider.prototype.summaryDescriptions_CollectionChanged = function (sender, e) {
1729
- this.queueAutoRefresh();
1730
- };
1731
- ODataVirtualDataSourceDataProvider.prototype.addPageRequest = function (pageIndex, priority) {
1732
- if (this.deferAutoRefresh) {
1733
- return;
1734
- }
1735
- if (this._worker != null && this._worker.isShutdown) {
1736
- this._worker = null;
1737
- this._callback = null;
1738
- }
1739
- if (this._worker == null) {
1740
- this.createWorker();
1741
- }
1742
- if (priority == igniteuiWebcomponentsCore.DataSourcePageRequestPriority.High) {
1743
- this._requests.addFirst(pageIndex);
1744
- }
1745
- else {
1746
- this._requests.addLast(pageIndex);
1747
- }
1748
- if (!this._worker.addPageRequest(pageIndex, priority)) {
1749
- this._worker = null;
1750
- this._callback = null;
1751
- this.addPageRequest(pageIndex, priority);
1752
- }
1753
- };
1754
- ODataVirtualDataSourceDataProvider.prototype.createWorker = function () {
1755
- if (!this.valid()) {
1756
- return;
1757
- }
1758
- this._callback = igniteuiWebcomponentsCore.runOn(this, this.raisePageLoaded);
1759
- var settings = this.getWorkerSettings();
1760
- this._worker = new ODataVirtualDataSourceDataProviderWorker(settings);
1761
- };
1762
- ODataVirtualDataSourceDataProvider.prototype.valid = function () {
1763
- return this.entitySet != null && this.baseUri != null;
1764
- };
1765
- ODataVirtualDataSourceDataProvider.prototype.getWorkerSettings = function () {
1766
- var _this = this;
1767
- return ((function () {
1768
- var $ret = new ODataVirtualDataSourceDataProviderWorkerSettings();
1769
- $ret.baseUri = _this._baseUri;
1770
- $ret.entitySet = _this._entitySet;
1771
- $ret.pageSizeRequested = _this._pageSizeRequested;
1772
- $ret.timeoutMilliseconds = _this._timeoutMilliseconds;
1773
- $ret.pageLoaded = _this._callback;
1774
- $ret.batchCompleted = _this._batchCompleted;
1775
- $ret.executionContext = _this._executionContext;
1776
- $ret.sortDescriptions = _this._sortDescriptions;
1777
- $ret.groupDescriptions = _this._groupDescriptions;
1778
- $ret.filterExpressions = _this._filterExpressions;
1779
- $ret.propertiesRequested = _this._propertiesRequested;
1780
- $ret.schemaIncludedProperties = _this._schemaIncludedProperties;
1781
- $ret.summaryDescriptions = _this._summaryDescriptions;
1782
- $ret.summaryScope = _this._summaryScope;
1783
- $ret.enableJsonp = _this._enableJsonp;
1784
- $ret.isAggregationSupported = _this.isAggregationSupported;
1785
- return $ret;
1786
- })());
1787
- };
1788
- ODataVirtualDataSourceDataProvider.prototype.removePageRequest = function (pageIndex) {
1789
- var current = this._requests.first;
1790
- while (current != null) {
1791
- if (current.value == pageIndex) {
1792
- this._requests.remove(current);
1793
- }
1794
- current = current.next;
1795
- }
1796
- if (this._worker == null) {
1797
- return;
1798
- }
1799
- this._worker.removePageRequest(pageIndex);
1800
- };
1801
- ODataVirtualDataSourceDataProvider.prototype.removeAllPageRequests = function () {
1802
- this._requests.clear();
1803
- if (this._worker == null) {
1804
- return;
1805
- }
1806
- this._worker.removeAllPageRequests();
1807
- };
1808
- ODataVirtualDataSourceDataProvider.prototype.close = function () {
1809
- if (this._worker != null) {
1810
- this._worker.shutdown();
1811
- this._worker = null;
1812
- this._callback = null;
1813
- }
1814
- };
1815
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "pageLoaded", {
1816
- get: function () {
1817
- return this._pageLoaded;
1818
- },
1819
- set: function (value) {
1820
- this._pageLoaded = value;
1821
- this.queueAutoRefresh();
1822
- },
1823
- enumerable: false,
1824
- configurable: true
1825
- });
1826
- ODataVirtualDataSourceDataProvider.prototype.raisePageLoaded = function (page, fullCount, actualPageSize) {
1827
- if (this._pageLoaded != null) {
1828
- this._currentFullCount = fullCount;
1829
- if (this._currentSchema == null) {
1830
- var currentSchema = null;
1831
- if (page != null) {
1832
- currentSchema = page.schema();
1833
- }
1834
- this._currentSchema = currentSchema;
1835
- if (this.schemaChanged != null) {
1836
- this.schemaChanged(this, new igniteuiWebcomponentsCore.DataSourceDataProviderSchemaChangedEventArgs(this._currentSchema, this._currentFullCount));
1837
- }
1838
- }
1839
- if (page.pageIndex() != ODataVirtualDataSourceDataProviderWorker.schemaRequestIndex) {
1840
- this._pageLoaded(page, fullCount, actualPageSize);
1841
- }
1842
- }
1843
- };
1844
- ODataVirtualDataSourceDataProvider.prototype.killWorker = function () {
1845
- if (this._worker != null) {
1846
- this._worker.shutdown();
1847
- this._worker = null;
1848
- this._callback = null;
1849
- }
1850
- };
1851
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "pageSizeRequested", {
1852
- get: function () {
1853
- return this._pageSizeRequested;
1854
- },
1855
- set: function (value) {
1856
- this._pageSizeRequested = value;
1857
- this.queueAutoRefresh();
1858
- },
1859
- enumerable: false,
1860
- configurable: true
1861
- });
1862
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "baseUri", {
1863
- get: function () {
1864
- return this._baseUri;
1865
- },
1866
- set: function (value) {
1867
- var oldValue = this._baseUri;
1868
- this._baseUri = value;
1869
- if (oldValue != this._baseUri) {
1870
- this.queueAutoRefresh();
1871
- if (this.valid() && this.deferAutoRefresh) {
1872
- this.queueSchemaFetch();
1873
- }
1874
- }
1875
- },
1876
- enumerable: false,
1877
- configurable: true
1878
- });
1879
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "entitySet", {
1880
- get: function () {
1881
- return this._entitySet;
1882
- },
1883
- set: function (value) {
1884
- var oldValue = this._entitySet;
1885
- this._entitySet = value;
1886
- if (oldValue != this._entitySet) {
1887
- this.queueAutoRefresh();
1888
- if (this.valid() && this.deferAutoRefresh) {
1889
- this.queueSchemaFetch();
1890
- }
1891
- }
1892
- },
1893
- enumerable: false,
1894
- configurable: true
1895
- });
1896
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "timeoutMilliseconds", {
1897
- get: function () {
1898
- return this._timeoutMilliseconds;
1899
- },
1900
- set: function (value) {
1901
- this._timeoutMilliseconds = value;
1902
- this.queueAutoRefresh();
1903
- },
1904
- enumerable: false,
1905
- configurable: true
1906
- });
1907
- ODataVirtualDataSourceDataProvider.prototype.getItemValue = function (item, valueName) {
1908
- var dic = item;
1909
- if (dic.has(valueName)) {
1910
- return dic.get(valueName);
1911
- }
1912
- else {
1913
- return null;
1914
- }
1915
- };
1916
- ODataVirtualDataSourceDataProvider.prototype.setItemValue = function (item, valueName, value) {
1917
- // does nothing for virtual data.
1918
- };
1919
- ODataVirtualDataSourceDataProvider.prototype.removeItem = function (item) {
1920
- // does nothing for virtual data.
1921
- };
1922
- ODataVirtualDataSourceDataProvider.prototype.addItem = function (item) {
1923
- // does nothing for virtual data.
1924
- };
1925
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "actualCount", {
1926
- get: function () {
1927
- return this._currentFullCount;
1928
- },
1929
- enumerable: false,
1930
- configurable: true
1931
- });
1932
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "actualSchema", {
1933
- get: function () {
1934
- return this._currentSchema;
1935
- },
1936
- enumerable: false,
1937
- configurable: true
1938
- });
1939
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "executionContext", {
1940
- get: function () {
1941
- return this._executionContext;
1942
- },
1943
- set: function (value) {
1944
- this._executionContext = value;
1945
- this.queueAutoRefresh();
1946
- },
1947
- enumerable: false,
1948
- configurable: true
1949
- });
1950
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "updateNotifier", {
1951
- get: function () {
1952
- return this._updateNotifier;
1953
- },
1954
- set: function (value) {
1955
- this._updateNotifier = value;
1956
- },
1957
- enumerable: false,
1958
- configurable: true
1959
- });
1960
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "deferAutoRefresh", {
1961
- get: function () {
1962
- return this._deferAutoRefresh;
1963
- },
1964
- set: function (value) {
1965
- this._deferAutoRefresh = value;
1966
- if (!this._deferAutoRefresh) {
1967
- this.queueAutoRefresh();
1968
- }
1969
- if (this._deferAutoRefresh && this.valid() && this._currentSchema == null) {
1970
- this.queueSchemaFetch();
1971
- }
1972
- },
1973
- enumerable: false,
1974
- configurable: true
1975
- });
1976
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "isSortingSupported", {
1977
- get: function () {
1978
- return true;
1979
- },
1980
- enumerable: false,
1981
- configurable: true
1982
- });
1983
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "isGroupingSupported", {
1984
- get: function () {
1985
- return this.isAggregationSupported;
1986
- },
1987
- enumerable: false,
1988
- configurable: true
1989
- });
1990
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "isFilteringSupported", {
1991
- get: function () {
1992
- return true;
1993
- },
1994
- enumerable: false,
1995
- configurable: true
1996
- });
1997
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "isAggregationSupported", {
1998
- get: function () {
1999
- return this._isAggregationSupported;
2000
- },
2001
- set: function (isSupported) {
2002
- this._isAggregationSupported = isSupported;
2003
- },
2004
- enumerable: false,
2005
- configurable: true
2006
- });
2007
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "sortDescriptions", {
2008
- get: function () {
2009
- return this._sortDescriptions;
2010
- },
2011
- enumerable: false,
2012
- configurable: true
2013
- });
2014
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "groupDescriptions", {
2015
- get: function () {
2016
- return this._groupDescriptions;
2017
- },
2018
- enumerable: false,
2019
- configurable: true
2020
- });
2021
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "propertiesRequested", {
2022
- get: function () {
2023
- return this._propertiesRequested;
2024
- },
2025
- set: function (value) {
2026
- this._propertiesRequested = value;
2027
- this.queueAutoRefresh();
2028
- },
2029
- enumerable: false,
2030
- configurable: true
2031
- });
2032
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "schemaIncludedProperties", {
2033
- get: function () {
2034
- return this._schemaIncludedProperties;
2035
- },
2036
- set: function (value) {
2037
- this._schemaIncludedProperties = value;
2038
- this.queueAutoRefresh();
2039
- },
2040
- enumerable: false,
2041
- configurable: true
2042
- });
2043
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "filterExpressions", {
2044
- get: function () {
2045
- return this._filterExpressions;
2046
- },
2047
- enumerable: false,
2048
- configurable: true
2049
- });
2050
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "summaryDescriptions", {
2051
- get: function () {
2052
- return this._summaryDescriptions;
2053
- },
2054
- enumerable: false,
2055
- configurable: true
2056
- });
2057
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "summaryScope", {
2058
- get: function () {
2059
- return this._summaryScope;
2060
- },
2061
- set: function (value) {
2062
- this._summaryScope = value;
2063
- },
2064
- enumerable: false,
2065
- configurable: true
2066
- });
2067
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "enableJsonp", {
2068
- get: function () {
2069
- return this._enableJsonp;
2070
- },
2071
- set: function (isEnabled) {
2072
- this._enableJsonp = isEnabled;
2073
- },
2074
- enumerable: false,
2075
- configurable: true
2076
- });
2077
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "notifyUsingSourceIndexes", {
2078
- get: function () {
2079
- return true;
2080
- },
2081
- enumerable: false,
2082
- configurable: true
2083
- });
2084
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "isItemIndexLookupSupported", {
2085
- get: function () {
2086
- return false;
2087
- },
2088
- enumerable: false,
2089
- configurable: true
2090
- });
2091
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "isKeyIndexLookupSupported", {
2092
- get: function () {
2093
- return false;
2094
- },
2095
- enumerable: false,
2096
- configurable: true
2097
- });
2098
- ODataVirtualDataSourceDataProvider.prototype.notifySetItem = function (index, oldItem, newItem) {
2099
- if (this.updateNotifier != null) {
2100
- this.updateNotifier.notifySetItem(index, oldItem, newItem);
2101
- }
2102
- };
2103
- ODataVirtualDataSourceDataProvider.prototype.notifyClearItems = function () {
2104
- if (this.updateNotifier != null) {
2105
- this.updateNotifier.notifyClearItems();
2106
- }
2107
- };
2108
- ODataVirtualDataSourceDataProvider.prototype.notifyInsertItem = function (index, newItem) {
2109
- if (this.updateNotifier != null) {
2110
- this.updateNotifier.notifyInsertItem(index, newItem);
2111
- }
2112
- };
2113
- ODataVirtualDataSourceDataProvider.prototype.notifyRemoveItem = function (index, oldItem) {
2114
- if (this.updateNotifier != null) {
2115
- this.updateNotifier.notifyRemoveItem(index, oldItem);
2116
- }
2117
- };
2118
- ODataVirtualDataSourceDataProvider.prototype.queueSchemaFetch = function () {
2119
- if (this._schemaFetchQueued) {
2120
- return;
2121
- }
2122
- if (this.executionContext != null) {
2123
- this._schemaFetchQueued = true;
2124
- this.executionContext.enqueueAction(igniteuiWebcomponentsCore.runOn(this, this.doSchemaFetchInternal));
2125
- }
2126
- };
2127
- ODataVirtualDataSourceDataProvider.prototype.doSchemaFetchInternal = function () {
2128
- if (!this._schemaFetchQueued) {
2129
- return;
2130
- }
2131
- this._schemaFetchQueued = false;
2132
- this.schemaFetchInternal();
2133
- };
2134
- ODataVirtualDataSourceDataProvider.prototype.schemaFetchInternal = function () {
2135
- this.schemaFetchInternalOverride();
2136
- };
2137
- ODataVirtualDataSourceDataProvider.prototype.schemaFetchInternalOverride = function () {
2138
- if (!this.deferAutoRefresh) {
2139
- return;
2140
- }
2141
- this.removeAllPageRequests();
2142
- this.killWorker();
2143
- this.createWorker();
2144
- this.addSchemaRequest();
2145
- };
2146
- ODataVirtualDataSourceDataProvider.prototype.addSchemaRequest = function () {
2147
- this._worker.addPageRequest(ODataVirtualDataSourceDataProviderWorker.schemaRequestIndex, igniteuiWebcomponentsCore.DataSourcePageRequestPriority.High);
2148
- };
2149
- ODataVirtualDataSourceDataProvider.prototype.queueAutoRefresh = function () {
2150
- if (this.deferAutoRefresh) {
2151
- return;
2152
- }
2153
- if (this._autoRefreshQueued) {
2154
- return;
2155
- }
2156
- if (this.executionContext != null) {
2157
- this._autoRefreshQueued = true;
2158
- this.executionContext.enqueueAction(igniteuiWebcomponentsCore.runOn(this, this.doRefreshInternal));
2159
- }
2160
- };
2161
- ODataVirtualDataSourceDataProvider.prototype.doRefreshInternal = function () {
2162
- if (this.deferAutoRefresh) {
2163
- this._autoRefreshQueued = false;
2164
- return;
2165
- }
2166
- if (!this._autoRefreshQueued) {
2167
- return;
2168
- }
2169
- this._autoRefreshQueued = false;
2170
- this.refreshInternal();
2171
- };
2172
- ODataVirtualDataSourceDataProvider.prototype.refreshInternal = function () {
2173
- this.refreshInternalOverride();
2174
- };
2175
- ODataVirtualDataSourceDataProvider.prototype.refreshInternalOverride = function () {
2176
- this.removeAllPageRequests();
2177
- this.killWorker();
2178
- this.createWorker();
2179
- this._worker.addPageRequest(0, igniteuiWebcomponentsCore.DataSourcePageRequestPriority.Normal);
2180
- };
2181
- ODataVirtualDataSourceDataProvider.prototype.flushAutoRefresh = function () {
2182
- this.doRefreshInternal();
2183
- };
2184
- ODataVirtualDataSourceDataProvider.prototype.refresh = function () {
2185
- this.refreshInternal();
2186
- };
2187
- ODataVirtualDataSourceDataProvider.prototype.indexOfItem = function (item) {
2188
- return -1;
2189
- };
2190
- ODataVirtualDataSourceDataProvider.prototype.indexOfKey = function (key) {
2191
- return -1;
2192
- };
2193
- ODataVirtualDataSourceDataProvider.prototype.resolveSchemaPropertyType = function (propertyPath) {
2194
- if (this.actualSchema == null) {
2195
- return igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.ObjectValue;
2196
- }
2197
- if (igniteuiWebcomponentsCore.stringContains(propertyPath, ".")) {
2198
- return igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.ObjectValue;
2199
- }
2200
- for (var i = 0; i < this.actualSchema.propertyNames.length; i++) {
2201
- var name_1 = this.actualSchema.propertyNames[i];
2202
- if (name_1 == propertyPath) {
2203
- return this.actualSchema.propertyTypes[i];
2204
- }
2205
- }
2206
- return igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.ObjectValue;
2207
- };
2208
- ODataVirtualDataSourceDataProvider.prototype.createBatchRequest = function (changes) {
2209
- if (this._worker) {
2210
- this._worker.createBatchRequest(changes);
2211
- }
2212
- };
2213
- Object.defineProperty(ODataVirtualDataSourceDataProvider.prototype, "batchCompleted", {
2214
- get: function () {
2215
- return this._batchCompleted;
2216
- },
2217
- set: function (value) {
2218
- this._batchCompleted = value;
2219
- },
2220
- enumerable: false,
2221
- configurable: true
2222
- });
2223
- ODataVirtualDataSourceDataProvider.$t = igniteuiWebcomponentsCore.markType(ODataVirtualDataSourceDataProvider, 'ODataVirtualDataSourceDataProvider', igniteuiWebcomponentsCore.Base.$type, [igniteuiWebcomponentsCore.IDataSourceVirtualDataProvider_$type]);
2224
- return ODataVirtualDataSourceDataProvider;
2225
- }(igniteuiWebcomponentsCore.Base));
2226
-
2227
- var ODataVirtualDataSource = /** @class */ /*@__PURE__*/ (function (_super) {
2228
- tslib.__extends(ODataVirtualDataSource, _super);
2229
- function ODataVirtualDataSource() {
2230
- var _this = _super.call(this) || this;
2231
- _this._baseUri = null;
2232
- _this._entitySet = null;
2233
- _this._timeoutMilliseconds = 10000;
2234
- _this._isAggregationSupportedByServer = false;
2235
- _this._enableJsonp = true;
2236
- _this.dataProvider = ((function () {
2237
- var $ret = new ODataVirtualDataSourceDataProvider();
2238
- $ret.executionContext = _this.executionContext;
2239
- $ret.enableJsonp = _this.enableJsonp;
2240
- $ret.isAggregationSupported = _this.isGroupingSupported;
2241
- return $ret;
2242
- })());
2243
- _this.externalDataSource = _this;
2244
- return _this;
2245
- }
2246
- ODataVirtualDataSource.prototype.onBaseUriChanged = function (oldValue, newValue) {
2247
- if (igniteuiWebcomponentsCore.typeCast(ODataVirtualDataSourceDataProvider.$type, this.actualDataProvider) !== null) {
2248
- this.actualDataProvider.baseUri = this.baseUri;
2249
- }
2250
- this.queueAutoRefresh();
2251
- };
2252
- Object.defineProperty(ODataVirtualDataSource.prototype, "baseUri", {
2253
- get: function () {
2254
- return this._baseUri;
2255
- },
2256
- set: function (value) {
2257
- var oldValue = this._baseUri;
2258
- this._baseUri = value;
2259
- if (oldValue != this._baseUri) {
2260
- this.onBaseUriChanged(oldValue, this._baseUri);
2261
- }
2262
- },
2263
- enumerable: false,
2264
- configurable: true
2265
- });
2266
- ODataVirtualDataSource.prototype.onEntitySetChanged = function (oldValue, newValue) {
2267
- if (igniteuiWebcomponentsCore.typeCast(ODataVirtualDataSourceDataProvider.$type, this.actualDataProvider) !== null) {
2268
- this.actualDataProvider.entitySet = this.entitySet;
2269
- }
2270
- this.queueAutoRefresh();
2271
- };
2272
- Object.defineProperty(ODataVirtualDataSource.prototype, "entitySet", {
2273
- get: function () {
2274
- return this._entitySet;
2275
- },
2276
- set: function (value) {
2277
- var oldValue = this._entitySet;
2278
- this._entitySet = value;
2279
- if (this._entitySet != oldValue) {
2280
- this.onEntitySetChanged(oldValue, this._entitySet);
2281
- }
2282
- },
2283
- enumerable: false,
2284
- configurable: true
2285
- });
2286
- ODataVirtualDataSource.prototype.onTimeoutMillisecondsChanged = function (oldValue, newValue) {
2287
- if (igniteuiWebcomponentsCore.typeCast(ODataVirtualDataSourceDataProvider.$type, this.actualDataProvider) !== null) {
2288
- this.actualDataProvider.timeoutMilliseconds = this.timeoutMilliseconds;
2289
- }
2290
- };
2291
- Object.defineProperty(ODataVirtualDataSource.prototype, "timeoutMilliseconds", {
2292
- get: function () {
2293
- return this._timeoutMilliseconds;
2294
- },
2295
- set: function (value) {
2296
- var oldValue = this._timeoutMilliseconds;
2297
- this._timeoutMilliseconds = value;
2298
- if (oldValue != this._timeoutMilliseconds) {
2299
- this.onTimeoutMillisecondsChanged(oldValue, this._timeoutMilliseconds);
2300
- }
2301
- },
2302
- enumerable: false,
2303
- configurable: true
2304
- });
2305
- Object.defineProperty(ODataVirtualDataSource.prototype, "isSortingSupportedOverride", {
2306
- get: function () {
2307
- return true;
2308
- },
2309
- enumerable: false,
2310
- configurable: true
2311
- });
2312
- Object.defineProperty(ODataVirtualDataSource.prototype, "isFilteringSupportedOverride", {
2313
- get: function () {
2314
- return true;
2315
- },
2316
- enumerable: false,
2317
- configurable: true
2318
- });
2319
- Object.defineProperty(ODataVirtualDataSource.prototype, "isGroupingSupportedOverride", {
2320
- get: function () {
2321
- return this.isAggregationSupportedByServer;
2322
- },
2323
- enumerable: false,
2324
- configurable: true
2325
- });
2326
- Object.defineProperty(ODataVirtualDataSource.prototype, "isAggregationSupportedByServer", {
2327
- get: function () {
2328
- return this._isAggregationSupportedByServer;
2329
- },
2330
- set: function (isSupported) {
2331
- this._isAggregationSupportedByServer = isSupported;
2332
- if (igniteuiWebcomponentsCore.typeCast(ODataVirtualDataSourceDataProvider.$type, this.actualDataProvider) !== null) {
2333
- this.actualDataProvider.isAggregationSupported = isSupported;
2334
- }
2335
- },
2336
- enumerable: false,
2337
- configurable: true
2338
- });
2339
- Object.defineProperty(ODataVirtualDataSource.prototype, "enableJsonp", {
2340
- get: function () {
2341
- return this._enableJsonp;
2342
- },
2343
- set: function (isEnabled) {
2344
- this._enableJsonp = isEnabled;
2345
- if (igniteuiWebcomponentsCore.typeCast(ODataVirtualDataSourceDataProvider.$type, this.actualDataProvider) !== null) {
2346
- this.actualDataProvider.enableJsonp = isEnabled;
2347
- }
2348
- },
2349
- enumerable: false,
2350
- configurable: true
2351
- });
2352
- ODataVirtualDataSource.prototype.clone = function () {
2353
- var dataSource = new ODataVirtualDataSource();
2354
- dataSource.executionContext = this.executionContext;
2355
- dataSource.includeSummaryRowsInSection = this.includeSummaryRowsInSection;
2356
- dataSource.isSectionCollapsable = this.isSectionCollapsable;
2357
- dataSource.isSectionExpandedDefault = this.isSectionExpandedDefault;
2358
- //dataSource.isSectionHeaderNormalRow = this.isSectionHeaderNormalRow;
2359
- dataSource.isSectionSummaryRowsAtBottom = this.isSectionSummaryRowsAtBottom;
2360
- //dataSource.isSectionContentVisible = this.isSectionContentVisible;
2361
- dataSource.primaryKey = this.primaryKey;
2362
- dataSource.propertiesRequested = this.propertiesRequested;
2363
- dataSource.sectionHeaderDisplayMode = this.sectionHeaderDisplayMode;
2364
- dataSource.shouldEmitSectionFooters = this.shouldEmitSectionFooters;
2365
- dataSource.shouldEmitSectionHeaders = this.shouldEmitSectionHeaders;
2366
- dataSource.shouldEmitShiftedRows = this.shouldEmitShiftedRows;
2367
- dataSource.summaryScope = this.summaryScope;
2368
- for (var i = 0; i < this.groupDescriptions.size(); i++) {
2369
- dataSource.groupDescriptions.add(this.groupDescriptions.get(i));
2370
- }
2371
- for (var i = 0; i < this.sortDescriptions.size(); i++) {
2372
- dataSource.sortDescriptions.add(this.sortDescriptions.get(i));
2373
- }
2374
- for (var i = 0; i < this.filterExpressions.size(); i++) {
2375
- dataSource.filterExpressions.add(this.filterExpressions.get(i));
2376
- }
2377
- for (var i = 0; i < this.summaryDescriptions.size(); i++) {
2378
- dataSource.summaryDescriptions.add(this.summaryDescriptions.get(i));
2379
- }
2380
- dataSource.pageSizeRequested = this.pageSizeRequested;
2381
- dataSource.maxCachedPages = this.maxCachedPages;
2382
- dataSource.baseUri = this.baseUri;
2383
- dataSource.entitySet = this.entitySet;
2384
- dataSource.timeoutMilliseconds = this.timeoutMilliseconds;
2385
- dataSource.isAggregationSupportedByServer = this.isAggregationSupportedByServer;
2386
- dataSource.enableJsonp = this.enableJsonp;
2387
- return dataSource;
2388
- };
2389
- return ODataVirtualDataSource;
2390
- }(igniteuiWebcomponentsCore.VirtualDataSource));
2391
-
2392
- var RestVirtualDataSourceProviderTaskDataHolder = /** @class */ /*@__PURE__*/ (function (_super) {
2393
- tslib.__extends(RestVirtualDataSourceProviderTaskDataHolder, _super);
2394
- function RestVirtualDataSourceProviderTaskDataHolder() {
2395
- return _super !== null && _super.apply(this, arguments) || this;
2396
- }
2397
- RestVirtualDataSourceProviderTaskDataHolder.$t = igniteuiWebcomponentsCore.markType(RestVirtualDataSourceProviderTaskDataHolder, 'ODataVirtualDataSourceProviderTaskDataHolder', igniteuiWebcomponentsCore.AsyncVirtualDataSourceProviderTaskDataHolder.$type);
2398
- return RestVirtualDataSourceProviderTaskDataHolder;
2399
- }(igniteuiWebcomponentsCore.AsyncVirtualDataSourceProviderTaskDataHolder));
2400
-
2401
- var RestVirtualDataSourcePage = /** @class */ /*@__PURE__*/ (function () {
2402
- function RestVirtualDataSourcePage(sourceData_, schema, groupInformation, summaryInformation, pageIndex) {
2403
- this._actualData = null;
2404
- this._schema = null;
2405
- this._pageIndex = 0;
2406
- this._groupInformation = null;
2407
- this._summaryInformation = null;
2408
- if (sourceData_ == null) {
2409
- this._actualData = null;
2410
- }
2411
- else {
2412
- var count = (sourceData_.items.length);
2413
- this._actualData = [];
2414
- var dateProps = new Set();
2415
- for (var i = 0; i < schema.propertyNames.length; i++) {
2416
- if (schema.propertyTypes[i] == igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.DateTimeValue || schema.propertyTypes[i] == igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.DateTimeOffsetValue) {
2417
- dateProps.add(schema.propertyNames[i]);
2418
- }
2419
- }
2420
- var value_ = void 0;
2421
- var _loop_1 = function (i_) {
2422
- var currItem_ = sourceData_.items[i_];
2423
- var dict = new Map();
2424
- var properties = Array.from(Object.keys(currItem_));
2425
- var values = (properties.map(function (k) { return currItem_[k]; }));
2426
- for (var i1 = 0; i1 < properties.length; i1++) {
2427
- value_ = values[i1];
2428
- if (dateProps.has(properties[i1])) {
2429
- value_ = new Date(value_);
2430
- }
2431
- dict.set(properties[i1], value_);
2432
- }
2433
- this_1._actualData[i_] = dict;
2434
- };
2435
- var this_1 = this;
2436
- for (var i_ = 0; i_ < count; i_++) {
2437
- _loop_1(i_);
2438
- }
2439
- }
2440
- this._schema = schema;
2441
- this._groupInformation = groupInformation;
2442
- this._summaryInformation = summaryInformation;
2443
- this._pageIndex = pageIndex;
2444
- }
2445
- RestVirtualDataSourcePage.prototype.count = function () {
2446
- return this._actualData.length;
2447
- };
2448
- RestVirtualDataSourcePage.prototype.getItemAtIndex = function (index) {
2449
- return this._actualData[index];
2450
- };
2451
- RestVirtualDataSourcePage.prototype.getItemValueAtIndex = function (index, valueName) {
2452
- var item = this._actualData[index];
2453
- if (!item.has(valueName)) {
2454
- return null;
2455
- }
2456
- return item.get(valueName);
2457
- };
2458
- RestVirtualDataSourcePage.prototype.pageIndex = function () {
2459
- return this._pageIndex;
2460
- };
2461
- RestVirtualDataSourcePage.prototype.schema = function () {
2462
- return this._schema;
2463
- };
2464
- RestVirtualDataSourcePage.prototype.getGroupInformation = function () {
2465
- return this._groupInformation;
2466
- };
2467
- RestVirtualDataSourcePage.prototype.getSummaryInformation = function () {
2468
- return this._summaryInformation;
2469
- };
2470
- return RestVirtualDataSourcePage;
2471
- }());
2472
-
2473
- var RestVirtualDataSourceDataProviderWorker = /** @class */ /*@__PURE__*/ (function (_super) {
2474
- tslib.__extends(RestVirtualDataSourceDataProviderWorker, _super);
2475
- function RestVirtualDataSourceDataProviderWorker(settings) {
2476
- var e_1, _a;
2477
- var _this = _super.call(this, settings) || this;
2478
- _this._baseUri = null;
2479
- _this._entitySet = null;
2480
- _this._sortDescriptions = null;
2481
- _this._groupDescriptions = null;
2482
- _this._filterExpressions = null;
2483
- _this._summaryDescriptions = null;
2484
- _this._desiredPropeties = null;
2485
- _this._schemaIncludedProperties = null;
2486
- _this._enableJsonp = true;
2487
- _this._isAggregationSupported = false;
2488
- _this._provideFullCount = null;
2489
- _this._provideOrderByParameter = null;
2490
- _this._provideFilterParameter = null;
2491
- _this._provideAggregationParameter = null;
2492
- _this._provideAggregatedCount = null;
2493
- _this._providePagingParameter = null;
2494
- _this._provideDesiredPropertiesParameter = null;
2495
- _this._provideUri = null;
2496
- _this._performFetch = null;
2497
- _this._fixedFullCount = -1;
2498
- _this._groupInformation = null;
2499
- _this._summaryInformation = null;
2500
- _this._filterString = null;
2501
- _this._selectedString = null;
2502
- _this.doWork = _this.doWork.bind(_this);
2503
- _this._baseUri = settings.baseUri;
2504
- _this._entitySet = settings.entitySet;
2505
- _this._sortDescriptions = settings.sortDescriptions;
2506
- _this._groupDescriptions = settings.groupDescriptions;
2507
- if (_this._groupDescriptions != null && _this._groupDescriptions.size() > 0) {
2508
- _this._sortDescriptions = new igniteuiWebcomponentsCore.SortDescriptionCollection();
2509
- try {
2510
- for (var _b = tslib.__values(_this.iter(settings.sortDescriptions)), _c = _b.next(); !_c.done; _c = _b.next()) {
2511
- var sd = _c.value;
2512
- _this._sortDescriptions.add(sd);
2513
- }
2514
- }
2515
- catch (e_1_1) {
2516
- e_1 = { error: e_1_1 };
2517
- }
2518
- finally {
2519
- try {
2520
- if (_c && !_c.done && (_a = _b.return))
2521
- _a.call(_b);
2522
- }
2523
- finally {
2524
- if (e_1)
2525
- throw e_1.error;
2526
- }
2527
- }
2528
- for (var i = 0; i < _this._groupDescriptions.size(); i++) {
2529
- _this._sortDescriptions.insert(i, _this._groupDescriptions.get(i));
2530
- }
2531
- }
2532
- _this._filterExpressions = settings.filterExpressions;
2533
- _this._desiredPropeties = settings.propertiesRequested;
2534
- if (settings.schemaIncludedProperties != null) {
2535
- _this._schemaIncludedProperties = new Set();
2536
- for (var i = 0; i < settings.schemaIncludedProperties.length; i++) {
2537
- _this._schemaIncludedProperties.add(settings.schemaIncludedProperties[i]);
2538
- }
2539
- }
2540
- _this._summaryDescriptions = settings.summaryDescriptions;
2541
- _this._fixedFullCount = settings.fixedFullCount;
2542
- _this._summaryScope = settings.summaryScope;
2543
- _this._enableJsonp = settings.enableJsonp;
2544
- _this._provideFullCount = settings.provideFullCount;
2545
- _this._performFetch = settings.performFetch;
2546
- _this._provideAggregationParameter = settings.provideAggregationParameter;
2547
- _this._provideFilterParameter = settings.provideFilterParameter;
2548
- _this._provideOrderByParameter = settings.provideOrderByParameter;
2549
- _this._provideUri = settings.provideUri;
2550
- _this._providePagingParameter = settings.providePagingParameter;
2551
- _this._provideDesiredPropertiesParameter = settings.provideDesiredPropertiesParameter;
2552
- _this._provideItems = settings.provideItems;
2553
- _this._provideAggregatedCount = settings.provideAggregatedCount;
2554
- if (!_this._provideItems) {
2555
- _this._provideItems = function (res) {
2556
- return res ? res.items : null;
2557
- };
2558
- }
2559
- if (!_this._provideFullCount) {
2560
- _this._provideFullCount = function (p) {
2561
- if (p.fullCount) {
2562
- return p.fullCount;
2563
- }
2564
- else {
2565
- return _this._fixedFullCount >= 0 ? _this._fixedFullCount : 0;
2566
- }
2567
- };
2568
- }
2569
- if (!_this._provideOrderByParameter) {
2570
- _this._provideOrderByParameter = function (args, orderByString, orderBy) {
2571
- args.push({ name: "orderBy", value: encodeURIComponent(orderByString) });
2572
- };
2573
- }
2574
- if (!_this._providePagingParameter) {
2575
- _this._providePagingParameter = function (args, skip, take) {
2576
- args.push({ name: "skip", value: skip });
2577
- args.push({ name: "take", value: take });
2578
- };
2579
- }
2580
- if (!_this._provideAggregationParameter) {
2581
- _this._provideAggregationParameter = function (args, fetchCountOnly, groupByString, groupBy, summaryString, summary) {
2582
- args.push({ name: "groupBy", value: groupByString });
2583
- args.push({ name: "aggregate", value: "count" });
2584
- };
2585
- }
2586
- if (!_this._provideUri) {
2587
- _this._provideUri = function (baseUri, entitySet, args) {
2588
- var requestUri = baseUri;
2589
- requestUri += "/" + entitySet;
2590
- if (args.length > 0) {
2591
- requestUri += "?";
2592
- }
2593
- var argsString = "";
2594
- for (var i = 0; i < args.length; i++) {
2595
- if (i > 0) {
2596
- argsString += "&";
2597
- }
2598
- argsString += args[i].name + "=" + args[i].value;
2599
- }
2600
- return requestUri + argsString;
2601
- };
2602
- }
2603
- _this._isAggregationSupported = settings.isAggregationSupported;
2604
- window.setTimeout(_this.doWork, 100);
2605
- return _this;
2606
- }
2607
- Object.defineProperty(RestVirtualDataSourceDataProviderWorker.prototype, "sortDescriptions", {
2608
- get: function () {
2609
- return this._sortDescriptions;
2610
- },
2611
- enumerable: false,
2612
- configurable: true
2613
- });
2614
- Object.defineProperty(RestVirtualDataSourceDataProviderWorker.prototype, "filterExpressions", {
2615
- get: function () {
2616
- return this._filterExpressions;
2617
- },
2618
- enumerable: false,
2619
- configurable: true
2620
- });
2621
- Object.defineProperty(RestVirtualDataSourceDataProviderWorker.prototype, "desiredProperties", {
2622
- get: function () {
2623
- return this._desiredPropeties;
2624
- },
2625
- enumerable: false,
2626
- configurable: true
2627
- });
2628
- RestVirtualDataSourceDataProviderWorker.prototype.initialize = function () {
2629
- _super.prototype.initialize.call(this);
2630
- };
2631
- RestVirtualDataSourceDataProviderWorker.prototype.getTaskDataHolder = function () {
2632
- var holder = new RestVirtualDataSourceProviderTaskDataHolder();
2633
- return holder;
2634
- };
2635
- RestVirtualDataSourceDataProviderWorker.prototype.getCompletedTaskData = function (holder, completed) {
2636
- _super.prototype.getCompletedTaskData.call(this, holder, completed);
2637
- };
2638
- RestVirtualDataSourceDataProviderWorker.prototype.removeCompletedTaskData = function (holder, completed) {
2639
- _super.prototype.removeCompletedTaskData.call(this, holder, completed);
2640
- };
2641
- RestVirtualDataSourceDataProviderWorker.prototype.getTasksData = function (holder) {
2642
- _super.prototype.getTasksData.call(this, holder);
2643
- };
2644
- RestVirtualDataSourceDataProviderWorker.prototype.iter = function (coll) {
2645
- var i;
2646
- return tslib.__generator(this, function (_a) {
2647
- switch (_a.label) {
2648
- case 0:
2649
- i = 0;
2650
- _a.label = 1;
2651
- case 1:
2652
- if (!(i < coll.size()))
2653
- return [3 /*break*/, 4];
2654
- return [4 /*yield*/, coll.get(i)];
2655
- case 2:
2656
- _a.sent();
2657
- _a.label = 3;
2658
- case 3:
2659
- i++;
2660
- return [3 /*break*/, 1];
2661
- case 4: return [2 /*return*/];
2662
- }
2663
- });
2664
- };
2665
- RestVirtualDataSourceDataProviderWorker.prototype.iterFilter = function (coll) {
2666
- var i;
2667
- return tslib.__generator(this, function (_a) {
2668
- switch (_a.label) {
2669
- case 0:
2670
- i = 0;
2671
- _a.label = 1;
2672
- case 1:
2673
- if (!(i < coll.size()))
2674
- return [3 /*break*/, 4];
2675
- return [4 /*yield*/, coll.get(i)];
2676
- case 2:
2677
- _a.sent();
2678
- _a.label = 3;
2679
- case 3:
2680
- i++;
2681
- return [3 /*break*/, 1];
2682
- case 4: return [2 /*return*/];
2683
- }
2684
- });
2685
- };
2686
- RestVirtualDataSourceDataProviderWorker.prototype.iterSummaries = function (summaries) {
2687
- var i;
2688
- return tslib.__generator(this, function (_a) {
2689
- switch (_a.label) {
2690
- case 0:
2691
- i = 0;
2692
- _a.label = 1;
2693
- case 1:
2694
- if (!(i < summaries.size()))
2695
- return [3 /*break*/, 4];
2696
- return [4 /*yield*/, summaries.get(i)];
2697
- case 2:
2698
- _a.sent();
2699
- _a.label = 3;
2700
- case 3:
2701
- i++;
2702
- return [3 /*break*/, 1];
2703
- case 4: return [2 /*return*/];
2704
- }
2705
- });
2706
- };
2707
- RestVirtualDataSourceDataProviderWorker.prototype.processCompletedTask = function (completedTask, currentDelay, pageIndex, taskDataHolder) {
2708
- var _this = this;
2709
- var h = taskDataHolder;
2710
- var schema = null;
2711
- var result = null;
2712
- var schemaFetchCount = -1;
2713
- var task = completedTask.task;
2714
- try {
2715
- if (task.hasErrors) {
2716
- this.retryIndex(pageIndex, currentDelay);
2717
- return;
2718
- }
2719
- if (pageIndex == RestVirtualDataSourceDataProviderWorker.schemaRequestIndex) {
2720
- result = task.result;
2721
- schemaFetchCount = (this._provideFullCount(result));
2722
- }
2723
- else {
2724
- result = task.result;
2725
- }
2726
- }
2727
- catch (e) {
2728
- this.retryIndex(pageIndex, currentDelay);
2729
- return;
2730
- }
2731
- if (schemaFetchCount >= 0) {
2732
- this.actualCount = schemaFetchCount;
2733
- }
2734
- else {
2735
- this.actualCount = (this._provideFullCount(result));
2736
- }
2737
- schema = this.actualSchema;
2738
- if (schema == null) {
2739
- var requests_1 = 0;
2740
- this.resolveSchema(function (s) {
2741
- // resolveSchema success callback
2742
- _this.actualSchema = s;
2743
- if (_this._isAggregationSupported && (_this._groupDescriptions.size() !== 0 || _this._summaryDescriptions.size() !== 0)) {
2744
- if (_this._groupDescriptions.size() > 0) {
2745
- requests_1++;
2746
- _this.resolveGroupInformation(function (g) {
2747
- // group info success
2748
- requests_1--;
2749
- if (requests_1 === 0) {
2750
- _this.finishProcessingCompletedTask(task, pageIndex, s, result);
2751
- }
2752
- }, function () {
2753
- // group info failure
2754
- _this.retryIndex(pageIndex, currentDelay);
2755
- return;
2756
- });
2757
- }
2758
- if (_this._summaryDescriptions.size() > 0) {
2759
- requests_1++;
2760
- _this.resolveSummaryInformation(function (g) {
2761
- // summary info success
2762
- requests_1--;
2763
- if (requests_1 === 0) {
2764
- _this.finishProcessingCompletedTask(task, pageIndex, s, result);
2765
- }
2766
- }, function () {
2767
- // summary info failure
2768
- _this.retryIndex(pageIndex, currentDelay);
2769
- return;
2770
- });
2771
- }
2772
- }
2773
- else {
2774
- _this.finishProcessingCompletedTask(task, pageIndex, s, result);
2775
- }
2776
- }, function () {
2777
- // resolveSchema failure callback
2778
- _this.retryIndex(pageIndex, currentDelay);
2779
- return;
2780
- });
2781
- return;
2782
- }
2783
- this.finishProcessingCompletedTask(task, pageIndex, schema, result);
2784
- };
2785
- RestVirtualDataSourceDataProviderWorker.prototype.finishProcessingCompletedTask = function (task, pageIndex, schema, result) {
2786
- var _this = this;
2787
- var executionContext;
2788
- var pageLoaded;
2789
- var groupInformation;
2790
- var summaryInformation;
2791
- this.actualSchema = schema;
2792
- executionContext = this.executionContext;
2793
- groupInformation = this._groupInformation;
2794
- summaryInformation = this._summaryInformation;
2795
- pageLoaded = this.pageLoaded;
2796
- var page = null;
2797
- if (result != null) {
2798
- page = new RestVirtualDataSourcePage(result, schema, groupInformation, summaryInformation, pageIndex);
2799
- if (!this.isLastPage(pageIndex) && page.count() > 0 && !this.populatedActualPageSize) {
2800
- this.populatedActualPageSize = true;
2801
- this.actualPageSize = page.count();
2802
- }
2803
- }
2804
- else {
2805
- page = new RestVirtualDataSourcePage(null, schema, groupInformation, summaryInformation, pageIndex);
2806
- }
2807
- if (this.pageLoaded != null) {
2808
- if (this.executionContext != null) {
2809
- if (executionContext == null || pageLoaded == null) {
2810
- this.shutdown();
2811
- return;
2812
- }
2813
- executionContext.execute(function () { return pageLoaded(page, _this.actualCount, _this.actualPageSize); });
2814
- }
2815
- else {
2816
- if (pageLoaded == null) {
2817
- this.shutdown();
2818
- return;
2819
- }
2820
- pageLoaded(page, this.actualCount, this.actualPageSize);
2821
- }
2822
- }
2823
- };
2824
- RestVirtualDataSourceDataProviderWorker.prototype.resolveGroupInformation = function (finishAction, failureAction) {
2825
- var e_2, _a;
2826
- var _this = this;
2827
- if (this._groupInformation != null) {
2828
- finishAction(this._groupInformation);
2829
- return;
2830
- }
2831
- var orderBy = "";
2832
- var groupBy = "";
2833
- var filter = null;
2834
- var summary = "";
2835
- if (this._groupDescriptions == null || this._groupDescriptions.size() == 0) {
2836
- finishAction(null);
2837
- return;
2838
- }
2839
- if (this._provideAggregationParameter == null) {
2840
- finishAction(null);
2841
- return;
2842
- }
2843
- filter = this._filterString;
2844
- this.updateFilterString();
2845
- if (this._groupDescriptions != null) {
2846
- var first1 = true;
2847
- try {
2848
- for (var _b = tslib.__values(this.iter(this._groupDescriptions)), _c = _b.next(); !_c.done; _c = _b.next()) {
2849
- var group = _c.value;
2850
- if (first1) {
2851
- first1 = false;
2852
- }
2853
- else {
2854
- orderBy += ", ";
2855
- groupBy += ", ";
2856
- }
2857
- groupBy += group.propertyName;
2858
- if (group.direction === igniteuiWebcomponentsCore.ListSortDirection.Descending) {
2859
- orderBy += group.propertyName + " desc";
2860
- }
2861
- else {
2862
- orderBy += group.propertyName + " asc";
2863
- }
2864
- }
2865
- }
2866
- catch (e_2_1) {
2867
- e_2 = { error: e_2_1 };
2868
- }
2869
- finally {
2870
- try {
2871
- if (_c && !_c.done && (_a = _b.return))
2872
- _a.call(_b);
2873
- }
2874
- finally {
2875
- if (e_2)
2876
- throw e_2.error;
2877
- }
2878
- }
2879
- }
2880
- if (this._summaryScope === igniteuiWebcomponentsCore.DataSourceSummaryScope.Both || this._summaryScope === igniteuiWebcomponentsCore.DataSourceSummaryScope.Groups) {
2881
- var summaryParameters = this.getSummaryQueryParameters(true);
2882
- if (!igniteuiWebcomponentsCore.stringIsNullOrEmpty(summaryParameters)) {
2883
- summary = ", " + summaryParameters;
2884
- }
2885
- }
2886
- var args = [];
2887
- if (this._provideOrderByParameter) {
2888
- this._provideOrderByParameter(args, orderBy, this._groupDescriptions);
2889
- }
2890
- if (this._provideFilterParameter && filter != null) {
2891
- this._provideFilterParameter(args, filter, this._filterExpressions);
2892
- }
2893
- if (this._provideAggregationParameter) {
2894
- this._provideAggregationParameter(args, true, groupBy, this._groupDescriptions, summary, this._summaryDescriptions);
2895
- }
2896
- var uri = this._provideUri(this._baseUri, this._entitySet, args);
2897
- try {
2898
- var groupInformation_1 = [];
2899
- var success_1 = function (data, response) { return _this.groupSuccess(data, response, finishAction, failureAction, groupInformation_1); };
2900
- var failure_1 = function (err) { return _this.groupError(err, finishAction, failureAction, groupInformation_1); };
2901
- var run_ = null;
2902
- var headers = { 'Content-Type': 'application/json', Accept: 'application/json' };
2903
- var request = {
2904
- requestUri: uri,
2905
- enableJsonpCallback: this._enableJsonp,
2906
- method: 'GET',
2907
- headers: headers,
2908
- data: null
2909
- };
2910
- run_ = function () {
2911
- _this.fetchUri(request, success_1, failure_1);
2912
- };
2913
- run_();
2914
- }
2915
- catch (e) {
2916
- failureAction();
2917
- }
2918
- };
2919
- RestVirtualDataSourceDataProviderWorker.prototype.fetchUri = function (request, success, failure) {
2920
- if (this._performFetch) {
2921
- this._performFetch(request, success, failure);
2922
- }
2923
- else {
2924
- fetch(request.requestUri, {
2925
- method: request.method,
2926
- headers: request.headers,
2927
- }).then(function (res) {
2928
- res.json().then(function (j) {
2929
- success(j, res);
2930
- });
2931
- }).catch(function (e) {
2932
- failure(e);
2933
- });
2934
- }
2935
- };
2936
- RestVirtualDataSourceDataProviderWorker.prototype.groupError = function (err, finishAction, failureAction, groupInformation) {
2937
- this._groupInformation = null;
2938
- };
2939
- RestVirtualDataSourceDataProviderWorker.prototype.groupSuccess = function (data, response, finishAction, failureAction, groupInformation) {
2940
- var e_3, _a;
2941
- var groupNames = [];
2942
- try {
2943
- for (var _b = tslib.__values(this.iter(this._groupDescriptions)), _c = _b.next(); !_c.done; _c = _b.next()) {
2944
- var group = _c.value;
2945
- groupNames.push(group.propertyName);
2946
- }
2947
- }
2948
- catch (e_3_1) {
2949
- e_3 = { error: e_3_1 };
2950
- }
2951
- finally {
2952
- try {
2953
- if (_c && !_c.done && (_a = _b.return))
2954
- _a.call(_b);
2955
- }
2956
- finally {
2957
- if (e_3)
2958
- throw e_3.error;
2959
- }
2960
- }
2961
- var groupNamesArray = groupNames;
2962
- var items = this._provideItems(data);
2963
- if (items && items.length > 0) {
2964
- var currentIndex = 0;
2965
- for (var i = 0; i < items.length; i++) {
2966
- this.addGroup(groupInformation, groupNames, groupNames, currentIndex, items[i]);
2967
- }
2968
- }
2969
- this._groupInformation = groupInformation;
2970
- finishAction(this._groupInformation);
2971
- };
2972
- RestVirtualDataSourceDataProviderWorker.prototype.addGroup = function (groupInformation, groupNames, groupNamesArray, currentIndex, group) {
2973
- var e_4, _a;
2974
- var groupValues = [];
2975
- try {
2976
- for (var groupNames_1 = tslib.__values(groupNames), groupNames_1_1 = groupNames_1.next(); !groupNames_1_1.done; groupNames_1_1 = groupNames_1.next()) {
2977
- var name_1 = groupNames_1_1.value;
2978
- if (group[name_1]) {
2979
- groupValues.push(group[name_1]);
2980
- }
2981
- }
2982
- }
2983
- catch (e_4_1) {
2984
- e_4 = { error: e_4_1 };
2985
- }
2986
- finally {
2987
- try {
2988
- if (groupNames_1_1 && !groupNames_1_1.done && (_a = groupNames_1.return))
2989
- _a.call(groupNames_1);
2990
- }
2991
- finally {
2992
- if (e_4)
2993
- throw e_4.error;
2994
- }
2995
- }
2996
- var groupCount = 0;
2997
- //todo: make this customizable
2998
- if (this._provideAggregatedCount) {
2999
- var ct = this._provideAggregatedCount(group);
3000
- }
3001
- else {
3002
- if (group["aggregatedCount"]) {
3003
- groupCount = igniteuiWebcomponentsCore.Convert.toInt321(group["aggregatedCount"]);
3004
- }
3005
- }
3006
- var summaryResults = null;
3007
- if (this._summaryScope == igniteuiWebcomponentsCore.DataSourceSummaryScope.Both || this._summaryScope == igniteuiWebcomponentsCore.DataSourceSummaryScope.Groups) {
3008
- summaryResults = this.createSummaryResults(group);
3009
- }
3010
- var groupInfo = new igniteuiWebcomponentsCore.DefaultSectionInformation(currentIndex, currentIndex + (groupCount - 1), groupNamesArray, groupValues, summaryResults);
3011
- groupInformation.push(groupInfo);
3012
- };
3013
- RestVirtualDataSourceDataProviderWorker.prototype.resolveSummaryInformation = function (finishAction, failureAction) {
3014
- var _this = this;
3015
- if (this._summaryInformation != null) {
3016
- finishAction(this._summaryInformation);
3017
- return;
3018
- }
3019
- var filter = null;
3020
- var summary = null;
3021
- if (this._summaryDescriptions == null ||
3022
- this._summaryDescriptions.size() == 0 ||
3023
- this._summaryScope == igniteuiWebcomponentsCore.DataSourceSummaryScope.Groups ||
3024
- this._summaryScope == igniteuiWebcomponentsCore.DataSourceSummaryScope.None) {
3025
- finishAction(null);
3026
- return;
3027
- }
3028
- filter = this._filterString;
3029
- this.updateFilterString();
3030
- summary = this.getSummaryQueryParameters(false);
3031
- var args = [];
3032
- // if (this._provideOrderByParameter) {
3033
- // args.push({ name: "orderBy", value: this._provideOrderByParameter(orderBy, this._sortDescriptions) });
3034
- // }
3035
- if (this._provideFilterParameter && filter != null) {
3036
- this._provideFilterParameter(args, filter, this._filterExpressions);
3037
- }
3038
- if (this._provideAggregationParameter) {
3039
- this._provideAggregationParameter(args, true, null, null, summary, this._summaryDescriptions);
3040
- }
3041
- var uri = this._provideUri(this._baseUri, this._entitySet, args);
3042
- // let commandText = this._entitySet + "?$apply=";
3043
- // if (!stringIsNullOrEmpty(filter)) {
3044
- // commandText += "filter(" + filter + ")/";
3045
- // }
3046
- // commandText += "aggregate(" + summary + ")";
3047
- try {
3048
- var summaryInformation_1 = [];
3049
- var success_2 = function (data, response) { return _this.summarySuccess(data, response, finishAction, failureAction, summaryInformation_1); };
3050
- var failure_2 = function (err) { return _this.summaryError(err, finishAction, failureAction, summaryInformation_1); };
3051
- var run_ = null;
3052
- var headers = { 'Content-Type': 'application/json', Accept: 'application/json' };
3053
- var request = {
3054
- requestUri: uri,
3055
- enableJsonpCallback: this._enableJsonp,
3056
- method: 'GET',
3057
- headers: headers,
3058
- data: null
3059
- };
3060
- run_ = function () {
3061
- _this.fetchUri(request, success_2, failure_2);
3062
- };
3063
- run_();
3064
- }
3065
- catch (e) {
3066
- failureAction();
3067
- }
3068
- };
3069
- RestVirtualDataSourceDataProviderWorker.prototype.summarySuccess = function (data, response, finishAction, failureAction, summaryInformation) {
3070
- if (data && data.value && data.value.length > 0) {
3071
- summaryInformation = this.createSummaryResults(data.value[0]);
3072
- }
3073
- this._summaryInformation = summaryInformation;
3074
- finishAction(this._summaryInformation);
3075
- };
3076
- RestVirtualDataSourceDataProviderWorker.prototype.summaryError = function (err, finishAction, failureAction, summaryInformation) {
3077
- this._summaryInformation = null;
3078
- };
3079
- RestVirtualDataSourceDataProviderWorker.prototype.getSummaryQueryParameters = function (ignoreCount) {
3080
- var e_5, _a;
3081
- var result = "";
3082
- if (this._summaryDescriptions != null) {
3083
- var first = true;
3084
- var countExists = false;
3085
- try {
3086
- for (var _b = tslib.__values(this.iterSummaries(this._summaryDescriptions)), _c = _b.next(); !_c.done; _c = _b.next()) {
3087
- var summary = _c.value;
3088
- if (summary.operand == igniteuiWebcomponentsCore.DataSourceSummaryOperand.Count && (ignoreCount || countExists)) {
3089
- continue;
3090
- }
3091
- if (!first) {
3092
- result += ", ";
3093
- }
3094
- switch (summary.operand) {
3095
- case igniteuiWebcomponentsCore.DataSourceSummaryOperand.Average:
3096
- result += summary.propertyName + " with average as " + summary.propertyName + "Average";
3097
- break;
3098
- case igniteuiWebcomponentsCore.DataSourceSummaryOperand.Min:
3099
- result += summary.propertyName + " with min as " + summary.propertyName + "Min";
3100
- break;
3101
- case igniteuiWebcomponentsCore.DataSourceSummaryOperand.Max:
3102
- result += summary.propertyName + " with max as " + summary.propertyName + "Max";
3103
- break;
3104
- case igniteuiWebcomponentsCore.DataSourceSummaryOperand.Sum:
3105
- result += summary.propertyName + " with sum as " + summary.propertyName + "Sum";
3106
- break;
3107
- case igniteuiWebcomponentsCore.DataSourceSummaryOperand.Count:
3108
- result += "$count as $__count";
3109
- countExists = true;
3110
- break;
3111
- }
3112
- first = false;
3113
- }
3114
- }
3115
- catch (e_5_1) {
3116
- e_5 = { error: e_5_1 };
3117
- }
3118
- finally {
3119
- try {
3120
- if (_c && !_c.done && (_a = _b.return))
3121
- _a.call(_b);
3122
- }
3123
- finally {
3124
- if (e_5)
3125
- throw e_5.error;
3126
- }
3127
- }
3128
- }
3129
- return result;
3130
- };
3131
- RestVirtualDataSourceDataProviderWorker.prototype.createSummaryResults = function (data) {
3132
- var e_6, _a;
3133
- var summaryResults = [];
3134
- try {
3135
- for (var _b = tslib.__values(this.iterSummaries(this._summaryDescriptions)), _c = _b.next(); !_c.done; _c = _b.next()) {
3136
- var summary = _c.value;
3137
- var summaryName = summary.propertyName;
3138
- switch (summary.operand) {
3139
- case igniteuiWebcomponentsCore.DataSourceSummaryOperand.Average:
3140
- summaryName += "Average";
3141
- break;
3142
- case igniteuiWebcomponentsCore.DataSourceSummaryOperand.Min:
3143
- summaryName += "Min";
3144
- break;
3145
- case igniteuiWebcomponentsCore.DataSourceSummaryOperand.Max:
3146
- summaryName += "Max";
3147
- break;
3148
- case igniteuiWebcomponentsCore.DataSourceSummaryOperand.Sum:
3149
- summaryName += "Sum";
3150
- break;
3151
- case igniteuiWebcomponentsCore.DataSourceSummaryOperand.Count:
3152
- summaryName = "$__count";
3153
- break;
3154
- }
3155
- var summaryValue = null;
3156
- if (data && data[summaryName]) {
3157
- summaryValue = data[summaryName];
3158
- }
3159
- var summaryResult = new igniteuiWebcomponentsCore.DefaultSummaryResult(summary.propertyName, summary.operand, summaryValue);
3160
- summaryResults.push(summaryResult);
3161
- }
3162
- }
3163
- catch (e_6_1) {
3164
- e_6 = { error: e_6_1 };
3165
- }
3166
- finally {
3167
- try {
3168
- if (_c && !_c.done && (_a = _b.return))
3169
- _a.call(_b);
3170
- }
3171
- finally {
3172
- if (e_6)
3173
- throw e_6.error;
3174
- }
3175
- }
3176
- return summaryResults;
3177
- };
3178
- RestVirtualDataSourceDataProviderWorker.prototype.resolveSchemaFromItems = function (items) {
3179
- var lds = new igniteuiWebcomponentsCore.LocalDataSource();
3180
- lds.dataSource = items;
3181
- lds.flushAutoRefresh();
3182
- return lds.actualSchema;
3183
- };
3184
- RestVirtualDataSourceDataProviderWorker.prototype.resolveSchema = function (finishAction, failureAction) {
3185
- var _this = this;
3186
- if (!this._provideItems || !this._providePagingParameter) {
3187
- failureAction("required providers for items and paging are not specified");
3188
- return;
3189
- }
3190
- var success_ = function (res) {
3191
- var items = _this._provideItems(res);
3192
- if (items && items.length > 0) {
3193
- var schema = _this.resolveSchemaFromItems(items);
3194
- if (_this._schemaIncludedProperties != null) {
3195
- var propertyNames = [];
3196
- var propertyTypes = [];
3197
- for (var i = 0; i < schema.propertyNames.length; i++) {
3198
- if (!_this._schemaIncludedProperties.has(schema.propertyNames[i])) {
3199
- continue;
3200
- }
3201
- propertyNames.push(schema.propertyNames[i]);
3202
- propertyTypes.push(schema.propertyTypes[i]);
3203
- }
3204
- schema = new igniteuiWebcomponentsCore.DefaultDataSourceSchema(propertyNames, propertyTypes, schema.primaryKey, schema.propertyDataIntents, schema.subSchemas);
3205
- }
3206
- finishAction(schema);
3207
- }
3208
- else {
3209
- failureAction("could not find items to resolve schema");
3210
- }
3211
- };
3212
- var failure_ = function (e) { return failureAction(e); };
3213
- var args = [];
3214
- if (this._providePagingParameter) {
3215
- this._providePagingParameter(args, 0, this.actualPageSize);
3216
- }
3217
- var uri = this._provideUri(this._baseUri, this._entitySet, args);
3218
- try {
3219
- var run_ = null;
3220
- var headers = { 'Content-Type': 'application/json', Accept: 'application/json' };
3221
- var request = {
3222
- requestUri: uri,
3223
- enableJsonpCallback: this._enableJsonp,
3224
- method: 'GET',
3225
- headers: headers,
3226
- data: null
3227
- };
3228
- run_ = function () {
3229
- _this.fetchUri(request, success_, failure_);
3230
- };
3231
- run_();
3232
- }
3233
- catch (e) {
3234
- failureAction(e);
3235
- }
3236
- };
3237
- RestVirtualDataSourceDataProviderWorker.prototype.makeTaskForRequest = function (request, retryDelay) {
3238
- var e_7, _a;
3239
- var args = [];
3240
- // if (this._provideAggregationParameter) {
3241
- // args.push({ name: "apply", value: this._provideAggregationParameter(true, groupBy, this._groupDescriptions, summary, this._summaryDescriptions) });
3242
- // }
3243
- var actualPageSize = 0;
3244
- var sortDescriptions = null;
3245
- actualPageSize = this.actualPageSize;
3246
- sortDescriptions = this.sortDescriptions;
3247
- //let requestUrl: string = this._baseUri;
3248
- //requestUrl += "/" + this._entitySet;
3249
- var queryStarted = false;
3250
- this.updateFilterString();
3251
- if (this._filterString != null) {
3252
- if (this._provideFilterParameter) {
3253
- this._provideFilterParameter(args, this._filterString, this._filterExpressions);
3254
- }
3255
- }
3256
- if (this.sortDescriptions != null) {
3257
- var sortString = null;
3258
- try {
3259
- for (var _b = tslib.__values(this.iter(this.sortDescriptions)), _c = _b.next(); !_c.done; _c = _b.next()) {
3260
- var sort = _c.value;
3261
- if (sortString == null) {
3262
- sortString = "";
3263
- }
3264
- else {
3265
- sortString += ", ";
3266
- }
3267
- if (sort.direction == igniteuiWebcomponentsCore.ListSortDirection.Descending) {
3268
- sortString += sort.propertyName + " desc";
3269
- }
3270
- else {
3271
- sortString += sort.propertyName;
3272
- }
3273
- }
3274
- }
3275
- catch (e_7_1) {
3276
- e_7 = { error: e_7_1 };
3277
- }
3278
- finally {
3279
- try {
3280
- if (_c && !_c.done && (_a = _b.return))
3281
- _a.call(_b);
3282
- }
3283
- finally {
3284
- if (e_7)
3285
- throw e_7.error;
3286
- }
3287
- }
3288
- if (sortString != null) {
3289
- if (this._provideOrderByParameter) {
3290
- this._provideOrderByParameter(args, sortString, this._sortDescriptions);
3291
- }
3292
- }
3293
- }
3294
- if (this.desiredProperties != null && this.desiredProperties.length > 0) {
3295
- var selectString = "";
3296
- var first = true;
3297
- var $t = this.desiredProperties;
3298
- for (var i = 0; i < $t.length; i++) {
3299
- var select = $t[i];
3300
- if (first) {
3301
- first = false;
3302
- }
3303
- else {
3304
- selectString += ", ";
3305
- }
3306
- selectString += select;
3307
- }
3308
- if (this._provideDesiredPropertiesParameter) {
3309
- this._provideDesiredPropertiesParameter(args, selectString, this._desiredPropeties);
3310
- }
3311
- }
3312
- if (this._providePagingParameter) {
3313
- if (request.index == RestVirtualDataSourceDataProviderWorker.schemaRequestIndex) {
3314
- this._providePagingParameter(args, 0, actualPageSize);
3315
- }
3316
- else {
3317
- this._providePagingParameter(args, request.index * actualPageSize, actualPageSize);
3318
- }
3319
- }
3320
- var task = new igniteuiWebcomponentsCore.AsyncVirtualDataTask();
3321
- var uri = this._provideUri(this._baseUri, this._entitySet, args);
3322
- if (request.index == RestVirtualDataSourceDataProviderWorker.schemaRequestIndex) {
3323
- this.executeRequest(uri, queryStarted, 0, actualPageSize, task);
3324
- }
3325
- else {
3326
- this.executeRequest(uri, queryStarted, request.index * actualPageSize, actualPageSize, task);
3327
- }
3328
- request.taskHolder = new igniteuiWebcomponentsCore.AsyncDataSourcePageTaskHolder();
3329
- request.taskHolder.task = task;
3330
- this.tasks.add(request);
3331
- };
3332
- RestVirtualDataSourceDataProviderWorker.prototype.updateFilterString = function () {
3333
- var e_8, _a;
3334
- if (this.filterExpressions != null && this.filterExpressions.size() > 0 && this._filterString == null) {
3335
- var sb = "";
3336
- var first = true;
3337
- try {
3338
- for (var _b = tslib.__values(this.iterFilter(this.filterExpressions)), _c = _b.next(); !_c.done; _c = _b.next()) {
3339
- var expr = _c.value;
3340
- if (first) {
3341
- first = false;
3342
- }
3343
- else {
3344
- sb += " AND ";
3345
- }
3346
- var visitor = new igniteuiWebcomponentsCore.ODataDataSourceFilterExpressionVisitor(0);
3347
- visitor.visit(expr);
3348
- var txt = visitor.toString();
3349
- if (this.filterExpressions.size() > 1) {
3350
- txt = "(" + txt + ")";
3351
- }
3352
- sb += (txt);
3353
- }
3354
- }
3355
- catch (e_8_1) {
3356
- e_8 = { error: e_8_1 };
3357
- }
3358
- finally {
3359
- try {
3360
- if (_c && !_c.done && (_a = _b.return))
3361
- _a.call(_b);
3362
- }
3363
- finally {
3364
- if (e_8)
3365
- throw e_8.error;
3366
- }
3367
- }
3368
- this._filterString = sb;
3369
- }
3370
- };
3371
- RestVirtualDataSourceDataProviderWorker.prototype.executeRequest = function (requestUrl, queryStarted, skip, top, task) {
3372
- var _this = this;
3373
- // if (!queryStarted) {
3374
- // queryStarted = true;
3375
- // requestUrl += "?";
3376
- // } else {
3377
- // requestUrl += "&";
3378
- // }
3379
- // requestUrl += "$skip=" + skip + "&$top=" + top + "&$count=true";
3380
- var requestUrl_ = requestUrl;
3381
- var self_ = this;
3382
- var success_ = function (data, response) { return _this.success(task, data, response); };
3383
- var failure_ = function (err) { return _this.error(task, err); };
3384
- var run_ = null;
3385
- var headers = { 'Content-Type': 'application/json', Accept: 'application/json' };
3386
- var request = {
3387
- requestUri: requestUrl_,
3388
- enableJsonpCallback: this._enableJsonp,
3389
- method: 'GET',
3390
- headers: headers,
3391
- data: null
3392
- };
3393
- run_ = function () {
3394
- _this.fetchUri(request, success_, failure_);
3395
- };
3396
- task.run = run_;
3397
- };
3398
- RestVirtualDataSourceDataProviderWorker.prototype.success = function (t, data, response) {
3399
- t.result = data;
3400
- t.isCompleted = true;
3401
- };
3402
- RestVirtualDataSourceDataProviderWorker.prototype.error = function (t, result) {
3403
- t.isCompleted = true;
3404
- t.hasErrors = true;
3405
- };
3406
- RestVirtualDataSourceDataProviderWorker.prototype.createBatchRequest = function (changes) {
3407
- //TODO: updates
3408
- };
3409
- RestVirtualDataSourceDataProviderWorker.prototype.getRequestUriWithKey = function (key) {
3410
- var result = "";
3411
- var keys = Object.keys(key);
3412
- for (var i = 0; i < keys.length; i++) {
3413
- if (i > 0) {
3414
- result += ",";
3415
- }
3416
- result += "".concat(keys[i], "=").concat(key[keys[i]]);
3417
- }
3418
- return "".concat(this._entitySet, "(").concat(result, ")");
3419
- };
3420
- RestVirtualDataSourceDataProviderWorker.schemaRequestIndex = -1;
3421
- return RestVirtualDataSourceDataProviderWorker;
3422
- }(igniteuiWebcomponentsCore.AsyncVirtualDataSourceProviderWorker));
3423
-
3424
- var RestVirtualDataSourceDataProviderWorkerSettings = /** @class */ /*@__PURE__*/ (function (_super) {
3425
- tslib.__extends(RestVirtualDataSourceDataProviderWorkerSettings, _super);
3426
- function RestVirtualDataSourceDataProviderWorkerSettings() {
3427
- var _this = _super !== null && _super.apply(this, arguments) || this;
3428
- _this._baseUri = null;
3429
- _this._entitySet = null;
3430
- _this._sortDescriptions = null;
3431
- _this._filterExpressions = null;
3432
- _this._propertiesRequested = null;
3433
- _this._schemaIncludedProperties = null;
3434
- _this._groupDescriptions = null;
3435
- _this._summaryDescriptions = null;
3436
- _this._fixedFullCount = -1;
3437
- _this._provideFullCount = null;
3438
- _this._provideOrderByParameter = null;
3439
- _this._provideFilterParameter = null;
3440
- _this._provideAggregationParameter = null;
3441
- _this._provideAggregatedCount = null;
3442
- _this._provideUri = null;
3443
- _this._providePagingParameter = null;
3444
- _this._provideDesiredPropertiesParameter = null;
3445
- _this._performFetch = null;
3446
- return _this;
3447
- }
3448
- Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "baseUri", {
3449
- get: function () {
3450
- return this._baseUri;
3451
- },
3452
- set: function (value) {
3453
- this._baseUri = value;
3454
- },
3455
- enumerable: false,
3456
- configurable: true
3457
- });
3458
- Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "entitySet", {
3459
- get: function () {
3460
- return this._entitySet;
3461
- },
3462
- set: function (value) {
3463
- this._entitySet = value;
3464
- },
3465
- enumerable: false,
3466
- configurable: true
3467
- });
3468
- Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "sortDescriptions", {
3469
- get: function () {
3470
- return this._sortDescriptions;
3471
- },
3472
- set: function (value) {
3473
- this._sortDescriptions = value;
3474
- },
3475
- enumerable: false,
3476
- configurable: true
3477
- });
3478
- Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "filterExpressions", {
3479
- get: function () {
3480
- return this._filterExpressions;
3481
- },
3482
- set: function (value) {
3483
- this._filterExpressions = value;
3484
- },
3485
- enumerable: false,
3486
- configurable: true
3487
- });
3488
- Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "propertiesRequested", {
3489
- get: function () {
3490
- return this._propertiesRequested;
3491
- },
3492
- set: function (value) {
3493
- this._propertiesRequested = value;
3494
- },
3495
- enumerable: false,
3496
- configurable: true
3497
- });
3498
- Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "schemaIncludedProperties", {
3499
- get: function () {
3500
- return this._schemaIncludedProperties;
3501
- },
3502
- set: function (value) {
3503
- this._schemaIncludedProperties = value;
3504
- },
3505
- enumerable: false,
3506
- configurable: true
3507
- });
3508
- Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "groupDescriptions", {
3509
- get: function () {
3510
- return this._groupDescriptions;
3511
- },
3512
- set: function (value) {
3513
- this._groupDescriptions = value;
3514
- },
3515
- enumerable: false,
3516
- configurable: true
3517
- });
3518
- Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "summaryDescriptions", {
3519
- get: function () {
3520
- return this._summaryDescriptions;
3521
- },
3522
- set: function (value) {
3523
- this._summaryDescriptions = value;
3524
- },
3525
- enumerable: false,
3526
- configurable: true
3527
- });
3528
- Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "summaryScope", {
3529
- get: function () {
3530
- return this._summaryscope;
3531
- },
3532
- set: function (value) {
3533
- this._summaryscope = value;
3534
- },
3535
- enumerable: false,
3536
- configurable: true
3537
- });
3538
- Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "enableJsonp", {
3539
- get: function () {
3540
- return this._enableJsonp;
3541
- },
3542
- set: function (isEnabled) {
3543
- this._enableJsonp = isEnabled;
3544
- },
3545
- enumerable: false,
3546
- configurable: true
3547
- });
3548
- Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "isAggregationSupported", {
3549
- get: function () {
3550
- return this._isAggregationSupported;
3551
- },
3552
- set: function (isSupported) {
3553
- this._isAggregationSupported = isSupported;
3554
- },
3555
- enumerable: false,
3556
- configurable: true
3557
- });
3558
- Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "fixedFullCount", {
3559
- get: function () {
3560
- return this._fixedFullCount;
3561
- },
3562
- set: function (value) {
3563
- this._fixedFullCount = value;
3564
- },
3565
- enumerable: false,
3566
- configurable: true
3567
- });
3568
- Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "provideFullCount", {
3569
- get: function () {
3570
- return this._provideFullCount;
3571
- },
3572
- set: function (value) {
3573
- this._provideFullCount = value;
3574
- },
3575
- enumerable: false,
3576
- configurable: true
3577
- });
3578
- Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "provideOrderByParameter", {
3579
- get: function () {
3580
- return this._provideOrderByParameter;
3581
- },
3582
- set: function (value) {
3583
- this._provideOrderByParameter = value;
3584
- },
3585
- enumerable: false,
3586
- configurable: true
3587
- });
3588
- Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "provideFilterParameter", {
3589
- get: function () {
3590
- return this._provideFilterParameter;
3591
- },
3592
- set: function (value) {
3593
- this._provideFilterParameter = value;
3594
- },
3595
- enumerable: false,
3596
- configurable: true
3597
- });
3598
- Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "provideAggregationParameter", {
3599
- get: function () {
3600
- return this._provideAggregationParameter;
3601
- },
3602
- set: function (value) {
3603
- this._provideAggregationParameter = value;
3604
- },
3605
- enumerable: false,
3606
- configurable: true
3607
- });
3608
- Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "provideAggregatedCount", {
3609
- get: function () {
3610
- return this._provideAggregatedCount;
3611
- },
3612
- set: function (value) {
3613
- this._provideAggregatedCount = value;
3614
- },
3615
- enumerable: false,
3616
- configurable: true
3617
- });
3618
- Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "provideUri", {
3619
- get: function () {
3620
- return this._provideUri;
3621
- },
3622
- set: function (value) {
3623
- this._provideUri = value;
3624
- },
3625
- enumerable: false,
3626
- configurable: true
3627
- });
3628
- Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "providePagingParameter", {
3629
- get: function () {
3630
- return this._providePagingParameter;
3631
- },
3632
- set: function (value) {
3633
- this._providePagingParameter = value;
3634
- },
3635
- enumerable: false,
3636
- configurable: true
3637
- });
3638
- Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "provideDesiredPropertiesParameter", {
3639
- get: function () {
3640
- return this._provideDesiredPropertiesParameter;
3641
- },
3642
- set: function (value) {
3643
- this._provideDesiredPropertiesParameter = value;
3644
- },
3645
- enumerable: false,
3646
- configurable: true
3647
- });
3648
- Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "provideItems", {
3649
- get: function () {
3650
- return this._provideItems;
3651
- },
3652
- set: function (value) {
3653
- this._provideItems = value;
3654
- },
3655
- enumerable: false,
3656
- configurable: true
3657
- });
3658
- Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "performFetch", {
3659
- get: function () {
3660
- return this._performFetch;
3661
- },
3662
- set: function (value) {
3663
- this._performFetch = value;
3664
- },
3665
- enumerable: false,
3666
- configurable: true
3667
- });
3668
- RestVirtualDataSourceDataProviderWorkerSettings.$t = igniteuiWebcomponentsCore.markType(RestVirtualDataSourceDataProviderWorkerSettings, 'RestVirtualDataSourceDataProviderWorkerSettings', igniteuiWebcomponentsCore.AsyncVirtualDataSourceDataProviderWorkerSettings.$type);
3669
- return RestVirtualDataSourceDataProviderWorkerSettings;
3670
- }(igniteuiWebcomponentsCore.AsyncVirtualDataSourceDataProviderWorkerSettings));
3671
-
3672
- var RestVirtualDataSourceDataProvider = /** @class */ /*@__PURE__*/ (function (_super) {
3673
- tslib.__extends(RestVirtualDataSourceDataProvider, _super);
3674
- function RestVirtualDataSourceDataProvider() {
3675
- var _this = _super.call(this) || this;
3676
- _this._worker = null;
3677
- _this._requests = new LinkedList();
3678
- _this._callback = null;
3679
- _this._pageLoaded = null;
3680
- _this._pageSizeRequested = 50;
3681
- _this._baseUri = null;
3682
- _this._entitySet = null;
3683
- _this._timeoutMilliseconds = 10000;
3684
- _this.schemaChanged = null;
3685
- _this._currentFullCount = 0;
3686
- _this._currentSchema = null;
3687
- _this._executionContext = null;
3688
- _this._updateNotifier = null;
3689
- _this._deferAutoRefresh = false;
3690
- _this._sortDescriptions = null;
3691
- _this._groupDescriptions = null;
3692
- _this._propertiesRequested = null;
3693
- _this._schemaIncludedProperties = null;
3694
- _this._filterExpressions = null;
3695
- _this._summaryDescriptions = null;
3696
- _this._enableJsonp = true;
3697
- _this._fixedFullCount = -1;
3698
- _this._provideFullCount = null;
3699
- _this._provideOrderByParameter = null;
3700
- _this._provideFilterParameter = null;
3701
- _this._provideAggregationParameter = null;
3702
- _this._provideAggregatedCount = null;
3703
- _this._provideUri = null;
3704
- _this._performFetch = null;
3705
- _this._providePagingParameter = null;
3706
- _this._provideDesiredPropertiesParameter = null;
3707
- _this._schemaFetchQueued = false;
3708
- _this._autoRefreshQueued = false;
3709
- _this._sortDescriptions = new igniteuiWebcomponentsCore.SortDescriptionCollection();
3710
- _this._sortDescriptions.onChanged = function () { return _this.sortDescriptions_CollectionChanged(null, null); };
3711
- _this._groupDescriptions = new igniteuiWebcomponentsCore.SortDescriptionCollection();
3712
- _this._groupDescriptions.onChanged = function () { return _this.groupDescriptions_CollectionChanged(null, null); };
3713
- _this._filterExpressions = new igniteuiWebcomponentsCore.FilterExpressionCollection();
3714
- _this._filterExpressions.onChanged = function () { return _this.filterExpressions_CollectionChanged(null, null); };
3715
- _this._summaryDescriptions = new igniteuiWebcomponentsCore.SummaryDescriptionCollection();
3716
- _this._summaryDescriptions.onChanged = function () { return _this.summaryDescriptions_CollectionChanged(null, null); };
3717
- return _this;
3718
- }
3719
- RestVirtualDataSourceDataProvider.prototype.filterExpressions_CollectionChanged = function (sender, e) {
3720
- this.queueAutoRefresh();
3721
- };
3722
- RestVirtualDataSourceDataProvider.prototype.sortDescriptions_CollectionChanged = function (sender, e) {
3723
- this.queueAutoRefresh();
3724
- };
3725
- RestVirtualDataSourceDataProvider.prototype.groupDescriptions_CollectionChanged = function (sender, e) {
3726
- this.queueAutoRefresh();
3727
- };
3728
- RestVirtualDataSourceDataProvider.prototype.summaryDescriptions_CollectionChanged = function (sender, e) {
3729
- this.queueAutoRefresh();
3730
- };
3731
- RestVirtualDataSourceDataProvider.prototype.addPageRequest = function (pageIndex, priority) {
3732
- if (this.deferAutoRefresh) {
3733
- return;
3734
- }
3735
- if (this._worker != null && this._worker.isShutdown) {
3736
- this._worker = null;
3737
- this._callback = null;
3738
- }
3739
- if (this._worker == null) {
3740
- this.createWorker();
3741
- }
3742
- if (priority == igniteuiWebcomponentsCore.DataSourcePageRequestPriority.High) {
3743
- this._requests.addFirst(pageIndex);
3744
- }
3745
- else {
3746
- this._requests.addLast(pageIndex);
3747
- }
3748
- if (!this._worker.addPageRequest(pageIndex, priority)) {
3749
- this._worker = null;
3750
- this._callback = null;
3751
- this.addPageRequest(pageIndex, priority);
3752
- }
3753
- };
3754
- RestVirtualDataSourceDataProvider.prototype.createWorker = function () {
3755
- if (!this.valid()) {
3756
- return;
3757
- }
3758
- this._callback = igniteuiWebcomponentsCore.runOn(this, this.raisePageLoaded);
3759
- var settings = this.getWorkerSettings();
3760
- this._worker = new RestVirtualDataSourceDataProviderWorker(settings);
3761
- };
3762
- RestVirtualDataSourceDataProvider.prototype.valid = function () {
3763
- return this.entitySet != null && this.baseUri != null;
3764
- };
3765
- RestVirtualDataSourceDataProvider.prototype.getWorkerSettings = function () {
3766
- var _this = this;
3767
- return ((function () {
3768
- var $ret = new RestVirtualDataSourceDataProviderWorkerSettings();
3769
- $ret.baseUri = _this._baseUri;
3770
- $ret.entitySet = _this._entitySet;
3771
- $ret.pageSizeRequested = _this._pageSizeRequested;
3772
- $ret.timeoutMilliseconds = _this._timeoutMilliseconds;
3773
- $ret.pageLoaded = _this._callback;
3774
- $ret.executionContext = _this._executionContext;
3775
- $ret.sortDescriptions = _this._sortDescriptions;
3776
- $ret.groupDescriptions = _this._groupDescriptions;
3777
- $ret.filterExpressions = _this._filterExpressions;
3778
- $ret.propertiesRequested = _this._propertiesRequested;
3779
- $ret.schemaIncludedProperties = _this._schemaIncludedProperties;
3780
- $ret.summaryDescriptions = _this._summaryDescriptions;
3781
- $ret.summaryScope = _this._summaryScope;
3782
- $ret.enableJsonp = _this._enableJsonp;
3783
- $ret.isAggregationSupported = _this.isAggregationSupported;
3784
- $ret.performFetch = _this.performFetch;
3785
- $ret.provideAggregationParameter = _this.provideAggregationParameter;
3786
- $ret.provideAggregatedCount = _this.provideAggregatedCount;
3787
- $ret.provideDesiredPropertiesParameter = _this.provideDesiredPropertiesParameter;
3788
- $ret.provideFilterParameter = _this.provideFilterParameter;
3789
- $ret.provideFullCount = _this.provideFullCount;
3790
- $ret.provideItems = _this.provideItems;
3791
- $ret.provideOrderByParameter = _this.provideOrderByParameter;
3792
- $ret.providePagingParameter = _this.providePagingParameter;
3793
- $ret.provideUri = _this.provideUri;
3794
- $ret.fixedFullCount = _this.fixedFullCount;
3795
- return $ret;
3796
- })());
3797
- };
3798
- RestVirtualDataSourceDataProvider.prototype.removePageRequest = function (pageIndex) {
3799
- var current = this._requests.first;
3800
- while (current != null) {
3801
- if (current.value == pageIndex) {
3802
- this._requests.remove(current);
3803
- }
3804
- current = current.next;
3805
- }
3806
- if (this._worker == null) {
3807
- return;
3808
- }
3809
- this._worker.removePageRequest(pageIndex);
3810
- };
3811
- RestVirtualDataSourceDataProvider.prototype.removeAllPageRequests = function () {
3812
- this._requests.clear();
3813
- if (this._worker == null) {
3814
- return;
3815
- }
3816
- this._worker.removeAllPageRequests();
3817
- };
3818
- RestVirtualDataSourceDataProvider.prototype.close = function () {
3819
- if (this._worker != null) {
3820
- this._worker.shutdown();
3821
- this._worker = null;
3822
- this._callback = null;
3823
- }
3824
- };
3825
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "pageLoaded", {
3826
- get: function () {
3827
- return this._pageLoaded;
3828
- },
3829
- set: function (value) {
3830
- this._pageLoaded = value;
3831
- this.queueAutoRefresh();
3832
- },
3833
- enumerable: false,
3834
- configurable: true
3835
- });
3836
- RestVirtualDataSourceDataProvider.prototype.raisePageLoaded = function (page, fullCount, actualPageSize) {
3837
- if (this._pageLoaded != null) {
3838
- this._currentFullCount = fullCount;
3839
- if (this._currentSchema == null) {
3840
- var currentSchema = null;
3841
- if (page != null) {
3842
- currentSchema = page.schema();
3843
- }
3844
- this._currentSchema = currentSchema;
3845
- if (this.schemaChanged != null) {
3846
- this.schemaChanged(this, new igniteuiWebcomponentsCore.DataSourceDataProviderSchemaChangedEventArgs(this._currentSchema, this._currentFullCount));
3847
- }
3848
- }
3849
- if (page.pageIndex() != RestVirtualDataSourceDataProviderWorker.schemaRequestIndex) {
3850
- this._pageLoaded(page, fullCount, actualPageSize);
3851
- }
3852
- }
3853
- };
3854
- RestVirtualDataSourceDataProvider.prototype.killWorker = function () {
3855
- if (this._worker != null) {
3856
- this._worker.shutdown();
3857
- this._worker = null;
3858
- this._callback = null;
3859
- }
3860
- };
3861
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "pageSizeRequested", {
3862
- get: function () {
3863
- return this._pageSizeRequested;
3864
- },
3865
- set: function (value) {
3866
- this._pageSizeRequested = value;
3867
- this.queueAutoRefresh();
3868
- },
3869
- enumerable: false,
3870
- configurable: true
3871
- });
3872
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "baseUri", {
3873
- get: function () {
3874
- return this._baseUri;
3875
- },
3876
- set: function (value) {
3877
- var oldValue = this._baseUri;
3878
- this._baseUri = value;
3879
- if (oldValue != this._baseUri) {
3880
- this.queueAutoRefresh();
3881
- if (this.valid() && this.deferAutoRefresh) {
3882
- this.queueSchemaFetch();
3883
- }
3884
- }
3885
- },
3886
- enumerable: false,
3887
- configurable: true
3888
- });
3889
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "entitySet", {
3890
- get: function () {
3891
- return this._entitySet;
3892
- },
3893
- set: function (value) {
3894
- var oldValue = this._entitySet;
3895
- this._entitySet = value;
3896
- if (oldValue != this._entitySet) {
3897
- this.queueAutoRefresh();
3898
- if (this.valid() && this.deferAutoRefresh) {
3899
- this.queueSchemaFetch();
3900
- }
3901
- }
3902
- },
3903
- enumerable: false,
3904
- configurable: true
3905
- });
3906
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "timeoutMilliseconds", {
3907
- get: function () {
3908
- return this._timeoutMilliseconds;
3909
- },
3910
- set: function (value) {
3911
- this._timeoutMilliseconds = value;
3912
- this.queueAutoRefresh();
3913
- },
3914
- enumerable: false,
3915
- configurable: true
3916
- });
3917
- RestVirtualDataSourceDataProvider.prototype.getItemValue = function (item, valueName) {
3918
- var dic = item;
3919
- if (dic.has(valueName)) {
3920
- return dic.get(valueName);
3921
- }
3922
- else {
3923
- return null;
3924
- }
3925
- };
3926
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "actualCount", {
3927
- get: function () {
3928
- return this._currentFullCount;
3929
- },
3930
- enumerable: false,
3931
- configurable: true
3932
- });
3933
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "actualSchema", {
3934
- get: function () {
3935
- return this._currentSchema;
3936
- },
3937
- enumerable: false,
3938
- configurable: true
3939
- });
3940
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "executionContext", {
3941
- get: function () {
3942
- return this._executionContext;
3943
- },
3944
- set: function (value) {
3945
- this._executionContext = value;
3946
- this.queueAutoRefresh();
3947
- },
3948
- enumerable: false,
3949
- configurable: true
3950
- });
3951
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "updateNotifier", {
3952
- get: function () {
3953
- return this._updateNotifier;
3954
- },
3955
- set: function (value) {
3956
- this._updateNotifier = value;
3957
- },
3958
- enumerable: false,
3959
- configurable: true
3960
- });
3961
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "deferAutoRefresh", {
3962
- get: function () {
3963
- return this._deferAutoRefresh;
3964
- },
3965
- set: function (value) {
3966
- this._deferAutoRefresh = value;
3967
- if (!this._deferAutoRefresh) {
3968
- this.queueAutoRefresh();
3969
- }
3970
- if (this._deferAutoRefresh && this.valid() && this._currentSchema == null) {
3971
- this.queueSchemaFetch();
3972
- }
3973
- },
3974
- enumerable: false,
3975
- configurable: true
3976
- });
3977
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "isSortingSupported", {
3978
- get: function () {
3979
- return true;
3980
- },
3981
- enumerable: false,
3982
- configurable: true
3983
- });
3984
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "isGroupingSupported", {
3985
- get: function () {
3986
- return this.isAggregationSupported;
3987
- },
3988
- enumerable: false,
3989
- configurable: true
3990
- });
3991
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "isFilteringSupported", {
3992
- get: function () {
3993
- return true;
3994
- },
3995
- enumerable: false,
3996
- configurable: true
3997
- });
3998
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "isAggregationSupported", {
3999
- get: function () {
4000
- return this._isAggregationSupported;
4001
- },
4002
- set: function (isSupported) {
4003
- this._isAggregationSupported = isSupported;
4004
- },
4005
- enumerable: false,
4006
- configurable: true
4007
- });
4008
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "sortDescriptions", {
4009
- get: function () {
4010
- return this._sortDescriptions;
4011
- },
4012
- enumerable: false,
4013
- configurable: true
4014
- });
4015
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "groupDescriptions", {
4016
- get: function () {
4017
- return this._groupDescriptions;
4018
- },
4019
- enumerable: false,
4020
- configurable: true
4021
- });
4022
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "propertiesRequested", {
4023
- get: function () {
4024
- return this._propertiesRequested;
4025
- },
4026
- set: function (value) {
4027
- this._propertiesRequested = value;
4028
- this.queueAutoRefresh();
4029
- },
4030
- enumerable: false,
4031
- configurable: true
4032
- });
4033
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "schemaIncludedProperties", {
4034
- get: function () {
4035
- return this._schemaIncludedProperties;
4036
- },
4037
- set: function (value) {
4038
- this._schemaIncludedProperties = value;
4039
- this.queueAutoRefresh();
4040
- },
4041
- enumerable: false,
4042
- configurable: true
4043
- });
4044
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "filterExpressions", {
4045
- get: function () {
4046
- return this._filterExpressions;
4047
- },
4048
- enumerable: false,
4049
- configurable: true
4050
- });
4051
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "summaryDescriptions", {
4052
- get: function () {
4053
- return this._summaryDescriptions;
4054
- },
4055
- enumerable: false,
4056
- configurable: true
4057
- });
4058
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "summaryScope", {
4059
- get: function () {
4060
- return this._summaryScope;
4061
- },
4062
- set: function (value) {
4063
- this._summaryScope = value;
4064
- },
4065
- enumerable: false,
4066
- configurable: true
4067
- });
4068
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "enableJsonp", {
4069
- get: function () {
4070
- return this._enableJsonp;
4071
- },
4072
- set: function (isEnabled) {
4073
- this._enableJsonp = isEnabled;
4074
- },
4075
- enumerable: false,
4076
- configurable: true
4077
- });
4078
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "fixedFullCount", {
4079
- get: function () {
4080
- return this._fixedFullCount;
4081
- },
4082
- set: function (value) {
4083
- this._fixedFullCount = value;
4084
- },
4085
- enumerable: false,
4086
- configurable: true
4087
- });
4088
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideFullCount", {
4089
- get: function () {
4090
- return this._provideFullCount;
4091
- },
4092
- set: function (value) {
4093
- this._provideFullCount = value;
4094
- },
4095
- enumerable: false,
4096
- configurable: true
4097
- });
4098
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideOrderByParameter", {
4099
- get: function () {
4100
- return this._provideOrderByParameter;
4101
- },
4102
- set: function (value) {
4103
- this._provideOrderByParameter = value;
4104
- },
4105
- enumerable: false,
4106
- configurable: true
4107
- });
4108
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideFilterParameter", {
4109
- get: function () {
4110
- return this._provideFilterParameter;
4111
- },
4112
- set: function (value) {
4113
- this._provideFilterParameter = value;
4114
- },
4115
- enumerable: false,
4116
- configurable: true
4117
- });
4118
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideAggregationParameter", {
4119
- get: function () {
4120
- return this._provideAggregationParameter;
4121
- },
4122
- set: function (value) {
4123
- this._provideAggregationParameter = value;
4124
- },
4125
- enumerable: false,
4126
- configurable: true
4127
- });
4128
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideAggregatedCount", {
4129
- get: function () {
4130
- return this._provideAggregatedCount;
4131
- },
4132
- set: function (value) {
4133
- this._provideAggregatedCount = value;
4134
- },
4135
- enumerable: false,
4136
- configurable: true
4137
- });
4138
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideUri", {
4139
- get: function () {
4140
- return this._provideUri;
4141
- },
4142
- set: function (value) {
4143
- this._provideUri = value;
4144
- },
4145
- enumerable: false,
4146
- configurable: true
4147
- });
4148
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "performFetch", {
4149
- get: function () {
4150
- return this._performFetch;
4151
- },
4152
- set: function (value) {
4153
- this._performFetch = value;
4154
- },
4155
- enumerable: false,
4156
- configurable: true
4157
- });
4158
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "providePagingParameter", {
4159
- get: function () {
4160
- return this._providePagingParameter;
4161
- },
4162
- set: function (value) {
4163
- this._providePagingParameter = value;
4164
- },
4165
- enumerable: false,
4166
- configurable: true
4167
- });
4168
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideDesiredPropertiesParameter", {
4169
- get: function () {
4170
- return this._provideDesiredPropertiesParameter;
4171
- },
4172
- set: function (value) {
4173
- this._provideDesiredPropertiesParameter = value;
4174
- },
4175
- enumerable: false,
4176
- configurable: true
4177
- });
4178
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideItems", {
4179
- get: function () {
4180
- return this._provideItems;
4181
- },
4182
- set: function (value) {
4183
- this._provideItems = value;
4184
- },
4185
- enumerable: false,
4186
- configurable: true
4187
- });
4188
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "notifyUsingSourceIndexes", {
4189
- get: function () {
4190
- return true;
4191
- },
4192
- enumerable: false,
4193
- configurable: true
4194
- });
4195
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "isItemIndexLookupSupported", {
4196
- get: function () {
4197
- return false;
4198
- },
4199
- enumerable: false,
4200
- configurable: true
4201
- });
4202
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "isKeyIndexLookupSupported", {
4203
- get: function () {
4204
- return false;
4205
- },
4206
- enumerable: false,
4207
- configurable: true
4208
- });
4209
- RestVirtualDataSourceDataProvider.prototype.notifySetItem = function (index, oldItem, newItem) {
4210
- if (this.updateNotifier != null) {
4211
- this.updateNotifier.notifySetItem(index, oldItem, newItem);
4212
- }
4213
- };
4214
- RestVirtualDataSourceDataProvider.prototype.notifyClearItems = function () {
4215
- if (this.updateNotifier != null) {
4216
- this.updateNotifier.notifyClearItems();
4217
- }
4218
- };
4219
- RestVirtualDataSourceDataProvider.prototype.notifyInsertItem = function (index, newItem) {
4220
- if (this.updateNotifier != null) {
4221
- this.updateNotifier.notifyInsertItem(index, newItem);
4222
- }
4223
- };
4224
- RestVirtualDataSourceDataProvider.prototype.notifyRemoveItem = function (index, oldItem) {
4225
- if (this.updateNotifier != null) {
4226
- this.updateNotifier.notifyRemoveItem(index, oldItem);
4227
- }
4228
- };
4229
- RestVirtualDataSourceDataProvider.prototype.queueSchemaFetch = function () {
4230
- if (this._schemaFetchQueued) {
4231
- return;
4232
- }
4233
- if (this.executionContext != null) {
4234
- this._schemaFetchQueued = true;
4235
- this.executionContext.enqueueAction(igniteuiWebcomponentsCore.runOn(this, this.doSchemaFetchInternal));
4236
- }
4237
- };
4238
- RestVirtualDataSourceDataProvider.prototype.doSchemaFetchInternal = function () {
4239
- if (!this._schemaFetchQueued) {
4240
- return;
4241
- }
4242
- this._schemaFetchQueued = false;
4243
- this.schemaFetchInternal();
4244
- };
4245
- RestVirtualDataSourceDataProvider.prototype.schemaFetchInternal = function () {
4246
- this.schemaFetchInternalOverride();
4247
- };
4248
- RestVirtualDataSourceDataProvider.prototype.schemaFetchInternalOverride = function () {
4249
- if (!this.deferAutoRefresh) {
4250
- return;
4251
- }
4252
- this.removeAllPageRequests();
4253
- this.killWorker();
4254
- this.createWorker();
4255
- this.addSchemaRequest();
4256
- };
4257
- RestVirtualDataSourceDataProvider.prototype.addSchemaRequest = function () {
4258
- this._worker.addPageRequest(RestVirtualDataSourceDataProviderWorker.schemaRequestIndex, igniteuiWebcomponentsCore.DataSourcePageRequestPriority.High);
4259
- };
4260
- RestVirtualDataSourceDataProvider.prototype.queueAutoRefresh = function () {
4261
- if (this.deferAutoRefresh) {
4262
- return;
4263
- }
4264
- if (this._autoRefreshQueued) {
4265
- return;
4266
- }
4267
- if (this.executionContext != null) {
4268
- this._autoRefreshQueued = true;
4269
- this.executionContext.enqueueAction(igniteuiWebcomponentsCore.runOn(this, this.doRefreshInternal));
4270
- }
4271
- };
4272
- RestVirtualDataSourceDataProvider.prototype.doRefreshInternal = function () {
4273
- if (this.deferAutoRefresh) {
4274
- this._autoRefreshQueued = false;
4275
- return;
4276
- }
4277
- if (!this._autoRefreshQueued) {
4278
- return;
4279
- }
4280
- this._autoRefreshQueued = false;
4281
- this.refreshInternal();
4282
- };
4283
- RestVirtualDataSourceDataProvider.prototype.refreshInternal = function () {
4284
- this.refreshInternalOverride();
4285
- };
4286
- RestVirtualDataSourceDataProvider.prototype.refreshInternalOverride = function () {
4287
- this.removeAllPageRequests();
4288
- this.killWorker();
4289
- this.createWorker();
4290
- this._worker.addPageRequest(0, igniteuiWebcomponentsCore.DataSourcePageRequestPriority.Normal);
4291
- };
4292
- RestVirtualDataSourceDataProvider.prototype.flushAutoRefresh = function () {
4293
- this.doRefreshInternal();
4294
- };
4295
- RestVirtualDataSourceDataProvider.prototype.refresh = function () {
4296
- this.refreshInternal();
4297
- };
4298
- RestVirtualDataSourceDataProvider.prototype.indexOfItem = function (item) {
4299
- return -1;
4300
- };
4301
- RestVirtualDataSourceDataProvider.prototype.indexOfKey = function (key) {
4302
- return -1;
4303
- };
4304
- RestVirtualDataSourceDataProvider.prototype.resolveSchemaPropertyType = function (propertyPath) {
4305
- if (this.actualSchema == null) {
4306
- return igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.ObjectValue;
4307
- }
4308
- if (igniteuiWebcomponentsCore.stringContains(propertyPath, ".")) {
4309
- return igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.ObjectValue;
4310
- }
4311
- for (var i = 0; i < this.actualSchema.propertyNames.length; i++) {
4312
- var name_1 = this.actualSchema.propertyNames[i];
4313
- if (name_1 == propertyPath) {
4314
- return this.actualSchema.propertyTypes[i];
4315
- }
4316
- }
4317
- return igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.ObjectValue;
4318
- };
4319
- RestVirtualDataSourceDataProvider.prototype.setItemValue = function (item, valueName, value) {
4320
- // does nothing.
4321
- };
4322
- RestVirtualDataSourceDataProvider.prototype.removeItem = function (item) {
4323
- // does nothing.
4324
- };
4325
- RestVirtualDataSourceDataProvider.prototype.addItem = function (item) {
4326
- // does nothing.
4327
- };
4328
- RestVirtualDataSourceDataProvider.prototype.createBatchRequest = function (changes) {
4329
- if (this._worker != null) {
4330
- this._worker.createBatchRequest(changes);
4331
- }
4332
- };
4333
- Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "batchCompleted", {
4334
- get: function () {
4335
- return this._batchCompleted;
4336
- },
4337
- set: function (v) {
4338
- this._batchCompleted = v;
4339
- },
4340
- enumerable: false,
4341
- configurable: true
4342
- });
4343
- RestVirtualDataSourceDataProvider.$t = igniteuiWebcomponentsCore.markType(RestVirtualDataSourceDataProvider, 'ODataVirtualDataSourceDataProvider', igniteuiWebcomponentsCore.Base.$type, [igniteuiWebcomponentsCore.IDataSourceVirtualDataProvider_$type]);
4344
- return RestVirtualDataSourceDataProvider;
4345
- }(igniteuiWebcomponentsCore.Base));
4346
-
4347
- var RestVirtualDataSource = /** @class */ /*@__PURE__*/ (function (_super) {
4348
- tslib.__extends(RestVirtualDataSource, _super);
4349
- function RestVirtualDataSource() {
4350
- var _this = _super.call(this) || this;
4351
- _this._baseUri = null;
4352
- _this._isFilteringSupportedByServer = false;
4353
- _this._entitySet = null;
4354
- _this._timeoutMilliseconds = 10000;
4355
- _this._isAggregationSupportedByServer = false;
4356
- _this._enableJsonp = true;
4357
- _this._fixedFullCount = -1;
4358
- _this._provideFullCount = null;
4359
- _this._provideOrderByParameter = null;
4360
- _this._provideFilterParameter = null;
4361
- _this._provideAggregationParameter = null;
4362
- _this._provideAggregatedCount = null;
4363
- _this._provideUri = null;
4364
- _this._performFetch = null;
4365
- _this._providePagingParameter = null;
4366
- _this._provideDesiredPropertiesParameter = null;
4367
- _this.dataProvider = ((function () {
4368
- var $ret = new RestVirtualDataSourceDataProvider();
4369
- $ret.executionContext = _this.executionContext;
4370
- $ret.enableJsonp = _this.enableJsonp;
4371
- $ret.isAggregationSupported = _this.isGroupingSupported;
4372
- return $ret;
4373
- })());
4374
- _this.externalDataSource = _this;
4375
- return _this;
4376
- }
4377
- RestVirtualDataSource.prototype.onBaseUriChanged = function (oldValue, newValue) {
4378
- if (this.actualDataProvider) {
4379
- this.actualDataProvider.baseUri = this.baseUri;
4380
- this.queueAutoRefresh();
4381
- }
4382
- };
4383
- Object.defineProperty(RestVirtualDataSource.prototype, "baseUri", {
4384
- get: function () {
4385
- return this._baseUri;
4386
- },
4387
- set: function (value) {
4388
- var oldValue = this._baseUri;
4389
- this._baseUri = value;
4390
- if (oldValue != this._baseUri) {
4391
- this.onBaseUriChanged(oldValue, this._baseUri);
4392
- }
4393
- },
4394
- enumerable: false,
4395
- configurable: true
4396
- });
4397
- RestVirtualDataSource.prototype.onEntitySetChanged = function (oldValue, newValue) {
4398
- if (this.actualDataProvider) {
4399
- this.actualDataProvider.entitySet = this.entitySet;
4400
- this.queueAutoRefresh();
4401
- }
4402
- this.queueAutoRefresh();
4403
- };
4404
- Object.defineProperty(RestVirtualDataSource.prototype, "isFilteringSupportedByServer", {
4405
- get: function () {
4406
- return this._isFilteringSupportedByServer;
4407
- },
4408
- set: function (v) {
4409
- this._isFilteringSupportedByServer = v;
4410
- },
4411
- enumerable: false,
4412
- configurable: true
4413
- });
4414
- RestVirtualDataSource.prototype.get_isFilteringSupported = function () {
4415
- if (this._isFilteringSupportedByServer) {
4416
- return true;
4417
- }
4418
- return false;
4419
- };
4420
- Object.defineProperty(RestVirtualDataSource.prototype, "entitySet", {
4421
- get: function () {
4422
- return this._entitySet;
4423
- },
4424
- set: function (value) {
4425
- var oldValue = this._entitySet;
4426
- this._entitySet = value;
4427
- if (this._entitySet != oldValue) {
4428
- this.onEntitySetChanged(oldValue, this._entitySet);
4429
- }
4430
- },
4431
- enumerable: false,
4432
- configurable: true
4433
- });
4434
- RestVirtualDataSource.prototype.onTimeoutMillisecondsChanged = function (oldValue, newValue) {
4435
- if (this.actualDataProvider) {
4436
- this.actualDataProvider.timeoutMilliseconds = this.timeoutMilliseconds;
4437
- }
4438
- };
4439
- Object.defineProperty(RestVirtualDataSource.prototype, "timeoutMilliseconds", {
4440
- get: function () {
4441
- return this._timeoutMilliseconds;
4442
- },
4443
- set: function (value) {
4444
- var oldValue = this._timeoutMilliseconds;
4445
- this._timeoutMilliseconds = value;
4446
- if (oldValue != this._timeoutMilliseconds) {
4447
- this.onTimeoutMillisecondsChanged(oldValue, this._timeoutMilliseconds);
4448
- }
4449
- },
4450
- enumerable: false,
4451
- configurable: true
4452
- });
4453
- Object.defineProperty(RestVirtualDataSource.prototype, "isSortingSupportedOverride", {
4454
- get: function () {
4455
- return true;
4456
- },
4457
- enumerable: false,
4458
- configurable: true
4459
- });
4460
- Object.defineProperty(RestVirtualDataSource.prototype, "isFilteringSupportedOverride", {
4461
- get: function () {
4462
- return true;
4463
- },
4464
- enumerable: false,
4465
- configurable: true
4466
- });
4467
- Object.defineProperty(RestVirtualDataSource.prototype, "isGroupingSupportedOverride", {
4468
- get: function () {
4469
- return this.isAggregationSupportedByServer;
4470
- },
4471
- enumerable: false,
4472
- configurable: true
4473
- });
4474
- Object.defineProperty(RestVirtualDataSource.prototype, "isAggregationSupportedByServer", {
4475
- get: function () {
4476
- return this._isAggregationSupportedByServer;
4477
- },
4478
- set: function (isSupported) {
4479
- this._isAggregationSupportedByServer = isSupported;
4480
- if (this.actualDataProvider) {
4481
- this.actualDataProvider.isAggregationSupported = this.isAggregationSupportedByServer;
4482
- }
4483
- },
4484
- enumerable: false,
4485
- configurable: true
4486
- });
4487
- Object.defineProperty(RestVirtualDataSource.prototype, "enableJsonp", {
4488
- get: function () {
4489
- return this._enableJsonp;
4490
- },
4491
- set: function (isEnabled) {
4492
- this._enableJsonp = isEnabled;
4493
- if (this.actualDataProvider) {
4494
- this.actualDataProvider.enableJsonp = this.enableJsonp;
4495
- }
4496
- },
4497
- enumerable: false,
4498
- configurable: true
4499
- });
4500
- Object.defineProperty(RestVirtualDataSource.prototype, "fixedFullCount", {
4501
- get: function () {
4502
- return this._fixedFullCount;
4503
- },
4504
- set: function (value) {
4505
- this._fixedFullCount = value;
4506
- },
4507
- enumerable: false,
4508
- configurable: true
4509
- });
4510
- Object.defineProperty(RestVirtualDataSource.prototype, "provideFullCount", {
4511
- get: function () {
4512
- return this._provideFullCount;
4513
- },
4514
- set: function (value) {
4515
- this._provideFullCount = value;
4516
- if (this.actualDataProvider) {
4517
- this.actualDataProvider.provideFullCount = this.provideFullCount;
4518
- this.queueAutoRefresh();
4519
- }
4520
- },
4521
- enumerable: false,
4522
- configurable: true
4523
- });
4524
- Object.defineProperty(RestVirtualDataSource.prototype, "provideOrderByParameter", {
4525
- get: function () {
4526
- return this._provideOrderByParameter;
4527
- },
4528
- set: function (value) {
4529
- this._provideOrderByParameter = value;
4530
- if (this.actualDataProvider) {
4531
- this.actualDataProvider.provideOrderByParameter = this.provideOrderByParameter;
4532
- this.queueAutoRefresh();
4533
- }
4534
- },
4535
- enumerable: false,
4536
- configurable: true
4537
- });
4538
- Object.defineProperty(RestVirtualDataSource.prototype, "provideFilterParameter", {
4539
- get: function () {
4540
- return this._provideFilterParameter;
4541
- },
4542
- set: function (value) {
4543
- this._provideFilterParameter = value;
4544
- if (this.actualDataProvider) {
4545
- this.actualDataProvider.provideFilterParameter = this.provideFilterParameter;
4546
- this.queueAutoRefresh();
4547
- }
4548
- },
4549
- enumerable: false,
4550
- configurable: true
4551
- });
4552
- Object.defineProperty(RestVirtualDataSource.prototype, "provideAggregationParameter", {
4553
- get: function () {
4554
- return this._provideAggregationParameter;
4555
- },
4556
- set: function (value) {
4557
- this._provideAggregationParameter = value;
4558
- if (this.actualDataProvider) {
4559
- this.actualDataProvider.provideAggregationParameter = this.provideAggregationParameter;
4560
- this.queueAutoRefresh();
4561
- }
4562
- },
4563
- enumerable: false,
4564
- configurable: true
4565
- });
4566
- Object.defineProperty(RestVirtualDataSource.prototype, "provideAggregatedCount", {
4567
- get: function () {
4568
- return this._provideAggregatedCount;
4569
- },
4570
- set: function (value) {
4571
- this._provideAggregatedCount = value;
4572
- if (this.actualDataProvider) {
4573
- this.actualDataProvider.provideAggregatedCount = this.provideAggregatedCount;
4574
- this.queueAutoRefresh();
4575
- }
4576
- },
4577
- enumerable: false,
4578
- configurable: true
4579
- });
4580
- Object.defineProperty(RestVirtualDataSource.prototype, "provideUri", {
4581
- get: function () {
4582
- return this._provideUri;
4583
- },
4584
- set: function (value) {
4585
- this._provideUri = value;
4586
- if (this.actualDataProvider) {
4587
- this.actualDataProvider.provideUri = this.provideUri;
4588
- this.queueAutoRefresh();
4589
- }
4590
- },
4591
- enumerable: false,
4592
- configurable: true
4593
- });
4594
- Object.defineProperty(RestVirtualDataSource.prototype, "performFetch", {
4595
- get: function () {
4596
- return this._performFetch;
4597
- },
4598
- set: function (value) {
4599
- this._performFetch = value;
4600
- if (this.actualDataProvider) {
4601
- this.actualDataProvider.performFetch = this.performFetch;
4602
- this.queueAutoRefresh();
4603
- }
4604
- },
4605
- enumerable: false,
4606
- configurable: true
4607
- });
4608
- Object.defineProperty(RestVirtualDataSource.prototype, "providePagingParameter", {
4609
- get: function () {
4610
- return this._providePagingParameter;
4611
- },
4612
- set: function (value) {
4613
- this._providePagingParameter = value;
4614
- if (this.actualDataProvider) {
4615
- this.actualDataProvider.providePagingParameter = this.providePagingParameter;
4616
- this.queueAutoRefresh();
4617
- }
4618
- },
4619
- enumerable: false,
4620
- configurable: true
4621
- });
4622
- Object.defineProperty(RestVirtualDataSource.prototype, "provideDesiredPropertiesParameter", {
4623
- get: function () {
4624
- return this._provideDesiredPropertiesParameter;
4625
- },
4626
- set: function (value) {
4627
- this._provideDesiredPropertiesParameter = value;
4628
- if (this.actualDataProvider) {
4629
- this.actualDataProvider.provideDesiredPropertiesParameter = this.provideDesiredPropertiesParameter;
4630
- this.queueAutoRefresh();
4631
- }
4632
- },
4633
- enumerable: false,
4634
- configurable: true
4635
- });
4636
- Object.defineProperty(RestVirtualDataSource.prototype, "provideItems", {
4637
- get: function () {
4638
- return this._provideItems;
4639
- },
4640
- set: function (value) {
4641
- this._provideItems = value;
4642
- if (this.actualDataProvider) {
4643
- this.actualDataProvider.provideItems = this.provideItems;
4644
- this.queueAutoRefresh();
4645
- }
4646
- },
4647
- enumerable: false,
4648
- configurable: true
4649
- });
4650
- RestVirtualDataSource.prototype.clone = function () {
4651
- var dataSource = new RestVirtualDataSource();
4652
- dataSource.executionContext = this.executionContext;
4653
- dataSource.includeSummaryRowsInSection = this.includeSummaryRowsInSection;
4654
- dataSource.isSectionCollapsable = this.isSectionCollapsable;
4655
- dataSource.isSectionExpandedDefault = this.isSectionExpandedDefault;
4656
- //dataSource.isSectionHeaderNormalRow = this.isSectionHeaderNormalRow;
4657
- dataSource.isSectionSummaryRowsAtBottom = this.isSectionSummaryRowsAtBottom;
4658
- //dataSource.isSectionContentVisible = this.isSectionContentVisible;
4659
- dataSource.primaryKey = this.primaryKey;
4660
- dataSource.propertiesRequested = this.propertiesRequested;
4661
- dataSource.sectionHeaderDisplayMode = this.sectionHeaderDisplayMode;
4662
- dataSource.shouldEmitSectionFooters = this.shouldEmitSectionFooters;
4663
- dataSource.shouldEmitSectionHeaders = this.shouldEmitSectionHeaders;
4664
- dataSource.shouldEmitShiftedRows = this.shouldEmitShiftedRows;
4665
- dataSource.summaryScope = this.summaryScope;
4666
- for (var i = 0; i < this.groupDescriptions.size(); i++) {
4667
- dataSource.groupDescriptions.add(this.groupDescriptions.get(i));
4668
- }
4669
- for (var i = 0; i < this.sortDescriptions.size(); i++) {
4670
- dataSource.sortDescriptions.add(this.sortDescriptions.get(i));
4671
- }
4672
- for (var i = 0; i < this.filterExpressions.size(); i++) {
4673
- dataSource.filterExpressions.add(this.filterExpressions.get(i));
4674
- }
4675
- for (var i = 0; i < this.summaryDescriptions.size(); i++) {
4676
- dataSource.summaryDescriptions.add(this.summaryDescriptions.get(i));
4677
- }
4678
- dataSource.pageSizeRequested = this.pageSizeRequested;
4679
- dataSource.maxCachedPages = this.maxCachedPages;
4680
- dataSource.baseUri = this.baseUri;
4681
- dataSource.entitySet = this.entitySet;
4682
- dataSource.timeoutMilliseconds = this.timeoutMilliseconds;
4683
- dataSource.isAggregationSupportedByServer = this.isAggregationSupportedByServer;
4684
- dataSource.enableJsonp = this.enableJsonp;
4685
- dataSource.fixedFullCount = this.fixedFullCount;
4686
- dataSource.provideAggregationParameter = this.provideAggregationParameter;
4687
- dataSource.provideAggregatedCount = this.provideAggregatedCount;
4688
- dataSource.provideFilterParameter = this.provideFilterParameter;
4689
- dataSource.provideFullCount = this.provideFullCount;
4690
- dataSource.provideOrderByParameter = this.provideOrderByParameter;
4691
- dataSource.provideUri = this.provideUri;
4692
- dataSource.performFetch = this.performFetch;
4693
- dataSource.providePagingParameter = this.providePagingParameter;
4694
- dataSource.provideItems = this.provideItems;
4695
- dataSource.provideDesiredPropertiesParameter = this.provideDesiredPropertiesParameter;
4696
- return dataSource;
4697
- };
4698
- return RestVirtualDataSource;
4699
- }(igniteuiWebcomponentsCore.VirtualDataSource));
4700
-
4701
- exports.Entity = Entity;
4702
- exports.EntityProperty = EntityProperty;
4703
- exports.EntitySet = EntitySet;
4704
- exports.LinkedList = LinkedList;
4705
- exports.LinkedListNode = LinkedListNode;
4706
- exports.ODataDataSourcePage = ODataDataSourcePage;
4707
- exports.ODataSchemaProvider = ODataSchemaProvider;
4708
- exports.ODataVirtualDataSource = ODataVirtualDataSource;
4709
- exports.ODataVirtualDataSourceDataProvider = ODataVirtualDataSourceDataProvider;
4710
- exports.ODataVirtualDataSourceDataProviderWorker = ODataVirtualDataSourceDataProviderWorker;
4711
- exports.ODataVirtualDataSourceDataProviderWorkerSettings = ODataVirtualDataSourceDataProviderWorkerSettings;
4712
- exports.ODataVirtualDataSourceProviderTaskDataHolder = ODataVirtualDataSourceProviderTaskDataHolder;
4713
- exports.RestVirtualDataSource = RestVirtualDataSource;
4714
- exports.RestVirtualDataSourceDataProvider = RestVirtualDataSourceDataProvider;
4715
- exports.RestVirtualDataSourceDataProviderWorker = RestVirtualDataSourceDataProviderWorker;
4716
- exports.RestVirtualDataSourceDataProviderWorkerSettings = RestVirtualDataSourceDataProviderWorkerSettings;
4717
- exports.RestVirtualDataSourcePage = RestVirtualDataSourcePage;
4718
- exports.RestVirtualDataSourceProviderTaskDataHolder = RestVirtualDataSourceProviderTaskDataHolder;
4719
- exports.Schema = Schema;
4720
- exports.first = first;
4721
- exports.toArray = toArray;
4722
-
4723
- Object.defineProperty(exports, '__esModule', { value: true });
4724
-
4725
- })));