igniteui-webcomponents-datasources 1.4.1 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/bundles/igniteui-webcomponents-datasources.umd.js +2279 -1
  2. package/bundles/igniteui-webcomponents-datasources.umd.min.js +7 -2
  3. package/esm2015/igniteui-webcomponents-datasources.js +0 -1
  4. package/esm2015/lib/Entity.js +0 -1
  5. package/esm2015/lib/EntityProperty.js +0 -1
  6. package/esm2015/lib/EntitySet.js +0 -1
  7. package/esm2015/lib/ODataDataSourcePage.js +0 -1
  8. package/esm2015/lib/ODataSchemaProvider.js +0 -1
  9. package/esm2015/lib/ODataVirtualDataSource.js +0 -1
  10. package/esm2015/lib/ODataVirtualDataSourceDataProvider.js +0 -1
  11. package/esm2015/lib/ODataVirtualDataSourceDataProviderWorker.js +0 -1
  12. package/esm2015/lib/ODataVirtualDataSourceDataProviderWorkerSettings.js +0 -1
  13. package/esm2015/lib/ODataVirtualDataSourceProviderTaskDataHolder.js +0 -1
  14. package/esm2015/lib/RestVirtualDataSource.js +272 -0
  15. package/esm2015/lib/RestVirtualDataSourceDataProvider.js +528 -0
  16. package/esm2015/lib/RestVirtualDataSourceDataProviderWorker.js +744 -0
  17. package/esm2015/lib/RestVirtualDataSourceDataProviderWorkerSettings.js +154 -0
  18. package/esm2015/lib/RestVirtualDataSourcePage.js +67 -0
  19. package/esm2015/lib/RestVirtualDataSourceProviderTaskDataHolder.js +8 -0
  20. package/esm2015/lib/Schema.js +0 -1
  21. package/esm2015/lib/util.js +0 -1
  22. package/esm2015/public_api.js +6 -1
  23. package/esm5/igniteui-webcomponents-datasources.js +0 -1
  24. package/esm5/lib/Entity.js +0 -1
  25. package/esm5/lib/EntityProperty.js +0 -1
  26. package/esm5/lib/EntitySet.js +0 -1
  27. package/esm5/lib/ODataDataSourcePage.js +0 -1
  28. package/esm5/lib/ODataSchemaProvider.js +0 -1
  29. package/esm5/lib/ODataVirtualDataSource.js +0 -1
  30. package/esm5/lib/ODataVirtualDataSourceDataProvider.js +0 -1
  31. package/esm5/lib/ODataVirtualDataSourceDataProviderWorker.js +0 -1
  32. package/esm5/lib/ODataVirtualDataSourceDataProviderWorkerSettings.js +0 -1
  33. package/esm5/lib/ODataVirtualDataSourceProviderTaskDataHolder.js +0 -1
  34. package/esm5/lib/RestVirtualDataSource.js +357 -0
  35. package/esm5/lib/RestVirtualDataSourceDataProvider.js +675 -0
  36. package/esm5/lib/RestVirtualDataSourceDataProviderWorker.js +948 -0
  37. package/esm5/lib/RestVirtualDataSourceDataProviderWorkerSettings.js +240 -0
  38. package/esm5/lib/RestVirtualDataSourcePage.js +73 -0
  39. package/esm5/lib/RestVirtualDataSourceProviderTaskDataHolder.js +12 -0
  40. package/esm5/lib/Schema.js +0 -1
  41. package/esm5/lib/util.js +0 -1
  42. package/esm5/public_api.js +6 -1
  43. package/fesm2015/igniteui-webcomponents-datasources.js +1754 -3
  44. package/fesm5/igniteui-webcomponents-datasources.js +2275 -3
  45. package/lib/RestVirtualDataSource.d.ts +60 -0
  46. package/lib/RestVirtualDataSourceDataProvider.d.ts +135 -0
  47. package/lib/RestVirtualDataSourceDataProviderWorker.d.ts +69 -0
  48. package/lib/RestVirtualDataSourceDataProviderWorkerSettings.d.ts +60 -0
  49. package/lib/RestVirtualDataSourcePage.d.ts +19 -0
  50. package/lib/RestVirtualDataSourceProviderTaskDataHolder.d.ts +5 -0
  51. package/package.json +3 -3
  52. package/public_api.d.ts +6 -0
  53. package/bundles/igniteui-webcomponents-datasources.umd.js.map +0 -1
  54. package/bundles/igniteui-webcomponents-datasources.umd.min.js.map +0 -1
  55. package/esm2015/igniteui-webcomponents-datasources.js.map +0 -1
  56. package/esm2015/lib/Entity.js.map +0 -1
  57. package/esm2015/lib/EntityProperty.js.map +0 -1
  58. package/esm2015/lib/EntitySet.js.map +0 -1
  59. package/esm2015/lib/ODataDataSourcePage.js.map +0 -1
  60. package/esm2015/lib/ODataSchemaProvider.js.map +0 -1
  61. package/esm2015/lib/ODataVirtualDataSource.js.map +0 -1
  62. package/esm2015/lib/ODataVirtualDataSourceDataProvider.js.map +0 -1
  63. package/esm2015/lib/ODataVirtualDataSourceDataProviderWorker.js.map +0 -1
  64. package/esm2015/lib/ODataVirtualDataSourceDataProviderWorkerSettings.js.map +0 -1
  65. package/esm2015/lib/ODataVirtualDataSourceProviderTaskDataHolder.js.map +0 -1
  66. package/esm2015/lib/Schema.js.map +0 -1
  67. package/esm2015/lib/util.js.map +0 -1
  68. package/esm2015/public_api.js.map +0 -1
  69. package/esm5/igniteui-webcomponents-datasources.js.map +0 -1
  70. package/esm5/lib/Entity.js.map +0 -1
  71. package/esm5/lib/EntityProperty.js.map +0 -1
  72. package/esm5/lib/EntitySet.js.map +0 -1
  73. package/esm5/lib/ODataDataSourcePage.js.map +0 -1
  74. package/esm5/lib/ODataSchemaProvider.js.map +0 -1
  75. package/esm5/lib/ODataVirtualDataSource.js.map +0 -1
  76. package/esm5/lib/ODataVirtualDataSourceDataProvider.js.map +0 -1
  77. package/esm5/lib/ODataVirtualDataSourceDataProviderWorker.js.map +0 -1
  78. package/esm5/lib/ODataVirtualDataSourceDataProviderWorkerSettings.js.map +0 -1
  79. package/esm5/lib/ODataVirtualDataSourceProviderTaskDataHolder.js.map +0 -1
  80. package/esm5/lib/Schema.js.map +0 -1
  81. package/esm5/lib/util.js.map +0 -1
  82. package/esm5/public_api.js.map +0 -1
  83. package/fesm2015/igniteui-webcomponents-datasources.js.map +0 -1
  84. package/fesm5/igniteui-webcomponents-datasources.js.map +0 -1
@@ -1,3 +1,10 @@
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
+
1
8
  (function (global, factory) {
2
9
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('igniteui-webcomponents-core'), require('tslib')) :
3
10
  typeof define === 'function' && define.amd ? define(['exports', 'igniteui-webcomponents-core', 'tslib'], factory) :
@@ -2339,6 +2346,2272 @@
2339
2346
  return ODataVirtualDataSource;
2340
2347
  }(igniteuiWebcomponentsCore.VirtualDataSource));
2341
2348
 
2349
+ var RestVirtualDataSourceProviderTaskDataHolder = /** @class */ /*@__PURE__*/ (function (_super) {
2350
+ tslib_1.__extends(RestVirtualDataSourceProviderTaskDataHolder, _super);
2351
+ function RestVirtualDataSourceProviderTaskDataHolder() {
2352
+ return _super !== null && _super.apply(this, arguments) || this;
2353
+ }
2354
+ RestVirtualDataSourceProviderTaskDataHolder.$t = igniteuiWebcomponentsCore.markType(RestVirtualDataSourceProviderTaskDataHolder, 'ODataVirtualDataSourceProviderTaskDataHolder', igniteuiWebcomponentsCore.AsyncVirtualDataSourceProviderTaskDataHolder.$type);
2355
+ return RestVirtualDataSourceProviderTaskDataHolder;
2356
+ }(igniteuiWebcomponentsCore.AsyncVirtualDataSourceProviderTaskDataHolder));
2357
+
2358
+ var RestVirtualDataSourcePage = /** @class */ /*@__PURE__*/ (function () {
2359
+ function RestVirtualDataSourcePage(sourceData_, schema, groupInformation, summaryInformation, pageIndex) {
2360
+ this._actualData = null;
2361
+ this._schema = null;
2362
+ this._pageIndex = 0;
2363
+ this._groupInformation = null;
2364
+ this._summaryInformation = null;
2365
+ if (sourceData_ == null) {
2366
+ this._actualData = null;
2367
+ }
2368
+ else {
2369
+ var count = (sourceData_.items.length);
2370
+ this._actualData = [];
2371
+ var dateProps = new Set();
2372
+ for (var i = 0; i < schema.propertyNames.length; i++) {
2373
+ if (schema.propertyTypes[i] == igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.DateTimeValue || schema.propertyTypes[i] == igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.DateTimeOffsetValue) {
2374
+ dateProps.add(schema.propertyNames[i]);
2375
+ }
2376
+ }
2377
+ var value_ = void 0;
2378
+ var _loop_1 = function (i_) {
2379
+ var currItem_ = sourceData_.items[i_];
2380
+ var dict = new Map();
2381
+ var properties = Array.from(Object.keys(currItem_));
2382
+ var values = (properties.map(function (k) { return currItem_[k]; }));
2383
+ for (var i1 = 0; i1 < properties.length; i1++) {
2384
+ value_ = values[i1];
2385
+ if (dateProps.has(properties[i1])) {
2386
+ value_ = new Date(value_);
2387
+ }
2388
+ dict.set(properties[i1], value_);
2389
+ }
2390
+ this_1._actualData[i_] = dict;
2391
+ };
2392
+ var this_1 = this;
2393
+ for (var i_ = 0; i_ < count; i_++) {
2394
+ _loop_1(i_);
2395
+ }
2396
+ }
2397
+ this._schema = schema;
2398
+ this._groupInformation = groupInformation;
2399
+ this._summaryInformation = summaryInformation;
2400
+ this._pageIndex = pageIndex;
2401
+ }
2402
+ RestVirtualDataSourcePage.prototype.count = function () {
2403
+ return this._actualData.length;
2404
+ };
2405
+ RestVirtualDataSourcePage.prototype.getItemAtIndex = function (index) {
2406
+ return this._actualData[index];
2407
+ };
2408
+ RestVirtualDataSourcePage.prototype.getItemValueAtIndex = function (index, valueName) {
2409
+ var item = this._actualData[index];
2410
+ if (!item.has(valueName)) {
2411
+ return null;
2412
+ }
2413
+ return item.get(valueName);
2414
+ };
2415
+ RestVirtualDataSourcePage.prototype.pageIndex = function () {
2416
+ return this._pageIndex;
2417
+ };
2418
+ RestVirtualDataSourcePage.prototype.schema = function () {
2419
+ return this._schema;
2420
+ };
2421
+ RestVirtualDataSourcePage.prototype.getGroupInformation = function () {
2422
+ return this._groupInformation;
2423
+ };
2424
+ RestVirtualDataSourcePage.prototype.getSummaryInformation = function () {
2425
+ return this._summaryInformation;
2426
+ };
2427
+ return RestVirtualDataSourcePage;
2428
+ }());
2429
+
2430
+ var RestVirtualDataSourceDataProviderWorker = /** @class */ /*@__PURE__*/ (function (_super) {
2431
+ tslib_1.__extends(RestVirtualDataSourceDataProviderWorker, _super);
2432
+ function RestVirtualDataSourceDataProviderWorker(settings) {
2433
+ var e_1, _a;
2434
+ var _this = _super.call(this, settings) || this;
2435
+ _this._baseUri = null;
2436
+ _this._entitySet = null;
2437
+ _this._sortDescriptions = null;
2438
+ _this._groupDescriptions = null;
2439
+ _this._filterExpressions = null;
2440
+ _this._summaryDescriptions = null;
2441
+ _this._desiredPropeties = null;
2442
+ _this._enableJsonp = true;
2443
+ _this._isAggregationSupported = false;
2444
+ _this._provideFullCount = null;
2445
+ _this._provideOrderByParameter = null;
2446
+ _this._provideFilterParameter = null;
2447
+ _this._provideAggregationParameter = null;
2448
+ _this._provideAggregatedCount = null;
2449
+ _this._providePagingParameter = null;
2450
+ _this._provideDesiredPropertiesParameter = null;
2451
+ _this._provideUri = null;
2452
+ _this._performFetch = null;
2453
+ _this._fixedFullCount = -1;
2454
+ _this._groupInformation = null;
2455
+ _this._summaryInformation = null;
2456
+ _this._filterString = null;
2457
+ _this._selectedString = null;
2458
+ _this.doWork = _this.doWork.bind(_this);
2459
+ _this._baseUri = settings.baseUri;
2460
+ _this._entitySet = settings.entitySet;
2461
+ _this._sortDescriptions = settings.sortDescriptions;
2462
+ _this._groupDescriptions = settings.groupDescriptions;
2463
+ if (_this._groupDescriptions != null && _this._groupDescriptions.size() > 0) {
2464
+ _this._sortDescriptions = new igniteuiWebcomponentsCore.SortDescriptionCollection();
2465
+ try {
2466
+ for (var _b = tslib_1.__values(_this.iter(settings.sortDescriptions)), _c = _b.next(); !_c.done; _c = _b.next()) {
2467
+ var sd = _c.value;
2468
+ _this._sortDescriptions.add(sd);
2469
+ }
2470
+ }
2471
+ catch (e_1_1) {
2472
+ e_1 = { error: e_1_1 };
2473
+ }
2474
+ finally {
2475
+ try {
2476
+ if (_c && !_c.done && (_a = _b.return))
2477
+ _a.call(_b);
2478
+ }
2479
+ finally {
2480
+ if (e_1)
2481
+ throw e_1.error;
2482
+ }
2483
+ }
2484
+ for (var i = 0; i < _this._groupDescriptions.size(); i++) {
2485
+ _this._sortDescriptions.insert(i, _this._groupDescriptions.get(i));
2486
+ }
2487
+ }
2488
+ _this._filterExpressions = settings.filterExpressions;
2489
+ _this._desiredPropeties = settings.propertiesRequested;
2490
+ _this._summaryDescriptions = settings.summaryDescriptions;
2491
+ _this._fixedFullCount = settings.fixedFullCount;
2492
+ _this._summaryScope = settings.summaryScope;
2493
+ _this._enableJsonp = settings.enableJsonp;
2494
+ _this._provideFullCount = settings.provideFullCount;
2495
+ _this._performFetch = settings.performFetch;
2496
+ _this._provideAggregationParameter = settings.provideAggregationParameter;
2497
+ _this._provideFilterParameter = settings.provideFilterParameter;
2498
+ _this._provideOrderByParameter = settings.provideOrderByParameter;
2499
+ _this._provideUri = settings.provideUri;
2500
+ _this._providePagingParameter = settings.providePagingParameter;
2501
+ _this._provideDesiredPropertiesParameter = settings.provideDesiredPropertiesParameter;
2502
+ _this._provideItems = settings.provideItems;
2503
+ _this._provideAggregatedCount = settings.provideAggregatedCount;
2504
+ if (!_this._provideItems) {
2505
+ _this._provideItems = function (res) {
2506
+ return res ? res.items : null;
2507
+ };
2508
+ }
2509
+ if (!_this._provideFullCount) {
2510
+ _this._provideFullCount = function (p) {
2511
+ if (p.fullCount) {
2512
+ return p.fullCount;
2513
+ }
2514
+ else {
2515
+ return _this._fixedFullCount >= 0 ? _this._fixedFullCount : 0;
2516
+ }
2517
+ };
2518
+ }
2519
+ if (!_this._provideOrderByParameter) {
2520
+ _this._provideOrderByParameter = function (args, orderByString, orderBy) {
2521
+ args.push({ name: "orderBy", value: encodeURIComponent(orderByString) });
2522
+ };
2523
+ }
2524
+ if (!_this._providePagingParameter) {
2525
+ _this._providePagingParameter = function (args, skip, take) {
2526
+ args.push({ name: "skip", value: skip });
2527
+ args.push({ name: "take", value: take });
2528
+ };
2529
+ }
2530
+ if (!_this._provideAggregationParameter) {
2531
+ _this._provideAggregationParameter = function (args, fetchCountOnly, groupByString, groupBy, summaryString, summary) {
2532
+ args.push({ name: "groupBy", value: groupByString });
2533
+ args.push({ name: "aggregate", value: "count" });
2534
+ };
2535
+ }
2536
+ if (!_this._provideUri) {
2537
+ _this._provideUri = function (baseUri, entitySet, args) {
2538
+ var requestUri = baseUri;
2539
+ requestUri += "/" + entitySet;
2540
+ if (args.length > 0) {
2541
+ requestUri += "?";
2542
+ }
2543
+ var argsString = "";
2544
+ for (var i = 0; i < args.length; i++) {
2545
+ if (i > 0) {
2546
+ argsString += "&";
2547
+ }
2548
+ argsString += args[i].name + "=" + args[i].value;
2549
+ }
2550
+ return requestUri + argsString;
2551
+ };
2552
+ }
2553
+ _this._isAggregationSupported = settings.isAggregationSupported;
2554
+ window.setTimeout(_this.doWork, 100);
2555
+ return _this;
2556
+ }
2557
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorker.prototype, "sortDescriptions", {
2558
+ get: function () {
2559
+ return this._sortDescriptions;
2560
+ },
2561
+ enumerable: true,
2562
+ configurable: true
2563
+ });
2564
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorker.prototype, "filterExpressions", {
2565
+ get: function () {
2566
+ return this._filterExpressions;
2567
+ },
2568
+ enumerable: true,
2569
+ configurable: true
2570
+ });
2571
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorker.prototype, "desiredProperties", {
2572
+ get: function () {
2573
+ return this._desiredPropeties;
2574
+ },
2575
+ enumerable: true,
2576
+ configurable: true
2577
+ });
2578
+ RestVirtualDataSourceDataProviderWorker.prototype.initialize = function () {
2579
+ _super.prototype.initialize.call(this);
2580
+ };
2581
+ RestVirtualDataSourceDataProviderWorker.prototype.getTaskDataHolder = function () {
2582
+ var holder = new RestVirtualDataSourceProviderTaskDataHolder();
2583
+ return holder;
2584
+ };
2585
+ RestVirtualDataSourceDataProviderWorker.prototype.getCompletedTaskData = function (holder, completed) {
2586
+ _super.prototype.getCompletedTaskData.call(this, holder, completed);
2587
+ };
2588
+ RestVirtualDataSourceDataProviderWorker.prototype.removeCompletedTaskData = function (holder, completed) {
2589
+ _super.prototype.removeCompletedTaskData.call(this, holder, completed);
2590
+ };
2591
+ RestVirtualDataSourceDataProviderWorker.prototype.getTasksData = function (holder) {
2592
+ _super.prototype.getTasksData.call(this, holder);
2593
+ };
2594
+ RestVirtualDataSourceDataProviderWorker.prototype.iter = function (coll) {
2595
+ var i;
2596
+ return tslib_1.__generator(this, function (_a) {
2597
+ switch (_a.label) {
2598
+ case 0:
2599
+ i = 0;
2600
+ _a.label = 1;
2601
+ case 1:
2602
+ if (!(i < coll.size()))
2603
+ return [3 /*break*/, 4];
2604
+ return [4 /*yield*/, coll.get(i)];
2605
+ case 2:
2606
+ _a.sent();
2607
+ _a.label = 3;
2608
+ case 3:
2609
+ i++;
2610
+ return [3 /*break*/, 1];
2611
+ case 4: return [2 /*return*/];
2612
+ }
2613
+ });
2614
+ };
2615
+ RestVirtualDataSourceDataProviderWorker.prototype.iterFilter = function (coll) {
2616
+ var i;
2617
+ return tslib_1.__generator(this, function (_a) {
2618
+ switch (_a.label) {
2619
+ case 0:
2620
+ i = 0;
2621
+ _a.label = 1;
2622
+ case 1:
2623
+ if (!(i < coll.size()))
2624
+ return [3 /*break*/, 4];
2625
+ return [4 /*yield*/, coll.get(i)];
2626
+ case 2:
2627
+ _a.sent();
2628
+ _a.label = 3;
2629
+ case 3:
2630
+ i++;
2631
+ return [3 /*break*/, 1];
2632
+ case 4: return [2 /*return*/];
2633
+ }
2634
+ });
2635
+ };
2636
+ RestVirtualDataSourceDataProviderWorker.prototype.iterSummaries = function (summaries) {
2637
+ var i;
2638
+ return tslib_1.__generator(this, function (_a) {
2639
+ switch (_a.label) {
2640
+ case 0:
2641
+ i = 0;
2642
+ _a.label = 1;
2643
+ case 1:
2644
+ if (!(i < summaries.size()))
2645
+ return [3 /*break*/, 4];
2646
+ return [4 /*yield*/, summaries.get(i)];
2647
+ case 2:
2648
+ _a.sent();
2649
+ _a.label = 3;
2650
+ case 3:
2651
+ i++;
2652
+ return [3 /*break*/, 1];
2653
+ case 4: return [2 /*return*/];
2654
+ }
2655
+ });
2656
+ };
2657
+ RestVirtualDataSourceDataProviderWorker.prototype.processCompletedTask = function (completedTask, currentDelay, pageIndex, taskDataHolder) {
2658
+ var _this = this;
2659
+ var h = taskDataHolder;
2660
+ var schema = null;
2661
+ var result = null;
2662
+ var schemaFetchCount = -1;
2663
+ var task = completedTask.task;
2664
+ try {
2665
+ if (task.hasErrors) {
2666
+ this.retryIndex(pageIndex, currentDelay);
2667
+ return;
2668
+ }
2669
+ if (pageIndex == RestVirtualDataSourceDataProviderWorker.schemaRequestIndex) {
2670
+ result = task.result;
2671
+ schemaFetchCount = (this._provideFullCount(result));
2672
+ }
2673
+ else {
2674
+ result = task.result;
2675
+ }
2676
+ }
2677
+ catch (e) {
2678
+ this.retryIndex(pageIndex, currentDelay);
2679
+ return;
2680
+ }
2681
+ if (schemaFetchCount >= 0) {
2682
+ this.actualCount = schemaFetchCount;
2683
+ }
2684
+ else {
2685
+ this.actualCount = (this._provideFullCount(result));
2686
+ }
2687
+ schema = this.actualSchema;
2688
+ if (schema == null) {
2689
+ var requests_1 = 0;
2690
+ this.resolveSchema(function (s) {
2691
+ // resolveSchema success callback
2692
+ _this.actualSchema = s;
2693
+ if (_this._isAggregationSupported && (_this._groupDescriptions.size() !== 0 || _this._summaryDescriptions.size() !== 0)) {
2694
+ if (_this._groupDescriptions.size() > 0) {
2695
+ requests_1++;
2696
+ _this.resolveGroupInformation(function (g) {
2697
+ // group info success
2698
+ requests_1--;
2699
+ if (requests_1 === 0) {
2700
+ _this.finishProcessingCompletedTask(task, pageIndex, s, result);
2701
+ }
2702
+ }, function () {
2703
+ // group info failure
2704
+ _this.retryIndex(pageIndex, currentDelay);
2705
+ return;
2706
+ });
2707
+ }
2708
+ if (_this._summaryDescriptions.size() > 0) {
2709
+ requests_1++;
2710
+ _this.resolveSummaryInformation(function (g) {
2711
+ // summary info success
2712
+ requests_1--;
2713
+ if (requests_1 === 0) {
2714
+ _this.finishProcessingCompletedTask(task, pageIndex, s, result);
2715
+ }
2716
+ }, function () {
2717
+ // summary info failure
2718
+ _this.retryIndex(pageIndex, currentDelay);
2719
+ return;
2720
+ });
2721
+ }
2722
+ }
2723
+ else {
2724
+ _this.finishProcessingCompletedTask(task, pageIndex, s, result);
2725
+ }
2726
+ }, function () {
2727
+ // resolveSchema failure callback
2728
+ _this.retryIndex(pageIndex, currentDelay);
2729
+ return;
2730
+ });
2731
+ return;
2732
+ }
2733
+ this.finishProcessingCompletedTask(task, pageIndex, schema, result);
2734
+ };
2735
+ RestVirtualDataSourceDataProviderWorker.prototype.finishProcessingCompletedTask = function (task, pageIndex, schema, result) {
2736
+ var _this = this;
2737
+ var executionContext;
2738
+ var pageLoaded;
2739
+ var groupInformation;
2740
+ var summaryInformation;
2741
+ this.actualSchema = schema;
2742
+ executionContext = this.executionContext;
2743
+ groupInformation = this._groupInformation;
2744
+ summaryInformation = this._summaryInformation;
2745
+ pageLoaded = this.pageLoaded;
2746
+ var page = null;
2747
+ if (result != null) {
2748
+ page = new RestVirtualDataSourcePage(result, schema, groupInformation, summaryInformation, pageIndex);
2749
+ if (!this.isLastPage(pageIndex) && page.count() > 0 && !this.populatedActualPageSize) {
2750
+ this.populatedActualPageSize = true;
2751
+ this.actualPageSize = page.count();
2752
+ }
2753
+ }
2754
+ else {
2755
+ page = new RestVirtualDataSourcePage(null, schema, groupInformation, summaryInformation, pageIndex);
2756
+ }
2757
+ if (this.pageLoaded != null) {
2758
+ if (this.executionContext != null) {
2759
+ if (executionContext == null || pageLoaded == null) {
2760
+ this.shutdown();
2761
+ return;
2762
+ }
2763
+ executionContext.execute(function () { return pageLoaded(page, _this.actualCount, _this.actualPageSize); });
2764
+ }
2765
+ else {
2766
+ if (pageLoaded == null) {
2767
+ this.shutdown();
2768
+ return;
2769
+ }
2770
+ pageLoaded(page, this.actualCount, this.actualPageSize);
2771
+ }
2772
+ }
2773
+ };
2774
+ RestVirtualDataSourceDataProviderWorker.prototype.resolveGroupInformation = function (finishAction, failureAction) {
2775
+ var e_2, _a;
2776
+ var _this = this;
2777
+ if (this._groupInformation != null) {
2778
+ finishAction(this._groupInformation);
2779
+ return;
2780
+ }
2781
+ var orderBy = "";
2782
+ var groupBy = "";
2783
+ var filter = null;
2784
+ var summary = "";
2785
+ if (this._groupDescriptions == null || this._groupDescriptions.size() == 0) {
2786
+ finishAction(null);
2787
+ return;
2788
+ }
2789
+ if (this._provideAggregationParameter == null) {
2790
+ finishAction(null);
2791
+ return;
2792
+ }
2793
+ filter = this._filterString;
2794
+ this.updateFilterString();
2795
+ if (this._groupDescriptions != null) {
2796
+ var first1 = true;
2797
+ try {
2798
+ for (var _b = tslib_1.__values(this.iter(this._groupDescriptions)), _c = _b.next(); !_c.done; _c = _b.next()) {
2799
+ var group = _c.value;
2800
+ if (first1) {
2801
+ first1 = false;
2802
+ }
2803
+ else {
2804
+ orderBy += ", ";
2805
+ groupBy += ", ";
2806
+ }
2807
+ groupBy += group.propertyName;
2808
+ if (group.direction === igniteuiWebcomponentsCore.ListSortDirection.Descending) {
2809
+ orderBy += group.propertyName + " desc";
2810
+ }
2811
+ else {
2812
+ orderBy += group.propertyName + " asc";
2813
+ }
2814
+ }
2815
+ }
2816
+ catch (e_2_1) {
2817
+ e_2 = { error: e_2_1 };
2818
+ }
2819
+ finally {
2820
+ try {
2821
+ if (_c && !_c.done && (_a = _b.return))
2822
+ _a.call(_b);
2823
+ }
2824
+ finally {
2825
+ if (e_2)
2826
+ throw e_2.error;
2827
+ }
2828
+ }
2829
+ }
2830
+ if (this._summaryScope === igniteuiWebcomponentsCore.DataSourceSummaryScope.Both || this._summaryScope === igniteuiWebcomponentsCore.DataSourceSummaryScope.Groups) {
2831
+ var summaryParameters = this.getSummaryQueryParameters(true);
2832
+ if (!igniteuiWebcomponentsCore.stringIsNullOrEmpty(summaryParameters)) {
2833
+ summary = ", " + summaryParameters;
2834
+ }
2835
+ }
2836
+ var args = [];
2837
+ if (this._provideOrderByParameter) {
2838
+ this._provideOrderByParameter(args, orderBy, this._groupDescriptions);
2839
+ }
2840
+ if (this._provideFilterParameter && filter != null) {
2841
+ this._provideFilterParameter(args, filter, this._filterExpressions);
2842
+ }
2843
+ if (this._provideAggregationParameter) {
2844
+ this._provideAggregationParameter(args, true, groupBy, this._groupDescriptions, summary, this._summaryDescriptions);
2845
+ }
2846
+ var uri = this._provideUri(this._baseUri, this._entitySet, args);
2847
+ try {
2848
+ var groupInformation_1 = [];
2849
+ var success_1 = function (data, response) { return _this.groupSuccess(data, response, finishAction, failureAction, groupInformation_1); };
2850
+ var failure_1 = function (err) { return _this.groupError(err, finishAction, failureAction, groupInformation_1); };
2851
+ var run_ = null;
2852
+ var headers = { 'Content-Type': 'application/json', Accept: 'application/json' };
2853
+ var request = {
2854
+ requestUri: uri,
2855
+ enableJsonpCallback: this._enableJsonp,
2856
+ method: 'GET',
2857
+ headers: headers,
2858
+ data: null
2859
+ };
2860
+ run_ = function () {
2861
+ _this.fetchUri(request, success_1, failure_1);
2862
+ };
2863
+ run_();
2864
+ }
2865
+ catch (e) {
2866
+ failureAction();
2867
+ }
2868
+ };
2869
+ RestVirtualDataSourceDataProviderWorker.prototype.fetchUri = function (request, success, failure) {
2870
+ if (this._performFetch) {
2871
+ this._performFetch(request, success, failure);
2872
+ }
2873
+ else {
2874
+ fetch(request.requestUri, {
2875
+ method: request.method,
2876
+ headers: request.headers,
2877
+ }).then(function (res) {
2878
+ res.json().then(function (j) {
2879
+ success(j, res);
2880
+ });
2881
+ }).catch(function (e) {
2882
+ failure(e);
2883
+ });
2884
+ }
2885
+ };
2886
+ RestVirtualDataSourceDataProviderWorker.prototype.groupError = function (err, finishAction, failureAction, groupInformation) {
2887
+ this._groupInformation = null;
2888
+ };
2889
+ RestVirtualDataSourceDataProviderWorker.prototype.groupSuccess = function (data, response, finishAction, failureAction, groupInformation) {
2890
+ var e_3, _a;
2891
+ var groupNames = [];
2892
+ try {
2893
+ for (var _b = tslib_1.__values(this.iter(this._groupDescriptions)), _c = _b.next(); !_c.done; _c = _b.next()) {
2894
+ var group = _c.value;
2895
+ groupNames.push(group.propertyName);
2896
+ }
2897
+ }
2898
+ catch (e_3_1) {
2899
+ e_3 = { error: e_3_1 };
2900
+ }
2901
+ finally {
2902
+ try {
2903
+ if (_c && !_c.done && (_a = _b.return))
2904
+ _a.call(_b);
2905
+ }
2906
+ finally {
2907
+ if (e_3)
2908
+ throw e_3.error;
2909
+ }
2910
+ }
2911
+ var groupNamesArray = groupNames;
2912
+ var items = this._provideItems(data);
2913
+ if (items && items.length > 0) {
2914
+ var currentIndex = 0;
2915
+ for (var i = 0; i < items.length; i++) {
2916
+ this.addGroup(groupInformation, groupNames, groupNames, currentIndex, items[i]);
2917
+ }
2918
+ }
2919
+ this._groupInformation = groupInformation;
2920
+ finishAction(this._groupInformation);
2921
+ };
2922
+ RestVirtualDataSourceDataProviderWorker.prototype.addGroup = function (groupInformation, groupNames, groupNamesArray, currentIndex, group) {
2923
+ var e_4, _a;
2924
+ var groupValues = [];
2925
+ try {
2926
+ for (var groupNames_1 = tslib_1.__values(groupNames), groupNames_1_1 = groupNames_1.next(); !groupNames_1_1.done; groupNames_1_1 = groupNames_1.next()) {
2927
+ var name_1 = groupNames_1_1.value;
2928
+ if (group[name_1]) {
2929
+ groupValues.push(group[name_1]);
2930
+ }
2931
+ }
2932
+ }
2933
+ catch (e_4_1) {
2934
+ e_4 = { error: e_4_1 };
2935
+ }
2936
+ finally {
2937
+ try {
2938
+ if (groupNames_1_1 && !groupNames_1_1.done && (_a = groupNames_1.return))
2939
+ _a.call(groupNames_1);
2940
+ }
2941
+ finally {
2942
+ if (e_4)
2943
+ throw e_4.error;
2944
+ }
2945
+ }
2946
+ var groupCount = 0;
2947
+ //todo: make this customizable
2948
+ if (this._provideAggregatedCount) {
2949
+ var ct = this._provideAggregatedCount(group);
2950
+ }
2951
+ else {
2952
+ if (group["aggregatedCount"]) {
2953
+ groupCount = igniteuiWebcomponentsCore.Convert.toInt321(group["aggregatedCount"]);
2954
+ }
2955
+ }
2956
+ var summaryResults = null;
2957
+ if (this._summaryScope == igniteuiWebcomponentsCore.DataSourceSummaryScope.Both || this._summaryScope == igniteuiWebcomponentsCore.DataSourceSummaryScope.Groups) {
2958
+ summaryResults = this.createSummaryResults(group);
2959
+ }
2960
+ var groupInfo = new igniteuiWebcomponentsCore.DefaultSectionInformation(currentIndex, currentIndex + (groupCount - 1), groupNamesArray, groupValues, summaryResults);
2961
+ groupInformation.push(groupInfo);
2962
+ };
2963
+ RestVirtualDataSourceDataProviderWorker.prototype.resolveSummaryInformation = function (finishAction, failureAction) {
2964
+ var _this = this;
2965
+ if (this._summaryInformation != null) {
2966
+ finishAction(this._summaryInformation);
2967
+ return;
2968
+ }
2969
+ var filter = null;
2970
+ var summary = null;
2971
+ if (this._summaryDescriptions == null ||
2972
+ this._summaryDescriptions.size() == 0 ||
2973
+ this._summaryScope == igniteuiWebcomponentsCore.DataSourceSummaryScope.Groups ||
2974
+ this._summaryScope == igniteuiWebcomponentsCore.DataSourceSummaryScope.None) {
2975
+ finishAction(null);
2976
+ return;
2977
+ }
2978
+ filter = this._filterString;
2979
+ this.updateFilterString();
2980
+ summary = this.getSummaryQueryParameters(false);
2981
+ var args = [];
2982
+ // if (this._provideOrderByParameter) {
2983
+ // args.push({ name: "orderBy", value: this._provideOrderByParameter(orderBy, this._sortDescriptions) });
2984
+ // }
2985
+ if (this._provideFilterParameter && filter != null) {
2986
+ this._provideFilterParameter(args, filter, this._filterExpressions);
2987
+ }
2988
+ if (this._provideAggregationParameter) {
2989
+ this._provideAggregationParameter(args, true, null, null, summary, this._summaryDescriptions);
2990
+ }
2991
+ var uri = this._provideUri(this._baseUri, this._entitySet, args);
2992
+ // let commandText = this._entitySet + "?$apply=";
2993
+ // if (!stringIsNullOrEmpty(filter)) {
2994
+ // commandText += "filter(" + filter + ")/";
2995
+ // }
2996
+ // commandText += "aggregate(" + summary + ")";
2997
+ try {
2998
+ var summaryInformation_1 = [];
2999
+ var success_2 = function (data, response) { return _this.summarySuccess(data, response, finishAction, failureAction, summaryInformation_1); };
3000
+ var failure_2 = function (err) { return _this.summaryError(err, finishAction, failureAction, summaryInformation_1); };
3001
+ var run_ = null;
3002
+ var headers = { 'Content-Type': 'application/json', Accept: 'application/json' };
3003
+ var request = {
3004
+ requestUri: uri,
3005
+ enableJsonpCallback: this._enableJsonp,
3006
+ method: 'GET',
3007
+ headers: headers,
3008
+ data: null
3009
+ };
3010
+ run_ = function () {
3011
+ _this.fetchUri(request, success_2, failure_2);
3012
+ };
3013
+ run_();
3014
+ }
3015
+ catch (e) {
3016
+ failureAction();
3017
+ }
3018
+ };
3019
+ RestVirtualDataSourceDataProviderWorker.prototype.summarySuccess = function (data, response, finishAction, failureAction, summaryInformation) {
3020
+ if (data && data.value && data.value.length > 0) {
3021
+ summaryInformation = this.createSummaryResults(data.value[0]);
3022
+ }
3023
+ this._summaryInformation = summaryInformation;
3024
+ finishAction(this._summaryInformation);
3025
+ };
3026
+ RestVirtualDataSourceDataProviderWorker.prototype.summaryError = function (err, finishAction, failureAction, summaryInformation) {
3027
+ this._summaryInformation = null;
3028
+ };
3029
+ RestVirtualDataSourceDataProviderWorker.prototype.getSummaryQueryParameters = function (ignoreCount) {
3030
+ var e_5, _a;
3031
+ var result = "";
3032
+ if (this._summaryDescriptions != null) {
3033
+ var first = true;
3034
+ var countExists = false;
3035
+ try {
3036
+ for (var _b = tslib_1.__values(this.iterSummaries(this._summaryDescriptions)), _c = _b.next(); !_c.done; _c = _b.next()) {
3037
+ var summary = _c.value;
3038
+ if (summary.operand == igniteuiWebcomponentsCore.SummaryOperand.Count && (ignoreCount || countExists)) {
3039
+ continue;
3040
+ }
3041
+ if (!first) {
3042
+ result += ", ";
3043
+ }
3044
+ switch (summary.operand) {
3045
+ case igniteuiWebcomponentsCore.SummaryOperand.Average:
3046
+ result += summary.propertyName + " with average as " + summary.propertyName + "Average";
3047
+ break;
3048
+ case igniteuiWebcomponentsCore.SummaryOperand.Min:
3049
+ result += summary.propertyName + " with min as " + summary.propertyName + "Min";
3050
+ break;
3051
+ case igniteuiWebcomponentsCore.SummaryOperand.Max:
3052
+ result += summary.propertyName + " with max as " + summary.propertyName + "Max";
3053
+ break;
3054
+ case igniteuiWebcomponentsCore.SummaryOperand.Sum:
3055
+ result += summary.propertyName + " with sum as " + summary.propertyName + "Sum";
3056
+ break;
3057
+ case igniteuiWebcomponentsCore.SummaryOperand.Count:
3058
+ result += "$count as $__count";
3059
+ countExists = true;
3060
+ break;
3061
+ }
3062
+ first = false;
3063
+ }
3064
+ }
3065
+ catch (e_5_1) {
3066
+ e_5 = { error: e_5_1 };
3067
+ }
3068
+ finally {
3069
+ try {
3070
+ if (_c && !_c.done && (_a = _b.return))
3071
+ _a.call(_b);
3072
+ }
3073
+ finally {
3074
+ if (e_5)
3075
+ throw e_5.error;
3076
+ }
3077
+ }
3078
+ }
3079
+ return result;
3080
+ };
3081
+ RestVirtualDataSourceDataProviderWorker.prototype.createSummaryResults = function (data) {
3082
+ var e_6, _a;
3083
+ var summaryResults = [];
3084
+ try {
3085
+ for (var _b = tslib_1.__values(this.iterSummaries(this._summaryDescriptions)), _c = _b.next(); !_c.done; _c = _b.next()) {
3086
+ var summary = _c.value;
3087
+ var summaryName = summary.propertyName;
3088
+ switch (summary.operand) {
3089
+ case igniteuiWebcomponentsCore.SummaryOperand.Average:
3090
+ summaryName += "Average";
3091
+ break;
3092
+ case igniteuiWebcomponentsCore.SummaryOperand.Min:
3093
+ summaryName += "Min";
3094
+ break;
3095
+ case igniteuiWebcomponentsCore.SummaryOperand.Max:
3096
+ summaryName += "Max";
3097
+ break;
3098
+ case igniteuiWebcomponentsCore.SummaryOperand.Sum:
3099
+ summaryName += "Sum";
3100
+ break;
3101
+ case igniteuiWebcomponentsCore.SummaryOperand.Count:
3102
+ summaryName = "$__count";
3103
+ break;
3104
+ }
3105
+ var summaryValue = null;
3106
+ if (data && data[summaryName]) {
3107
+ summaryValue = data[summaryName];
3108
+ }
3109
+ var summaryResult = new igniteuiWebcomponentsCore.DefaultSummaryResult(summary.propertyName, summary.operand, summaryValue);
3110
+ summaryResults.push(summaryResult);
3111
+ }
3112
+ }
3113
+ catch (e_6_1) {
3114
+ e_6 = { error: e_6_1 };
3115
+ }
3116
+ finally {
3117
+ try {
3118
+ if (_c && !_c.done && (_a = _b.return))
3119
+ _a.call(_b);
3120
+ }
3121
+ finally {
3122
+ if (e_6)
3123
+ throw e_6.error;
3124
+ }
3125
+ }
3126
+ return summaryResults;
3127
+ };
3128
+ RestVirtualDataSourceDataProviderWorker.prototype.resolveSchemaFromItems = function (items) {
3129
+ var lds = new igniteuiWebcomponentsCore.LocalDataSource();
3130
+ lds.dataSource = items;
3131
+ lds.flushAutoRefresh();
3132
+ return lds.actualSchema;
3133
+ };
3134
+ RestVirtualDataSourceDataProviderWorker.prototype.resolveSchema = function (finishAction, failureAction) {
3135
+ var _this = this;
3136
+ if (!this._provideItems || !this._providePagingParameter) {
3137
+ failureAction("required providers for items and paging are not specified");
3138
+ return;
3139
+ }
3140
+ var success_ = function (res) {
3141
+ var items = _this._provideItems(res);
3142
+ if (items && items.length > 0) {
3143
+ var schema = _this.resolveSchemaFromItems(items);
3144
+ finishAction(schema);
3145
+ }
3146
+ else {
3147
+ failureAction("could not find items to resolve schema");
3148
+ }
3149
+ };
3150
+ var failure_ = function (e) { return failureAction(e); };
3151
+ var args = [];
3152
+ if (this._providePagingParameter) {
3153
+ this._providePagingParameter(args, 0, this.actualPageSize);
3154
+ }
3155
+ var uri = this._provideUri(this._baseUri, this._entitySet, args);
3156
+ try {
3157
+ var run_ = null;
3158
+ var headers = { 'Content-Type': 'application/json', Accept: 'application/json' };
3159
+ var request = {
3160
+ requestUri: uri,
3161
+ enableJsonpCallback: this._enableJsonp,
3162
+ method: 'GET',
3163
+ headers: headers,
3164
+ data: null
3165
+ };
3166
+ run_ = function () {
3167
+ _this.fetchUri(request, success_, failure_);
3168
+ };
3169
+ run_();
3170
+ }
3171
+ catch (e) {
3172
+ failureAction(e);
3173
+ }
3174
+ };
3175
+ RestVirtualDataSourceDataProviderWorker.prototype.makeTaskForRequest = function (request, retryDelay) {
3176
+ var e_7, _a;
3177
+ var args = [];
3178
+ // if (this._provideAggregationParameter) {
3179
+ // args.push({ name: "apply", value: this._provideAggregationParameter(true, groupBy, this._groupDescriptions, summary, this._summaryDescriptions) });
3180
+ // }
3181
+ var actualPageSize = 0;
3182
+ var sortDescriptions = null;
3183
+ actualPageSize = this.actualPageSize;
3184
+ sortDescriptions = this.sortDescriptions;
3185
+ //let requestUrl: string = this._baseUri;
3186
+ //requestUrl += "/" + this._entitySet;
3187
+ var queryStarted = false;
3188
+ this.updateFilterString();
3189
+ if (this._filterString != null) {
3190
+ if (this._provideFilterParameter) {
3191
+ this._provideFilterParameter(args, this._filterString, this._filterExpressions);
3192
+ }
3193
+ }
3194
+ if (this.sortDescriptions != null) {
3195
+ var sortString = null;
3196
+ try {
3197
+ for (var _b = tslib_1.__values(this.iter(this.sortDescriptions)), _c = _b.next(); !_c.done; _c = _b.next()) {
3198
+ var sort = _c.value;
3199
+ if (sortString == null) {
3200
+ sortString = "";
3201
+ }
3202
+ else {
3203
+ sortString += ", ";
3204
+ }
3205
+ if (sort.direction == igniteuiWebcomponentsCore.ListSortDirection.Descending) {
3206
+ sortString += sort.propertyName + " desc";
3207
+ }
3208
+ else {
3209
+ sortString += sort.propertyName;
3210
+ }
3211
+ }
3212
+ }
3213
+ catch (e_7_1) {
3214
+ e_7 = { error: e_7_1 };
3215
+ }
3216
+ finally {
3217
+ try {
3218
+ if (_c && !_c.done && (_a = _b.return))
3219
+ _a.call(_b);
3220
+ }
3221
+ finally {
3222
+ if (e_7)
3223
+ throw e_7.error;
3224
+ }
3225
+ }
3226
+ if (sortString != null) {
3227
+ if (this._provideOrderByParameter) {
3228
+ this._provideOrderByParameter(args, sortString, this._sortDescriptions);
3229
+ }
3230
+ }
3231
+ }
3232
+ if (this.desiredProperties != null && this.desiredProperties.length > 0) {
3233
+ var selectString = "";
3234
+ var first = true;
3235
+ var $t = this.desiredProperties;
3236
+ for (var i = 0; i < $t.length; i++) {
3237
+ var select = $t[i];
3238
+ if (first) {
3239
+ first = false;
3240
+ }
3241
+ else {
3242
+ selectString += ", ";
3243
+ }
3244
+ selectString += select;
3245
+ }
3246
+ if (this._provideDesiredPropertiesParameter) {
3247
+ this._provideDesiredPropertiesParameter(args, selectString, this._desiredPropeties);
3248
+ }
3249
+ }
3250
+ if (this._providePagingParameter) {
3251
+ if (request.index == RestVirtualDataSourceDataProviderWorker.schemaRequestIndex) {
3252
+ this._providePagingParameter(args, 0, actualPageSize);
3253
+ }
3254
+ else {
3255
+ this._providePagingParameter(args, request.index * actualPageSize, actualPageSize);
3256
+ }
3257
+ }
3258
+ var task = new igniteuiWebcomponentsCore.AsyncVirtualDataTask();
3259
+ var uri = this._provideUri(this._baseUri, this._entitySet, args);
3260
+ if (request.index == RestVirtualDataSourceDataProviderWorker.schemaRequestIndex) {
3261
+ this.executeRequest(uri, queryStarted, 0, actualPageSize, task);
3262
+ }
3263
+ else {
3264
+ this.executeRequest(uri, queryStarted, request.index * actualPageSize, actualPageSize, task);
3265
+ }
3266
+ request.taskHolder = new igniteuiWebcomponentsCore.AsyncDataSourcePageTaskHolder();
3267
+ request.taskHolder.task = task;
3268
+ this.tasks.add(request);
3269
+ };
3270
+ RestVirtualDataSourceDataProviderWorker.prototype.updateFilterString = function () {
3271
+ var e_8, _a;
3272
+ if (this.filterExpressions != null && this.filterExpressions.size() > 0 && this._filterString == null) {
3273
+ var sb = "";
3274
+ var first = true;
3275
+ try {
3276
+ for (var _b = tslib_1.__values(this.iterFilter(this.filterExpressions)), _c = _b.next(); !_c.done; _c = _b.next()) {
3277
+ var expr = _c.value;
3278
+ if (first) {
3279
+ first = false;
3280
+ }
3281
+ else {
3282
+ sb += " AND ";
3283
+ }
3284
+ var visitor = new igniteuiWebcomponentsCore.ODataDataSourceFilterExpressionVisitor(0);
3285
+ visitor.visit(expr);
3286
+ var txt = visitor.toString();
3287
+ if (this.filterExpressions.size() > 1) {
3288
+ txt = "(" + txt + ")";
3289
+ }
3290
+ sb += (txt);
3291
+ }
3292
+ }
3293
+ catch (e_8_1) {
3294
+ e_8 = { error: e_8_1 };
3295
+ }
3296
+ finally {
3297
+ try {
3298
+ if (_c && !_c.done && (_a = _b.return))
3299
+ _a.call(_b);
3300
+ }
3301
+ finally {
3302
+ if (e_8)
3303
+ throw e_8.error;
3304
+ }
3305
+ }
3306
+ this._filterString = sb;
3307
+ }
3308
+ };
3309
+ RestVirtualDataSourceDataProviderWorker.prototype.executeRequest = function (requestUrl, queryStarted, skip, top, task) {
3310
+ var _this = this;
3311
+ // if (!queryStarted) {
3312
+ // queryStarted = true;
3313
+ // requestUrl += "?";
3314
+ // } else {
3315
+ // requestUrl += "&";
3316
+ // }
3317
+ // requestUrl += "$skip=" + skip + "&$top=" + top + "&$count=true";
3318
+ var requestUrl_ = requestUrl;
3319
+ var self_ = this;
3320
+ var success_ = function (data, response) { return _this.success(task, data, response); };
3321
+ var failure_ = function (err) { return _this.error(task, err); };
3322
+ var run_ = null;
3323
+ var headers = { 'Content-Type': 'application/json', Accept: 'application/json' };
3324
+ var request = {
3325
+ requestUri: requestUrl_,
3326
+ enableJsonpCallback: this._enableJsonp,
3327
+ method: 'GET',
3328
+ headers: headers,
3329
+ data: null
3330
+ };
3331
+ run_ = function () {
3332
+ _this.fetchUri(request, success_, failure_);
3333
+ };
3334
+ task.run = run_;
3335
+ };
3336
+ RestVirtualDataSourceDataProviderWorker.prototype.success = function (t, data, response) {
3337
+ t.result = data;
3338
+ t.isCompleted = true;
3339
+ };
3340
+ RestVirtualDataSourceDataProviderWorker.prototype.error = function (t, result) {
3341
+ t.isCompleted = true;
3342
+ t.hasErrors = true;
3343
+ };
3344
+ RestVirtualDataSourceDataProviderWorker.prototype.createBatchRequest = function (changes) {
3345
+ //TODO: updates
3346
+ };
3347
+ RestVirtualDataSourceDataProviderWorker.prototype.getRequestUriWithKey = function (key) {
3348
+ var result = "";
3349
+ var keys = Object.keys(key);
3350
+ for (var i = 0; i < keys.length; i++) {
3351
+ if (i > 0) {
3352
+ result += ",";
3353
+ }
3354
+ result += keys[i] + "=" + key[keys[i]];
3355
+ }
3356
+ return this._entitySet + "(" + result + ")";
3357
+ };
3358
+ RestVirtualDataSourceDataProviderWorker.schemaRequestIndex = -1;
3359
+ return RestVirtualDataSourceDataProviderWorker;
3360
+ }(igniteuiWebcomponentsCore.AsyncVirtualDataSourceProviderWorker));
3361
+
3362
+ var RestVirtualDataSourceDataProviderWorkerSettings = /** @class */ /*@__PURE__*/ (function (_super) {
3363
+ tslib_1.__extends(RestVirtualDataSourceDataProviderWorkerSettings, _super);
3364
+ function RestVirtualDataSourceDataProviderWorkerSettings() {
3365
+ var _this = _super !== null && _super.apply(this, arguments) || this;
3366
+ _this._baseUri = null;
3367
+ _this._entitySet = null;
3368
+ _this._sortDescriptions = null;
3369
+ _this._filterExpressions = null;
3370
+ _this._propertiesRequested = null;
3371
+ _this._groupDescriptions = null;
3372
+ _this._summaryDescriptions = null;
3373
+ _this._fixedFullCount = -1;
3374
+ _this._provideFullCount = null;
3375
+ _this._provideOrderByParameter = null;
3376
+ _this._provideFilterParameter = null;
3377
+ _this._provideAggregationParameter = null;
3378
+ _this._provideAggregatedCount = null;
3379
+ _this._provideUri = null;
3380
+ _this._providePagingParameter = null;
3381
+ _this._provideDesiredPropertiesParameter = null;
3382
+ _this._performFetch = null;
3383
+ return _this;
3384
+ }
3385
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "baseUri", {
3386
+ get: function () {
3387
+ return this._baseUri;
3388
+ },
3389
+ set: function (value) {
3390
+ this._baseUri = value;
3391
+ },
3392
+ enumerable: true,
3393
+ configurable: true
3394
+ });
3395
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "entitySet", {
3396
+ get: function () {
3397
+ return this._entitySet;
3398
+ },
3399
+ set: function (value) {
3400
+ this._entitySet = value;
3401
+ },
3402
+ enumerable: true,
3403
+ configurable: true
3404
+ });
3405
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "sortDescriptions", {
3406
+ get: function () {
3407
+ return this._sortDescriptions;
3408
+ },
3409
+ set: function (value) {
3410
+ this._sortDescriptions = value;
3411
+ },
3412
+ enumerable: true,
3413
+ configurable: true
3414
+ });
3415
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "filterExpressions", {
3416
+ get: function () {
3417
+ return this._filterExpressions;
3418
+ },
3419
+ set: function (value) {
3420
+ this._filterExpressions = value;
3421
+ },
3422
+ enumerable: true,
3423
+ configurable: true
3424
+ });
3425
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "propertiesRequested", {
3426
+ get: function () {
3427
+ return this._propertiesRequested;
3428
+ },
3429
+ set: function (value) {
3430
+ this._propertiesRequested = value;
3431
+ },
3432
+ enumerable: true,
3433
+ configurable: true
3434
+ });
3435
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "groupDescriptions", {
3436
+ get: function () {
3437
+ return this._groupDescriptions;
3438
+ },
3439
+ set: function (value) {
3440
+ this._groupDescriptions = value;
3441
+ },
3442
+ enumerable: true,
3443
+ configurable: true
3444
+ });
3445
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "summaryDescriptions", {
3446
+ get: function () {
3447
+ return this._summaryDescriptions;
3448
+ },
3449
+ set: function (value) {
3450
+ this._summaryDescriptions = value;
3451
+ },
3452
+ enumerable: true,
3453
+ configurable: true
3454
+ });
3455
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "summaryScope", {
3456
+ get: function () {
3457
+ return this._summaryscope;
3458
+ },
3459
+ set: function (value) {
3460
+ this._summaryscope = value;
3461
+ },
3462
+ enumerable: true,
3463
+ configurable: true
3464
+ });
3465
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "enableJsonp", {
3466
+ get: function () {
3467
+ return this._enableJsonp;
3468
+ },
3469
+ set: function (isEnabled) {
3470
+ this._enableJsonp = isEnabled;
3471
+ },
3472
+ enumerable: true,
3473
+ configurable: true
3474
+ });
3475
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "isAggregationSupported", {
3476
+ get: function () {
3477
+ return this._isAggregationSupported;
3478
+ },
3479
+ set: function (isSupported) {
3480
+ this._isAggregationSupported = isSupported;
3481
+ },
3482
+ enumerable: true,
3483
+ configurable: true
3484
+ });
3485
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "fixedFullCount", {
3486
+ get: function () {
3487
+ return this._fixedFullCount;
3488
+ },
3489
+ set: function (value) {
3490
+ this._fixedFullCount = value;
3491
+ },
3492
+ enumerable: true,
3493
+ configurable: true
3494
+ });
3495
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "provideFullCount", {
3496
+ get: function () {
3497
+ return this._provideFullCount;
3498
+ },
3499
+ set: function (value) {
3500
+ this._provideFullCount = value;
3501
+ },
3502
+ enumerable: true,
3503
+ configurable: true
3504
+ });
3505
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "provideOrderByParameter", {
3506
+ get: function () {
3507
+ return this._provideOrderByParameter;
3508
+ },
3509
+ set: function (value) {
3510
+ this._provideOrderByParameter = value;
3511
+ },
3512
+ enumerable: true,
3513
+ configurable: true
3514
+ });
3515
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "provideFilterParameter", {
3516
+ get: function () {
3517
+ return this._provideFilterParameter;
3518
+ },
3519
+ set: function (value) {
3520
+ this._provideFilterParameter = value;
3521
+ },
3522
+ enumerable: true,
3523
+ configurable: true
3524
+ });
3525
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "provideAggregationParameter", {
3526
+ get: function () {
3527
+ return this._provideAggregationParameter;
3528
+ },
3529
+ set: function (value) {
3530
+ this._provideAggregationParameter = value;
3531
+ },
3532
+ enumerable: true,
3533
+ configurable: true
3534
+ });
3535
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "provideAggregatedCount", {
3536
+ get: function () {
3537
+ return this._provideAggregatedCount;
3538
+ },
3539
+ set: function (value) {
3540
+ this._provideAggregatedCount = value;
3541
+ },
3542
+ enumerable: true,
3543
+ configurable: true
3544
+ });
3545
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "provideUri", {
3546
+ get: function () {
3547
+ return this._provideUri;
3548
+ },
3549
+ set: function (value) {
3550
+ this._provideUri = value;
3551
+ },
3552
+ enumerable: true,
3553
+ configurable: true
3554
+ });
3555
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "providePagingParameter", {
3556
+ get: function () {
3557
+ return this._providePagingParameter;
3558
+ },
3559
+ set: function (value) {
3560
+ this._providePagingParameter = value;
3561
+ },
3562
+ enumerable: true,
3563
+ configurable: true
3564
+ });
3565
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "provideDesiredPropertiesParameter", {
3566
+ get: function () {
3567
+ return this._provideDesiredPropertiesParameter;
3568
+ },
3569
+ set: function (value) {
3570
+ this._provideDesiredPropertiesParameter = value;
3571
+ },
3572
+ enumerable: true,
3573
+ configurable: true
3574
+ });
3575
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "provideItems", {
3576
+ get: function () {
3577
+ return this._provideItems;
3578
+ },
3579
+ set: function (value) {
3580
+ this._provideItems = value;
3581
+ },
3582
+ enumerable: true,
3583
+ configurable: true
3584
+ });
3585
+ Object.defineProperty(RestVirtualDataSourceDataProviderWorkerSettings.prototype, "performFetch", {
3586
+ get: function () {
3587
+ return this._performFetch;
3588
+ },
3589
+ set: function (value) {
3590
+ this._performFetch = value;
3591
+ },
3592
+ enumerable: true,
3593
+ configurable: true
3594
+ });
3595
+ RestVirtualDataSourceDataProviderWorkerSettings.$t = igniteuiWebcomponentsCore.markType(RestVirtualDataSourceDataProviderWorkerSettings, 'RestVirtualDataSourceDataProviderWorkerSettings', igniteuiWebcomponentsCore.AsyncVirtualDataSourceDataProviderWorkerSettings.$type);
3596
+ return RestVirtualDataSourceDataProviderWorkerSettings;
3597
+ }(igniteuiWebcomponentsCore.AsyncVirtualDataSourceDataProviderWorkerSettings));
3598
+
3599
+ var RestVirtualDataSourceDataProvider = /** @class */ /*@__PURE__*/ (function (_super) {
3600
+ tslib_1.__extends(RestVirtualDataSourceDataProvider, _super);
3601
+ function RestVirtualDataSourceDataProvider() {
3602
+ var _this = _super.call(this) || this;
3603
+ _this._worker = null;
3604
+ _this._requests = new LinkedList();
3605
+ _this._callback = null;
3606
+ _this._pageLoaded = null;
3607
+ _this._pageSizeRequested = 50;
3608
+ _this._baseUri = null;
3609
+ _this._entitySet = null;
3610
+ _this._timeoutMilliseconds = 10000;
3611
+ _this.schemaChanged = null;
3612
+ _this._currentFullCount = 0;
3613
+ _this._currentSchema = null;
3614
+ _this._executionContext = null;
3615
+ _this._updateNotifier = null;
3616
+ _this._deferAutoRefresh = false;
3617
+ _this._sortDescriptions = null;
3618
+ _this._groupDescriptions = null;
3619
+ _this._propertiesRequested = null;
3620
+ _this._filterExpressions = null;
3621
+ _this._summaryDescriptions = null;
3622
+ _this._enableJsonp = true;
3623
+ _this._fixedFullCount = -1;
3624
+ _this._provideFullCount = null;
3625
+ _this._provideOrderByParameter = null;
3626
+ _this._provideFilterParameter = null;
3627
+ _this._provideAggregationParameter = null;
3628
+ _this._provideAggregatedCount = null;
3629
+ _this._provideUri = null;
3630
+ _this._performFetch = null;
3631
+ _this._providePagingParameter = null;
3632
+ _this._provideDesiredPropertiesParameter = null;
3633
+ _this._schemaFetchQueued = false;
3634
+ _this._autoRefreshQueued = false;
3635
+ _this._sortDescriptions = new igniteuiWebcomponentsCore.SortDescriptionCollection();
3636
+ _this._sortDescriptions.onChanged = function () { return _this.sortDescriptions_CollectionChanged(null, null); };
3637
+ _this._groupDescriptions = new igniteuiWebcomponentsCore.SortDescriptionCollection();
3638
+ _this._groupDescriptions.onChanged = function () { return _this.groupDescriptions_CollectionChanged(null, null); };
3639
+ _this._filterExpressions = new igniteuiWebcomponentsCore.FilterExpressionCollection();
3640
+ _this._filterExpressions.onChanged = function () { return _this.filterExpressions_CollectionChanged(null, null); };
3641
+ _this._summaryDescriptions = new igniteuiWebcomponentsCore.SummaryDescriptionCollection();
3642
+ _this._summaryDescriptions.onChanged = function () { return _this.summaryDescriptions_CollectionChanged(null, null); };
3643
+ return _this;
3644
+ }
3645
+ RestVirtualDataSourceDataProvider.prototype.filterExpressions_CollectionChanged = function (sender, e) {
3646
+ this.queueAutoRefresh();
3647
+ };
3648
+ RestVirtualDataSourceDataProvider.prototype.sortDescriptions_CollectionChanged = function (sender, e) {
3649
+ this.queueAutoRefresh();
3650
+ };
3651
+ RestVirtualDataSourceDataProvider.prototype.groupDescriptions_CollectionChanged = function (sender, e) {
3652
+ this.queueAutoRefresh();
3653
+ };
3654
+ RestVirtualDataSourceDataProvider.prototype.summaryDescriptions_CollectionChanged = function (sender, e) {
3655
+ this.queueAutoRefresh();
3656
+ };
3657
+ RestVirtualDataSourceDataProvider.prototype.addPageRequest = function (pageIndex, priority) {
3658
+ if (this.deferAutoRefresh) {
3659
+ return;
3660
+ }
3661
+ if (this._worker != null && this._worker.isShutdown) {
3662
+ this._worker = null;
3663
+ this._callback = null;
3664
+ }
3665
+ if (this._worker == null) {
3666
+ this.createWorker();
3667
+ }
3668
+ if (priority == igniteuiWebcomponentsCore.DataSourcePageRequestPriority.High) {
3669
+ this._requests.addFirst(pageIndex);
3670
+ }
3671
+ else {
3672
+ this._requests.addLast(pageIndex);
3673
+ }
3674
+ if (!this._worker.addPageRequest(pageIndex, priority)) {
3675
+ this._worker = null;
3676
+ this._callback = null;
3677
+ this.addPageRequest(pageIndex, priority);
3678
+ }
3679
+ };
3680
+ RestVirtualDataSourceDataProvider.prototype.createWorker = function () {
3681
+ if (!this.valid()) {
3682
+ return;
3683
+ }
3684
+ this._callback = igniteuiWebcomponentsCore.runOn(this, this.raisePageLoaded);
3685
+ var settings = this.getWorkerSettings();
3686
+ this._worker = new RestVirtualDataSourceDataProviderWorker(settings);
3687
+ };
3688
+ RestVirtualDataSourceDataProvider.prototype.valid = function () {
3689
+ return this.entitySet != null && this.baseUri != null;
3690
+ };
3691
+ RestVirtualDataSourceDataProvider.prototype.getWorkerSettings = function () {
3692
+ var _this = this;
3693
+ return ((function () {
3694
+ var $ret = new RestVirtualDataSourceDataProviderWorkerSettings();
3695
+ $ret.baseUri = _this._baseUri;
3696
+ $ret.entitySet = _this._entitySet;
3697
+ $ret.pageSizeRequested = _this._pageSizeRequested;
3698
+ $ret.timeoutMilliseconds = _this._timeoutMilliseconds;
3699
+ $ret.pageLoaded = _this._callback;
3700
+ $ret.executionContext = _this._executionContext;
3701
+ $ret.sortDescriptions = _this._sortDescriptions;
3702
+ $ret.groupDescriptions = _this._groupDescriptions;
3703
+ $ret.filterExpressions = _this._filterExpressions;
3704
+ $ret.propertiesRequested = _this._propertiesRequested;
3705
+ $ret.summaryDescriptions = _this._summaryDescriptions;
3706
+ $ret.summaryScope = _this._summaryScope;
3707
+ $ret.enableJsonp = _this._enableJsonp;
3708
+ $ret.isAggregationSupported = _this.isAggregationSupported;
3709
+ $ret.performFetch = _this.performFetch;
3710
+ $ret.provideAggregationParameter = _this.provideAggregationParameter;
3711
+ $ret.provideAggregatedCount = _this.provideAggregatedCount;
3712
+ $ret.provideDesiredPropertiesParameter = _this.provideDesiredPropertiesParameter;
3713
+ $ret.provideFilterParameter = _this.provideFilterParameter;
3714
+ $ret.provideFullCount = _this.provideFullCount;
3715
+ $ret.provideItems = _this.provideItems;
3716
+ $ret.provideOrderByParameter = _this.provideOrderByParameter;
3717
+ $ret.providePagingParameter = _this.providePagingParameter;
3718
+ $ret.provideUri = _this.provideUri;
3719
+ $ret.fixedFullCount = _this.fixedFullCount;
3720
+ return $ret;
3721
+ })());
3722
+ };
3723
+ RestVirtualDataSourceDataProvider.prototype.removePageRequest = function (pageIndex) {
3724
+ var current = this._requests.first;
3725
+ while (current != null) {
3726
+ if (current.value == pageIndex) {
3727
+ this._requests.remove(current);
3728
+ }
3729
+ current = current.next;
3730
+ }
3731
+ if (this._worker == null) {
3732
+ return;
3733
+ }
3734
+ this._worker.removePageRequest(pageIndex);
3735
+ };
3736
+ RestVirtualDataSourceDataProvider.prototype.removeAllPageRequests = function () {
3737
+ this._requests.clear();
3738
+ if (this._worker == null) {
3739
+ return;
3740
+ }
3741
+ this._worker.removeAllPageRequests();
3742
+ };
3743
+ RestVirtualDataSourceDataProvider.prototype.close = function () {
3744
+ if (this._worker != null) {
3745
+ this._worker.shutdown();
3746
+ this._worker = null;
3747
+ this._callback = null;
3748
+ }
3749
+ };
3750
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "pageLoaded", {
3751
+ get: function () {
3752
+ return this._pageLoaded;
3753
+ },
3754
+ set: function (value) {
3755
+ this._pageLoaded = value;
3756
+ this.queueAutoRefresh();
3757
+ },
3758
+ enumerable: true,
3759
+ configurable: true
3760
+ });
3761
+ RestVirtualDataSourceDataProvider.prototype.raisePageLoaded = function (page, fullCount, actualPageSize) {
3762
+ if (this._pageLoaded != null) {
3763
+ this._currentFullCount = fullCount;
3764
+ if (this._currentSchema == null) {
3765
+ var currentSchema = null;
3766
+ if (page != null) {
3767
+ currentSchema = page.schema();
3768
+ }
3769
+ this._currentSchema = currentSchema;
3770
+ if (this.schemaChanged != null) {
3771
+ this.schemaChanged(this, new igniteuiWebcomponentsCore.DataSourceDataProviderSchemaChangedEventArgs(this._currentSchema, this._currentFullCount));
3772
+ }
3773
+ }
3774
+ if (page.pageIndex() != RestVirtualDataSourceDataProviderWorker.schemaRequestIndex) {
3775
+ this._pageLoaded(page, fullCount, actualPageSize);
3776
+ }
3777
+ }
3778
+ };
3779
+ RestVirtualDataSourceDataProvider.prototype.killWorker = function () {
3780
+ if (this._worker != null) {
3781
+ this._worker.shutdown();
3782
+ this._worker = null;
3783
+ this._callback = null;
3784
+ }
3785
+ };
3786
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "pageSizeRequested", {
3787
+ get: function () {
3788
+ return this._pageSizeRequested;
3789
+ },
3790
+ set: function (value) {
3791
+ this._pageSizeRequested = value;
3792
+ this.queueAutoRefresh();
3793
+ },
3794
+ enumerable: true,
3795
+ configurable: true
3796
+ });
3797
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "baseUri", {
3798
+ get: function () {
3799
+ return this._baseUri;
3800
+ },
3801
+ set: function (value) {
3802
+ var oldValue = this._baseUri;
3803
+ this._baseUri = value;
3804
+ if (oldValue != this._baseUri) {
3805
+ this.queueAutoRefresh();
3806
+ if (this.valid() && this.deferAutoRefresh) {
3807
+ this.queueSchemaFetch();
3808
+ }
3809
+ }
3810
+ },
3811
+ enumerable: true,
3812
+ configurable: true
3813
+ });
3814
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "entitySet", {
3815
+ get: function () {
3816
+ return this._entitySet;
3817
+ },
3818
+ set: function (value) {
3819
+ var oldValue = this._entitySet;
3820
+ this._entitySet = value;
3821
+ if (oldValue != this._entitySet) {
3822
+ this.queueAutoRefresh();
3823
+ if (this.valid() && this.deferAutoRefresh) {
3824
+ this.queueSchemaFetch();
3825
+ }
3826
+ }
3827
+ },
3828
+ enumerable: true,
3829
+ configurable: true
3830
+ });
3831
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "timeoutMilliseconds", {
3832
+ get: function () {
3833
+ return this._timeoutMilliseconds;
3834
+ },
3835
+ set: function (value) {
3836
+ this._timeoutMilliseconds = value;
3837
+ this.queueAutoRefresh();
3838
+ },
3839
+ enumerable: true,
3840
+ configurable: true
3841
+ });
3842
+ RestVirtualDataSourceDataProvider.prototype.getItemValue = function (item, valueName) {
3843
+ var dic = item;
3844
+ if (dic.has(valueName)) {
3845
+ return dic.get(valueName);
3846
+ }
3847
+ else {
3848
+ return null;
3849
+ }
3850
+ };
3851
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "actualCount", {
3852
+ get: function () {
3853
+ return this._currentFullCount;
3854
+ },
3855
+ enumerable: true,
3856
+ configurable: true
3857
+ });
3858
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "actualSchema", {
3859
+ get: function () {
3860
+ return this._currentSchema;
3861
+ },
3862
+ enumerable: true,
3863
+ configurable: true
3864
+ });
3865
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "executionContext", {
3866
+ get: function () {
3867
+ return this._executionContext;
3868
+ },
3869
+ set: function (value) {
3870
+ this._executionContext = value;
3871
+ this.queueAutoRefresh();
3872
+ },
3873
+ enumerable: true,
3874
+ configurable: true
3875
+ });
3876
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "updateNotifier", {
3877
+ get: function () {
3878
+ return this._updateNotifier;
3879
+ },
3880
+ set: function (value) {
3881
+ this._updateNotifier = value;
3882
+ },
3883
+ enumerable: true,
3884
+ configurable: true
3885
+ });
3886
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "deferAutoRefresh", {
3887
+ get: function () {
3888
+ return this._deferAutoRefresh;
3889
+ },
3890
+ set: function (value) {
3891
+ this._deferAutoRefresh = value;
3892
+ if (!this._deferAutoRefresh) {
3893
+ this.queueAutoRefresh();
3894
+ }
3895
+ if (this._deferAutoRefresh && this.valid() && this._currentSchema == null) {
3896
+ this.queueSchemaFetch();
3897
+ }
3898
+ },
3899
+ enumerable: true,
3900
+ configurable: true
3901
+ });
3902
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "isSortingSupported", {
3903
+ get: function () {
3904
+ return true;
3905
+ },
3906
+ enumerable: true,
3907
+ configurable: true
3908
+ });
3909
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "isGroupingSupported", {
3910
+ get: function () {
3911
+ return this.isAggregationSupported;
3912
+ },
3913
+ enumerable: true,
3914
+ configurable: true
3915
+ });
3916
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "isFilteringSupported", {
3917
+ get: function () {
3918
+ return true;
3919
+ },
3920
+ enumerable: true,
3921
+ configurable: true
3922
+ });
3923
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "isAggregationSupported", {
3924
+ get: function () {
3925
+ return this._isAggregationSupported;
3926
+ },
3927
+ set: function (isSupported) {
3928
+ this._isAggregationSupported = isSupported;
3929
+ },
3930
+ enumerable: true,
3931
+ configurable: true
3932
+ });
3933
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "sortDescriptions", {
3934
+ get: function () {
3935
+ return this._sortDescriptions;
3936
+ },
3937
+ enumerable: true,
3938
+ configurable: true
3939
+ });
3940
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "groupDescriptions", {
3941
+ get: function () {
3942
+ return this._groupDescriptions;
3943
+ },
3944
+ enumerable: true,
3945
+ configurable: true
3946
+ });
3947
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "propertiesRequested", {
3948
+ get: function () {
3949
+ return this._propertiesRequested;
3950
+ },
3951
+ set: function (value) {
3952
+ this._propertiesRequested = value;
3953
+ this.queueAutoRefresh();
3954
+ },
3955
+ enumerable: true,
3956
+ configurable: true
3957
+ });
3958
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "filterExpressions", {
3959
+ get: function () {
3960
+ return this._filterExpressions;
3961
+ },
3962
+ enumerable: true,
3963
+ configurable: true
3964
+ });
3965
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "summaryDescriptions", {
3966
+ get: function () {
3967
+ return this._summaryDescriptions;
3968
+ },
3969
+ enumerable: true,
3970
+ configurable: true
3971
+ });
3972
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "summaryScope", {
3973
+ get: function () {
3974
+ return this._summaryScope;
3975
+ },
3976
+ set: function (value) {
3977
+ this._summaryScope = value;
3978
+ },
3979
+ enumerable: true,
3980
+ configurable: true
3981
+ });
3982
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "enableJsonp", {
3983
+ get: function () {
3984
+ return this._enableJsonp;
3985
+ },
3986
+ set: function (isEnabled) {
3987
+ this._enableJsonp = isEnabled;
3988
+ },
3989
+ enumerable: true,
3990
+ configurable: true
3991
+ });
3992
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "fixedFullCount", {
3993
+ get: function () {
3994
+ return this._fixedFullCount;
3995
+ },
3996
+ set: function (value) {
3997
+ this._fixedFullCount = value;
3998
+ },
3999
+ enumerable: true,
4000
+ configurable: true
4001
+ });
4002
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideFullCount", {
4003
+ get: function () {
4004
+ return this._provideFullCount;
4005
+ },
4006
+ set: function (value) {
4007
+ this._provideFullCount = value;
4008
+ },
4009
+ enumerable: true,
4010
+ configurable: true
4011
+ });
4012
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideOrderByParameter", {
4013
+ get: function () {
4014
+ return this._provideOrderByParameter;
4015
+ },
4016
+ set: function (value) {
4017
+ this._provideOrderByParameter = value;
4018
+ },
4019
+ enumerable: true,
4020
+ configurable: true
4021
+ });
4022
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideFilterParameter", {
4023
+ get: function () {
4024
+ return this._provideFilterParameter;
4025
+ },
4026
+ set: function (value) {
4027
+ this._provideFilterParameter = value;
4028
+ },
4029
+ enumerable: true,
4030
+ configurable: true
4031
+ });
4032
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideAggregationParameter", {
4033
+ get: function () {
4034
+ return this._provideAggregationParameter;
4035
+ },
4036
+ set: function (value) {
4037
+ this._provideAggregationParameter = value;
4038
+ },
4039
+ enumerable: true,
4040
+ configurable: true
4041
+ });
4042
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideAggregatedCount", {
4043
+ get: function () {
4044
+ return this._provideAggregatedCount;
4045
+ },
4046
+ set: function (value) {
4047
+ this._provideAggregatedCount = value;
4048
+ },
4049
+ enumerable: true,
4050
+ configurable: true
4051
+ });
4052
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideUri", {
4053
+ get: function () {
4054
+ return this._provideUri;
4055
+ },
4056
+ set: function (value) {
4057
+ this._provideUri = value;
4058
+ },
4059
+ enumerable: true,
4060
+ configurable: true
4061
+ });
4062
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "performFetch", {
4063
+ get: function () {
4064
+ return this._performFetch;
4065
+ },
4066
+ set: function (value) {
4067
+ this._performFetch = value;
4068
+ },
4069
+ enumerable: true,
4070
+ configurable: true
4071
+ });
4072
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "providePagingParameter", {
4073
+ get: function () {
4074
+ return this._providePagingParameter;
4075
+ },
4076
+ set: function (value) {
4077
+ this._providePagingParameter = value;
4078
+ },
4079
+ enumerable: true,
4080
+ configurable: true
4081
+ });
4082
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideDesiredPropertiesParameter", {
4083
+ get: function () {
4084
+ return this._provideDesiredPropertiesParameter;
4085
+ },
4086
+ set: function (value) {
4087
+ this._provideDesiredPropertiesParameter = value;
4088
+ },
4089
+ enumerable: true,
4090
+ configurable: true
4091
+ });
4092
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideItems", {
4093
+ get: function () {
4094
+ return this._provideItems;
4095
+ },
4096
+ set: function (value) {
4097
+ this._provideItems = value;
4098
+ },
4099
+ enumerable: true,
4100
+ configurable: true
4101
+ });
4102
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "notifyUsingSourceIndexes", {
4103
+ get: function () {
4104
+ return true;
4105
+ },
4106
+ enumerable: true,
4107
+ configurable: true
4108
+ });
4109
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "isItemIndexLookupSupported", {
4110
+ get: function () {
4111
+ return false;
4112
+ },
4113
+ enumerable: true,
4114
+ configurable: true
4115
+ });
4116
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "isKeyIndexLookupSupported", {
4117
+ get: function () {
4118
+ return false;
4119
+ },
4120
+ enumerable: true,
4121
+ configurable: true
4122
+ });
4123
+ RestVirtualDataSourceDataProvider.prototype.notifySetItem = function (index, oldItem, newItem) {
4124
+ if (this.updateNotifier != null) {
4125
+ this.updateNotifier.notifySetItem(index, oldItem, newItem);
4126
+ }
4127
+ };
4128
+ RestVirtualDataSourceDataProvider.prototype.notifyClearItems = function () {
4129
+ if (this.updateNotifier != null) {
4130
+ this.updateNotifier.notifyClearItems();
4131
+ }
4132
+ };
4133
+ RestVirtualDataSourceDataProvider.prototype.notifyInsertItem = function (index, newItem) {
4134
+ if (this.updateNotifier != null) {
4135
+ this.updateNotifier.notifyInsertItem(index, newItem);
4136
+ }
4137
+ };
4138
+ RestVirtualDataSourceDataProvider.prototype.notifyRemoveItem = function (index, oldItem) {
4139
+ if (this.updateNotifier != null) {
4140
+ this.updateNotifier.notifyRemoveItem(index, oldItem);
4141
+ }
4142
+ };
4143
+ RestVirtualDataSourceDataProvider.prototype.queueSchemaFetch = function () {
4144
+ if (this._schemaFetchQueued) {
4145
+ return;
4146
+ }
4147
+ if (this.executionContext != null) {
4148
+ this._schemaFetchQueued = true;
4149
+ this.executionContext.enqueueAction(igniteuiWebcomponentsCore.runOn(this, this.doSchemaFetchInternal));
4150
+ }
4151
+ };
4152
+ RestVirtualDataSourceDataProvider.prototype.doSchemaFetchInternal = function () {
4153
+ if (!this._schemaFetchQueued) {
4154
+ return;
4155
+ }
4156
+ this._schemaFetchQueued = false;
4157
+ this.schemaFetchInternal();
4158
+ };
4159
+ RestVirtualDataSourceDataProvider.prototype.schemaFetchInternal = function () {
4160
+ this.schemaFetchInternalOverride();
4161
+ };
4162
+ RestVirtualDataSourceDataProvider.prototype.schemaFetchInternalOverride = function () {
4163
+ if (!this.deferAutoRefresh) {
4164
+ return;
4165
+ }
4166
+ this.removeAllPageRequests();
4167
+ this.killWorker();
4168
+ this.createWorker();
4169
+ this.addSchemaRequest();
4170
+ };
4171
+ RestVirtualDataSourceDataProvider.prototype.addSchemaRequest = function () {
4172
+ this._worker.addPageRequest(RestVirtualDataSourceDataProviderWorker.schemaRequestIndex, igniteuiWebcomponentsCore.DataSourcePageRequestPriority.High);
4173
+ };
4174
+ RestVirtualDataSourceDataProvider.prototype.queueAutoRefresh = function () {
4175
+ if (this.deferAutoRefresh) {
4176
+ return;
4177
+ }
4178
+ if (this._autoRefreshQueued) {
4179
+ return;
4180
+ }
4181
+ if (this.executionContext != null) {
4182
+ this._autoRefreshQueued = true;
4183
+ this.executionContext.enqueueAction(igniteuiWebcomponentsCore.runOn(this, this.doRefreshInternal));
4184
+ }
4185
+ };
4186
+ RestVirtualDataSourceDataProvider.prototype.doRefreshInternal = function () {
4187
+ if (this.deferAutoRefresh) {
4188
+ this._autoRefreshQueued = false;
4189
+ return;
4190
+ }
4191
+ if (!this._autoRefreshQueued) {
4192
+ return;
4193
+ }
4194
+ this._autoRefreshQueued = false;
4195
+ this.refreshInternal();
4196
+ };
4197
+ RestVirtualDataSourceDataProvider.prototype.refreshInternal = function () {
4198
+ this.refreshInternalOverride();
4199
+ };
4200
+ RestVirtualDataSourceDataProvider.prototype.refreshInternalOverride = function () {
4201
+ this.removeAllPageRequests();
4202
+ this.killWorker();
4203
+ this.createWorker();
4204
+ this._worker.addPageRequest(0, igniteuiWebcomponentsCore.DataSourcePageRequestPriority.Normal);
4205
+ };
4206
+ RestVirtualDataSourceDataProvider.prototype.flushAutoRefresh = function () {
4207
+ this.doRefreshInternal();
4208
+ };
4209
+ RestVirtualDataSourceDataProvider.prototype.refresh = function () {
4210
+ this.refreshInternal();
4211
+ };
4212
+ RestVirtualDataSourceDataProvider.prototype.indexOfItem = function (item) {
4213
+ return -1;
4214
+ };
4215
+ RestVirtualDataSourceDataProvider.prototype.indexOfKey = function (key) {
4216
+ return -1;
4217
+ };
4218
+ RestVirtualDataSourceDataProvider.prototype.resolveSchemaPropertyType = function (propertyPath) {
4219
+ if (this.actualSchema == null) {
4220
+ return igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.ObjectValue;
4221
+ }
4222
+ if (igniteuiWebcomponentsCore.stringContains(propertyPath, ".")) {
4223
+ return igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.ObjectValue;
4224
+ }
4225
+ for (var i = 0; i < this.actualSchema.propertyNames.length; i++) {
4226
+ var name_1 = this.actualSchema.propertyNames[i];
4227
+ if (name_1 == propertyPath) {
4228
+ return this.actualSchema.propertyTypes[i];
4229
+ }
4230
+ }
4231
+ return igniteuiWebcomponentsCore.DataSourceSchemaPropertyType.ObjectValue;
4232
+ };
4233
+ RestVirtualDataSourceDataProvider.prototype.setItemValue = function (item, valueName, value) {
4234
+ // does nothing.
4235
+ };
4236
+ RestVirtualDataSourceDataProvider.prototype.removeItem = function (item) {
4237
+ // does nothing.
4238
+ };
4239
+ RestVirtualDataSourceDataProvider.prototype.addItem = function (item) {
4240
+ // does nothing.
4241
+ };
4242
+ RestVirtualDataSourceDataProvider.prototype.createBatchRequest = function (changes) {
4243
+ if (this._worker != null) {
4244
+ this._worker.createBatchRequest(changes);
4245
+ }
4246
+ };
4247
+ Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "batchCompleted", {
4248
+ get: function () {
4249
+ return this._batchCompleted;
4250
+ },
4251
+ set: function (v) {
4252
+ this._batchCompleted = v;
4253
+ },
4254
+ enumerable: true,
4255
+ configurable: true
4256
+ });
4257
+ RestVirtualDataSourceDataProvider.$t = igniteuiWebcomponentsCore.markType(RestVirtualDataSourceDataProvider, 'ODataVirtualDataSourceDataProvider', igniteuiWebcomponentsCore.Base.$type, [igniteuiWebcomponentsCore.IDataSourceVirtualDataProvider_$type]);
4258
+ return RestVirtualDataSourceDataProvider;
4259
+ }(igniteuiWebcomponentsCore.Base));
4260
+
4261
+ var RestVirtualDataSource = /** @class */ /*@__PURE__*/ (function (_super) {
4262
+ tslib_1.__extends(RestVirtualDataSource, _super);
4263
+ function RestVirtualDataSource() {
4264
+ var _this = _super.call(this) || this;
4265
+ _this._baseUri = null;
4266
+ _this._isFilteringSupportedByServer = false;
4267
+ _this._entitySet = null;
4268
+ _this._timeoutMilliseconds = 10000;
4269
+ _this._isAggregationSupportedByServer = false;
4270
+ _this._enableJsonp = true;
4271
+ _this._fixedFullCount = -1;
4272
+ _this._provideFullCount = null;
4273
+ _this._provideOrderByParameter = null;
4274
+ _this._provideFilterParameter = null;
4275
+ _this._provideAggregationParameter = null;
4276
+ _this._provideAggregatedCount = null;
4277
+ _this._provideUri = null;
4278
+ _this._performFetch = null;
4279
+ _this._providePagingParameter = null;
4280
+ _this._provideDesiredPropertiesParameter = null;
4281
+ _this.dataProvider = ((function () {
4282
+ var $ret = new RestVirtualDataSourceDataProvider();
4283
+ $ret.executionContext = _this.executionContext;
4284
+ $ret.enableJsonp = _this.enableJsonp;
4285
+ $ret.isAggregationSupported = _this.isGroupingSupported;
4286
+ return $ret;
4287
+ })());
4288
+ _this.externalDataSource = _this;
4289
+ return _this;
4290
+ }
4291
+ RestVirtualDataSource.prototype.onBaseUriChanged = function (oldValue, newValue) {
4292
+ if (this.actualDataProvider) {
4293
+ this.actualDataProvider.baseUri = this.baseUri;
4294
+ this.queueAutoRefresh();
4295
+ }
4296
+ };
4297
+ Object.defineProperty(RestVirtualDataSource.prototype, "baseUri", {
4298
+ get: function () {
4299
+ return this._baseUri;
4300
+ },
4301
+ set: function (value) {
4302
+ var oldValue = this._baseUri;
4303
+ this._baseUri = value;
4304
+ if (oldValue != this._baseUri) {
4305
+ this.onBaseUriChanged(oldValue, this._baseUri);
4306
+ }
4307
+ },
4308
+ enumerable: true,
4309
+ configurable: true
4310
+ });
4311
+ RestVirtualDataSource.prototype.onEntitySetChanged = function (oldValue, newValue) {
4312
+ if (this.actualDataProvider) {
4313
+ this.actualDataProvider.entitySet = this.entitySet;
4314
+ this.queueAutoRefresh();
4315
+ }
4316
+ this.queueAutoRefresh();
4317
+ };
4318
+ Object.defineProperty(RestVirtualDataSource.prototype, "isFilteringSupportedByServer", {
4319
+ get: function () {
4320
+ return this._isFilteringSupportedByServer;
4321
+ },
4322
+ set: function (v) {
4323
+ this._isFilteringSupportedByServer = v;
4324
+ },
4325
+ enumerable: true,
4326
+ configurable: true
4327
+ });
4328
+ RestVirtualDataSource.prototype.get_isFilteringSupported = function () {
4329
+ if (this._isFilteringSupportedByServer) {
4330
+ return true;
4331
+ }
4332
+ return false;
4333
+ };
4334
+ Object.defineProperty(RestVirtualDataSource.prototype, "entitySet", {
4335
+ get: function () {
4336
+ return this._entitySet;
4337
+ },
4338
+ set: function (value) {
4339
+ var oldValue = this._entitySet;
4340
+ this._entitySet = value;
4341
+ if (this._entitySet != oldValue) {
4342
+ this.onEntitySetChanged(oldValue, this._entitySet);
4343
+ }
4344
+ },
4345
+ enumerable: true,
4346
+ configurable: true
4347
+ });
4348
+ RestVirtualDataSource.prototype.onTimeoutMillisecondsChanged = function (oldValue, newValue) {
4349
+ if (this.actualDataProvider) {
4350
+ this.actualDataProvider.timeoutMilliseconds = this.timeoutMilliseconds;
4351
+ }
4352
+ };
4353
+ Object.defineProperty(RestVirtualDataSource.prototype, "timeoutMilliseconds", {
4354
+ get: function () {
4355
+ return this._timeoutMilliseconds;
4356
+ },
4357
+ set: function (value) {
4358
+ var oldValue = this._timeoutMilliseconds;
4359
+ this._timeoutMilliseconds = value;
4360
+ if (oldValue != this._timeoutMilliseconds) {
4361
+ this.onTimeoutMillisecondsChanged(oldValue, this._timeoutMilliseconds);
4362
+ }
4363
+ },
4364
+ enumerable: true,
4365
+ configurable: true
4366
+ });
4367
+ Object.defineProperty(RestVirtualDataSource.prototype, "isSortingSupportedOverride", {
4368
+ get: function () {
4369
+ return true;
4370
+ },
4371
+ enumerable: true,
4372
+ configurable: true
4373
+ });
4374
+ Object.defineProperty(RestVirtualDataSource.prototype, "isFilteringSupportedOverride", {
4375
+ get: function () {
4376
+ return true;
4377
+ },
4378
+ enumerable: true,
4379
+ configurable: true
4380
+ });
4381
+ Object.defineProperty(RestVirtualDataSource.prototype, "isGroupingSupportedOverride", {
4382
+ get: function () {
4383
+ return this.isAggregationSupportedByServer;
4384
+ },
4385
+ enumerable: true,
4386
+ configurable: true
4387
+ });
4388
+ Object.defineProperty(RestVirtualDataSource.prototype, "isAggregationSupportedByServer", {
4389
+ get: function () {
4390
+ return this._isAggregationSupportedByServer;
4391
+ },
4392
+ set: function (isSupported) {
4393
+ this._isAggregationSupportedByServer = isSupported;
4394
+ if (this.actualDataProvider) {
4395
+ this.actualDataProvider.isAggregationSupported = this.isAggregationSupportedByServer;
4396
+ }
4397
+ },
4398
+ enumerable: true,
4399
+ configurable: true
4400
+ });
4401
+ Object.defineProperty(RestVirtualDataSource.prototype, "enableJsonp", {
4402
+ get: function () {
4403
+ return this._enableJsonp;
4404
+ },
4405
+ set: function (isEnabled) {
4406
+ this._enableJsonp = isEnabled;
4407
+ if (this.actualDataProvider) {
4408
+ this.actualDataProvider.enableJsonp = this.enableJsonp;
4409
+ }
4410
+ },
4411
+ enumerable: true,
4412
+ configurable: true
4413
+ });
4414
+ Object.defineProperty(RestVirtualDataSource.prototype, "fixedFullCount", {
4415
+ get: function () {
4416
+ return this._fixedFullCount;
4417
+ },
4418
+ set: function (value) {
4419
+ this._fixedFullCount = value;
4420
+ },
4421
+ enumerable: true,
4422
+ configurable: true
4423
+ });
4424
+ Object.defineProperty(RestVirtualDataSource.prototype, "provideFullCount", {
4425
+ get: function () {
4426
+ return this._provideFullCount;
4427
+ },
4428
+ set: function (value) {
4429
+ this._provideFullCount = value;
4430
+ if (this.actualDataProvider) {
4431
+ this.actualDataProvider.provideFullCount = this.provideFullCount;
4432
+ this.queueAutoRefresh();
4433
+ }
4434
+ },
4435
+ enumerable: true,
4436
+ configurable: true
4437
+ });
4438
+ Object.defineProperty(RestVirtualDataSource.prototype, "provideOrderByParameter", {
4439
+ get: function () {
4440
+ return this._provideOrderByParameter;
4441
+ },
4442
+ set: function (value) {
4443
+ this._provideOrderByParameter = value;
4444
+ if (this.actualDataProvider) {
4445
+ this.actualDataProvider.provideOrderByParameter = this.provideOrderByParameter;
4446
+ this.queueAutoRefresh();
4447
+ }
4448
+ },
4449
+ enumerable: true,
4450
+ configurable: true
4451
+ });
4452
+ Object.defineProperty(RestVirtualDataSource.prototype, "provideFilterParameter", {
4453
+ get: function () {
4454
+ return this._provideFilterParameter;
4455
+ },
4456
+ set: function (value) {
4457
+ this._provideFilterParameter = value;
4458
+ if (this.actualDataProvider) {
4459
+ this.actualDataProvider.provideFilterParameter = this.provideFilterParameter;
4460
+ this.queueAutoRefresh();
4461
+ }
4462
+ },
4463
+ enumerable: true,
4464
+ configurable: true
4465
+ });
4466
+ Object.defineProperty(RestVirtualDataSource.prototype, "provideAggregationParameter", {
4467
+ get: function () {
4468
+ return this._provideAggregationParameter;
4469
+ },
4470
+ set: function (value) {
4471
+ this._provideAggregationParameter = value;
4472
+ if (this.actualDataProvider) {
4473
+ this.actualDataProvider.provideAggregationParameter = this.provideAggregationParameter;
4474
+ this.queueAutoRefresh();
4475
+ }
4476
+ },
4477
+ enumerable: true,
4478
+ configurable: true
4479
+ });
4480
+ Object.defineProperty(RestVirtualDataSource.prototype, "provideAggregatedCount", {
4481
+ get: function () {
4482
+ return this._provideAggregatedCount;
4483
+ },
4484
+ set: function (value) {
4485
+ this._provideAggregatedCount = value;
4486
+ if (this.actualDataProvider) {
4487
+ this.actualDataProvider.provideAggregatedCount = this.provideAggregatedCount;
4488
+ this.queueAutoRefresh();
4489
+ }
4490
+ },
4491
+ enumerable: true,
4492
+ configurable: true
4493
+ });
4494
+ Object.defineProperty(RestVirtualDataSource.prototype, "provideUri", {
4495
+ get: function () {
4496
+ return this._provideUri;
4497
+ },
4498
+ set: function (value) {
4499
+ this._provideUri = value;
4500
+ if (this.actualDataProvider) {
4501
+ this.actualDataProvider.provideUri = this.provideUri;
4502
+ this.queueAutoRefresh();
4503
+ }
4504
+ },
4505
+ enumerable: true,
4506
+ configurable: true
4507
+ });
4508
+ Object.defineProperty(RestVirtualDataSource.prototype, "performFetch", {
4509
+ get: function () {
4510
+ return this._performFetch;
4511
+ },
4512
+ set: function (value) {
4513
+ this._performFetch = value;
4514
+ if (this.actualDataProvider) {
4515
+ this.actualDataProvider.performFetch = this.performFetch;
4516
+ this.queueAutoRefresh();
4517
+ }
4518
+ },
4519
+ enumerable: true,
4520
+ configurable: true
4521
+ });
4522
+ Object.defineProperty(RestVirtualDataSource.prototype, "providePagingParameter", {
4523
+ get: function () {
4524
+ return this._providePagingParameter;
4525
+ },
4526
+ set: function (value) {
4527
+ this._providePagingParameter = value;
4528
+ if (this.actualDataProvider) {
4529
+ this.actualDataProvider.providePagingParameter = this.providePagingParameter;
4530
+ this.queueAutoRefresh();
4531
+ }
4532
+ },
4533
+ enumerable: true,
4534
+ configurable: true
4535
+ });
4536
+ Object.defineProperty(RestVirtualDataSource.prototype, "provideDesiredPropertiesParameter", {
4537
+ get: function () {
4538
+ return this._provideDesiredPropertiesParameter;
4539
+ },
4540
+ set: function (value) {
4541
+ this._provideDesiredPropertiesParameter = value;
4542
+ if (this.actualDataProvider) {
4543
+ this.actualDataProvider.provideDesiredPropertiesParameter = this.provideDesiredPropertiesParameter;
4544
+ this.queueAutoRefresh();
4545
+ }
4546
+ },
4547
+ enumerable: true,
4548
+ configurable: true
4549
+ });
4550
+ Object.defineProperty(RestVirtualDataSource.prototype, "provideItems", {
4551
+ get: function () {
4552
+ return this._provideItems;
4553
+ },
4554
+ set: function (value) {
4555
+ this._provideItems = value;
4556
+ if (this.actualDataProvider) {
4557
+ this.actualDataProvider.provideItems = this.provideItems;
4558
+ this.queueAutoRefresh();
4559
+ }
4560
+ },
4561
+ enumerable: true,
4562
+ configurable: true
4563
+ });
4564
+ RestVirtualDataSource.prototype.clone = function () {
4565
+ var dataSource = new RestVirtualDataSource();
4566
+ dataSource.executionContext = this.executionContext;
4567
+ dataSource.includeSummaryRowsInSection = this.includeSummaryRowsInSection;
4568
+ dataSource.isSectionCollapsable = this.isSectionCollapsable;
4569
+ dataSource.isSectionExpandedDefault = this.isSectionExpandedDefault;
4570
+ //dataSource.isSectionHeaderNormalRow = this.isSectionHeaderNormalRow;
4571
+ dataSource.isSectionSummaryRowsAtBottom = this.isSectionSummaryRowsAtBottom;
4572
+ //dataSource.isSectionContentVisible = this.isSectionContentVisible;
4573
+ dataSource.primaryKey = this.primaryKey;
4574
+ dataSource.propertiesRequested = this.propertiesRequested;
4575
+ dataSource.sectionHeaderDisplayMode = this.sectionHeaderDisplayMode;
4576
+ dataSource.shouldEmitSectionFooters = this.shouldEmitSectionFooters;
4577
+ dataSource.shouldEmitSectionHeaders = this.shouldEmitSectionHeaders;
4578
+ dataSource.shouldEmitShiftedRows = this.shouldEmitShiftedRows;
4579
+ dataSource.summaryScope = this.summaryScope;
4580
+ for (var i = 0; i < this.groupDescriptions.size(); i++) {
4581
+ dataSource.groupDescriptions.add(this.groupDescriptions.get(i));
4582
+ }
4583
+ for (var i = 0; i < this.sortDescriptions.size(); i++) {
4584
+ dataSource.sortDescriptions.add(this.sortDescriptions.get(i));
4585
+ }
4586
+ for (var i = 0; i < this.filterExpressions.size(); i++) {
4587
+ dataSource.filterExpressions.add(this.filterExpressions.get(i));
4588
+ }
4589
+ for (var i = 0; i < this.summaryDescriptions.size(); i++) {
4590
+ dataSource.summaryDescriptions.add(this.summaryDescriptions.get(i));
4591
+ }
4592
+ dataSource.pageSizeRequested = this.pageSizeRequested;
4593
+ dataSource.maxCachedPages = this.maxCachedPages;
4594
+ dataSource.baseUri = this.baseUri;
4595
+ dataSource.entitySet = this.entitySet;
4596
+ dataSource.timeoutMilliseconds = this.timeoutMilliseconds;
4597
+ dataSource.isAggregationSupportedByServer = this.isAggregationSupportedByServer;
4598
+ dataSource.enableJsonp = this.enableJsonp;
4599
+ dataSource.fixedFullCount = this.fixedFullCount;
4600
+ dataSource.provideAggregationParameter = this.provideAggregationParameter;
4601
+ dataSource.provideAggregatedCount = this.provideAggregatedCount;
4602
+ dataSource.provideFilterParameter = this.provideFilterParameter;
4603
+ dataSource.provideFullCount = this.provideFullCount;
4604
+ dataSource.provideOrderByParameter = this.provideOrderByParameter;
4605
+ dataSource.provideUri = this.provideUri;
4606
+ dataSource.performFetch = this.performFetch;
4607
+ dataSource.providePagingParameter = this.providePagingParameter;
4608
+ dataSource.provideItems = this.provideItems;
4609
+ dataSource.provideDesiredPropertiesParameter = this.provideDesiredPropertiesParameter;
4610
+ return dataSource;
4611
+ };
4612
+ return RestVirtualDataSource;
4613
+ }(igniteuiWebcomponentsCore.VirtualDataSource));
4614
+
2342
4615
  exports.Entity = Entity;
2343
4616
  exports.EntityProperty = EntityProperty;
2344
4617
  exports.EntitySet = EntitySet;
@@ -2351,6 +4624,12 @@
2351
4624
  exports.ODataVirtualDataSourceDataProviderWorker = ODataVirtualDataSourceDataProviderWorker;
2352
4625
  exports.ODataVirtualDataSourceDataProviderWorkerSettings = ODataVirtualDataSourceDataProviderWorkerSettings;
2353
4626
  exports.ODataVirtualDataSourceProviderTaskDataHolder = ODataVirtualDataSourceProviderTaskDataHolder;
4627
+ exports.RestVirtualDataSource = RestVirtualDataSource;
4628
+ exports.RestVirtualDataSourceDataProvider = RestVirtualDataSourceDataProvider;
4629
+ exports.RestVirtualDataSourceDataProviderWorker = RestVirtualDataSourceDataProviderWorker;
4630
+ exports.RestVirtualDataSourceDataProviderWorkerSettings = RestVirtualDataSourceDataProviderWorkerSettings;
4631
+ exports.RestVirtualDataSourcePage = RestVirtualDataSourcePage;
4632
+ exports.RestVirtualDataSourceProviderTaskDataHolder = RestVirtualDataSourceProviderTaskDataHolder;
2354
4633
  exports.Schema = Schema;
2355
4634
  exports.first = first;
2356
4635
  exports.toArray = toArray;
@@ -2358,4 +4637,3 @@
2358
4637
  Object.defineProperty(exports, '__esModule', { value: true });
2359
4638
 
2360
4639
  })));
2361
- //# sourceMappingURL=igniteui-webcomponents-datasources.umd.js.map