@easyquery/core 7.1.3-beta02 → 7.2.0-rc04
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.
- package/dist/bundles/easyquery.core.js +257 -187
- package/dist/bundles/easyquery.core.js.map +1 -1
- package/dist/bundles/easyquery.core.min.js +1 -2
- package/dist/bundles/easyquery.core.min.js.map +1 -1
- package/dist/lib/common/eq_services.d.ts +5 -0
- package/dist/lib/common/eq_services.js +16 -2
- package/dist/lib/common/eq_services.js.map +1 -1
- package/dist/lib/data/eq_aggr_container.d.ts +8 -4
- package/dist/lib/data/eq_aggr_container.js +30 -16
- package/dist/lib/data/eq_aggr_container.js.map +1 -1
- package/dist/lib/data/eq_data_loader.js +0 -1
- package/dist/lib/data/eq_data_loader.js.map +1 -1
- package/dist/lib/eqs/eqs_exporter.js +2 -2
- package/dist/lib/eqs/eqs_exporter.js.map +1 -1
- package/dist/lib/eqs/eqs_query_file_loader.js +2 -2
- package/dist/lib/eqs/eqs_query_file_loader.js.map +1 -1
- package/dist/lib/main/context.d.ts +2 -0
- package/dist/lib/main/context.js +47 -36
- package/dist/lib/main/context.js.map +1 -1
- package/dist/lib/main/context_options.d.ts +3 -2
- package/dist/lib/main/model_loader.js.map +1 -1
- package/dist/lib/main/model_storage.d.ts +13 -0
- package/dist/lib/main/model_storage.js +18 -0
- package/dist/lib/main/model_storage.js.map +1 -0
- package/dist/lib/main/widget.d.ts +1 -1
- package/dist/lib/public_api.d.ts +1 -0
- package/dist/lib/public_api.js +1 -0
- package/dist/lib/public_api.js.map +1 -1
- package/dist/lib/query/condition.d.ts +3 -2
- package/dist/lib/query/expression.d.ts +1 -1
- package/dist/lib/query/query.d.ts +2 -1
- package/dist/lib/query/query.js +15 -16
- package/dist/lib/query/query.js.map +1 -1
- package/dist/lib/query/query_column.d.ts +1 -1
- package/dist/lib/types/eq_editor_tag.js +1 -1
- package/dist/lib/types/eq_editor_tag.js.map +1 -1
- package/dist/lib/utils/constants.d.ts +4 -3
- package/dist/lib/utils/utils.js.map +1 -1
- package/package.json +4 -5
- package/dist/bundles/easyquery.core.min.js.LICENSE.txt +0 -1
|
@@ -766,7 +766,7 @@ var i18n_i18n;
|
|
|
766
766
|
var utils_utils;
|
|
767
767
|
(function (utils) {
|
|
768
768
|
function getAllDataTypes() {
|
|
769
|
-
return Object.values(DataType);
|
|
769
|
+
return Object.values(DataType).filter(function (item) { return typeof item === "number"; });
|
|
770
770
|
}
|
|
771
771
|
utils.getAllDataTypes = getAllDataTypes;
|
|
772
772
|
function getDateDataTypes() {
|
|
@@ -774,12 +774,16 @@ var utils_utils;
|
|
|
774
774
|
}
|
|
775
775
|
utils.getDateDataTypes = getDateDataTypes;
|
|
776
776
|
function getStringDataTypes() {
|
|
777
|
-
return [DataType.String, DataType.Memo];
|
|
777
|
+
return [DataType.String, DataType.Memo, DataType.FixedChar];
|
|
778
778
|
}
|
|
779
779
|
utils.getStringDataTypes = getStringDataTypes;
|
|
780
780
|
var _numericTypes = [DataType.Byte, DataType.Word, DataType.Int32,
|
|
781
|
-
DataType.Int64, DataType.Float, DataType.Currency];
|
|
782
|
-
|
|
781
|
+
DataType.Int64, DataType.Float, DataType.Currency, DataType.Autoinc];
|
|
782
|
+
function getNumericDataTypes() {
|
|
783
|
+
return _numericTypes;
|
|
784
|
+
}
|
|
785
|
+
utils.getNumericDataTypes = getNumericDataTypes;
|
|
786
|
+
var _intTypes = [DataType.Byte, DataType.Word, DataType.Int32, DataType.Int64, DataType.Autoinc];
|
|
783
787
|
//-------------- object functions -------------------
|
|
784
788
|
/**
|
|
785
789
|
* Copy the content of all objests passed in `args` parameters into `target`
|
|
@@ -844,7 +848,7 @@ var utils_utils;
|
|
|
844
848
|
hashSet.set(sourceVal, target[key]);
|
|
845
849
|
}
|
|
846
850
|
else {
|
|
847
|
-
if (typeof target[key] == 'undefined') {
|
|
851
|
+
if (typeof target[key] == 'undefined' || target[key] == null) {
|
|
848
852
|
target[key] = Object.create(Object.getPrototypeOf(sourceVal));
|
|
849
853
|
}
|
|
850
854
|
hashSet.set(sourceVal, target[key]);
|
|
@@ -1373,7 +1377,7 @@ var http_client_HttpClient = /** @class */ (function () {
|
|
|
1373
1377
|
var desc = {
|
|
1374
1378
|
method: method,
|
|
1375
1379
|
url: url,
|
|
1376
|
-
headers: __assign({}, this.defaultHeaders, options.headers || {}),
|
|
1380
|
+
headers: __assign(__assign({}, this.defaultHeaders), options.headers || {}),
|
|
1377
1381
|
queryParams: options.queryParams || {},
|
|
1378
1382
|
data: data
|
|
1379
1383
|
};
|
|
@@ -1519,6 +1523,12 @@ var MetaEntity = /** @class */ (function () {
|
|
|
1519
1523
|
};
|
|
1520
1524
|
internalProcessEntity(this);
|
|
1521
1525
|
};
|
|
1526
|
+
MetaEntity.prototype.getFirstPrimaryAttr = function () {
|
|
1527
|
+
return this.getPrimaryAttrs()[0];
|
|
1528
|
+
};
|
|
1529
|
+
MetaEntity.prototype.getPrimaryAttrs = function () {
|
|
1530
|
+
return this.attributes.filter(function (attr) { return attr.isPrimaryKey; });
|
|
1531
|
+
};
|
|
1522
1532
|
return MetaEntity;
|
|
1523
1533
|
}());
|
|
1524
1534
|
|
|
@@ -2137,9 +2147,9 @@ var meta_data_MetaData = /** @class */ (function () {
|
|
|
2137
2147
|
}());
|
|
2138
2148
|
|
|
2139
2149
|
//# sourceMappingURL=meta_data.js.map
|
|
2140
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/data/
|
|
2141
|
-
var
|
|
2142
|
-
|
|
2150
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/data/aggr_settings.js
|
|
2151
|
+
var aggr_settings_assign = (undefined && undefined.__assign) || function () {
|
|
2152
|
+
aggr_settings_assign = Object.assign || function(t) {
|
|
2143
2153
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2144
2154
|
s = arguments[i];
|
|
2145
2155
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
@@ -2147,7 +2157,7 @@ var aggr_calculator_assign = (undefined && undefined.__assign) || function () {
|
|
|
2147
2157
|
}
|
|
2148
2158
|
return t;
|
|
2149
2159
|
};
|
|
2150
|
-
return
|
|
2160
|
+
return aggr_settings_assign.apply(this, arguments);
|
|
2151
2161
|
};
|
|
2152
2162
|
/**
|
|
2153
2163
|
* Defines aggregations settings for the current context.
|
|
@@ -2160,16 +2170,32 @@ var AggregationSettings = /** @class */ (function () {
|
|
|
2160
2170
|
this.groups = [];
|
|
2161
2171
|
this.useGrandTotals = false;
|
|
2162
2172
|
this.useRecordCount = false;
|
|
2163
|
-
this.
|
|
2173
|
+
this._caseSensitiveGroups = false;
|
|
2164
2174
|
this.COUNT_FIELD_NAME = 'GRPRECCNT';
|
|
2165
2175
|
}
|
|
2176
|
+
Object.defineProperty(AggregationSettings.prototype, "caseSensitiveGroups", {
|
|
2177
|
+
get: function () {
|
|
2178
|
+
return this._caseSensitiveGroups;
|
|
2179
|
+
},
|
|
2180
|
+
set: function (value) {
|
|
2181
|
+
this._caseSensitiveGroups = value;
|
|
2182
|
+
this.updateCompareProc();
|
|
2183
|
+
},
|
|
2184
|
+
enumerable: true,
|
|
2185
|
+
configurable: true
|
|
2186
|
+
});
|
|
2187
|
+
AggregationSettings.prototype.updateCompareProc = function () {
|
|
2188
|
+
this.compareValues = this._caseSensitiveGroups
|
|
2189
|
+
? this.strictCompare
|
|
2190
|
+
: this.caseInsensitiveCompare;
|
|
2191
|
+
};
|
|
2166
2192
|
AggregationSettings.prototype.addGroup = function (settings) {
|
|
2167
2193
|
var cols = settings.columns || this.colStore.getColumnIds(settings.from, settings.to);
|
|
2168
2194
|
if (!this.colStore.validateColumns(cols))
|
|
2169
2195
|
throw "Invalid columns: " + cols;
|
|
2170
2196
|
if (this.hasColumnsInUse(cols))
|
|
2171
2197
|
throw "Can't add same columns to different groups/aggregates";
|
|
2172
|
-
this.groups.push(
|
|
2198
|
+
this.groups.push(aggr_settings_assign({ columns: cols }, settings));
|
|
2173
2199
|
return this;
|
|
2174
2200
|
};
|
|
2175
2201
|
AggregationSettings.prototype.addAggregateColumn = function (colIndexOrId, funcId) {
|
|
@@ -2194,7 +2220,7 @@ var AggregationSettings = /** @class */ (function () {
|
|
|
2194
2220
|
var cols = [];
|
|
2195
2221
|
var mappedGrops = this.groups.map(function (grp) {
|
|
2196
2222
|
cols = cols.concat(grp.columns);
|
|
2197
|
-
return
|
|
2223
|
+
return aggr_settings_assign(aggr_settings_assign({}, grp), { columns: Array.from(cols), aggregates: Array.from(_this.aggregates) });
|
|
2198
2224
|
});
|
|
2199
2225
|
return mappedGrops;
|
|
2200
2226
|
};
|
|
@@ -2286,10 +2312,35 @@ var AggregationSettings = /** @class */ (function () {
|
|
|
2286
2312
|
}
|
|
2287
2313
|
}
|
|
2288
2314
|
};
|
|
2315
|
+
AggregationSettings.prototype.buildGroupKey = function (group, row) {
|
|
2316
|
+
var caseInsensitive = !this.caseSensitiveGroups;
|
|
2317
|
+
var result = {};
|
|
2318
|
+
if (group) {
|
|
2319
|
+
for (var _i = 0, _a = group.columns; _i < _a.length; _i++) {
|
|
2320
|
+
var colId = _a[_i];
|
|
2321
|
+
var keyVal = row.getValue(colId);
|
|
2322
|
+
if (caseInsensitive && typeof (keyVal) === 'string') {
|
|
2323
|
+
keyVal = keyVal.toLowerCase();
|
|
2324
|
+
}
|
|
2325
|
+
result[colId] = keyVal;
|
|
2326
|
+
}
|
|
2327
|
+
}
|
|
2328
|
+
return result;
|
|
2329
|
+
};
|
|
2330
|
+
//returns true if value1 == value2
|
|
2331
|
+
AggregationSettings.prototype.strictCompare = function (value1, value2) {
|
|
2332
|
+
return value1 === value2;
|
|
2333
|
+
};
|
|
2334
|
+
//makes a case insensative comparision of two values and return true if there are equal
|
|
2335
|
+
AggregationSettings.prototype.caseInsensitiveCompare = function (value1, value2) {
|
|
2336
|
+
var val1 = (typeof value1 === 'string') ? value1.toLowerCase() : value1;
|
|
2337
|
+
var val2 = (typeof value2 === 'string') ? value2.toLowerCase() : value2;
|
|
2338
|
+
return val1 === val2;
|
|
2339
|
+
};
|
|
2289
2340
|
return AggregationSettings;
|
|
2290
2341
|
}());
|
|
2291
2342
|
|
|
2292
|
-
//# sourceMappingURL=
|
|
2343
|
+
//# sourceMappingURL=aggr_settings.js.map
|
|
2293
2344
|
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/data/data_column.js
|
|
2294
2345
|
|
|
2295
2346
|
|
|
@@ -2317,6 +2368,7 @@ var data_column_DataColumn = /** @class */ (function () {
|
|
|
2317
2368
|
this.groupFooterColumnTemplate = desc.gfct;
|
|
2318
2369
|
this.style = desc.style || {};
|
|
2319
2370
|
this.description = desc.description;
|
|
2371
|
+
this.calculatedWidth = 0;
|
|
2320
2372
|
}
|
|
2321
2373
|
return DataColumn;
|
|
2322
2374
|
}());
|
|
@@ -2356,9 +2408,10 @@ var data_column_DataColumnList = /** @class */ (function () {
|
|
|
2356
2408
|
.map(function (col, index) { return index; });
|
|
2357
2409
|
};
|
|
2358
2410
|
DataColumnList.prototype.put = function (index, col) {
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2411
|
+
if (index >= 0 && index < this.count) {
|
|
2412
|
+
this.items[index] = col;
|
|
2413
|
+
this.updateDateColumnIdx();
|
|
2414
|
+
}
|
|
2362
2415
|
};
|
|
2363
2416
|
DataColumnList.prototype.move = function (col, newIndex) {
|
|
2364
2417
|
var oldIndex = this.items.indexOf(col);
|
|
@@ -2368,8 +2421,12 @@ var data_column_DataColumnList = /** @class */ (function () {
|
|
|
2368
2421
|
}
|
|
2369
2422
|
};
|
|
2370
2423
|
DataColumnList.prototype.get = function (index) {
|
|
2371
|
-
|
|
2372
|
-
|
|
2424
|
+
if (index >= 0 && index < this.count) {
|
|
2425
|
+
return this.items[index];
|
|
2426
|
+
}
|
|
2427
|
+
else {
|
|
2428
|
+
return null;
|
|
2429
|
+
}
|
|
2373
2430
|
};
|
|
2374
2431
|
DataColumnList.prototype.getIndex = function (id) {
|
|
2375
2432
|
return this.mapper[id];
|
|
@@ -2453,16 +2510,23 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2453
2510
|
function EasyDataTable(options) {
|
|
2454
2511
|
this._chunkSize = 1000;
|
|
2455
2512
|
this._elasticChunks = false;
|
|
2456
|
-
|
|
2457
|
-
this.chunkMap = {};
|
|
2513
|
+
this.cachedRows = [];
|
|
2458
2514
|
this.total = 0;
|
|
2459
2515
|
this.loader = null;
|
|
2460
2516
|
this.needTotal = true;
|
|
2517
|
+
this.isInMemory = false;
|
|
2461
2518
|
options = options || {};
|
|
2462
2519
|
this._chunkSize = options.chunkSize || this._chunkSize;
|
|
2463
2520
|
this._elasticChunks = options.elasticChunks || this._elasticChunks;
|
|
2464
2521
|
this.loader = options.loader;
|
|
2522
|
+
if (typeof options.inMemory !== 'undefined') {
|
|
2523
|
+
this.isInMemory = options.inMemory;
|
|
2524
|
+
}
|
|
2525
|
+
if (this.isInMemory) {
|
|
2526
|
+
this.needTotal = false;
|
|
2527
|
+
}
|
|
2465
2528
|
this._columns = new data_column_DataColumnList();
|
|
2529
|
+
this.onUpdate = options.onUpdate;
|
|
2466
2530
|
if (options.columns) {
|
|
2467
2531
|
for (var _i = 0, _a = options.columns; _i < _a.length; _i++) {
|
|
2468
2532
|
var colDesc = _a[_i];
|
|
@@ -2493,7 +2557,7 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2493
2557
|
this._chunkSize = value;
|
|
2494
2558
|
this.total = 0;
|
|
2495
2559
|
this.needTotal = !this.elasticChunks;
|
|
2496
|
-
this.
|
|
2560
|
+
this.cachedRows = [];
|
|
2497
2561
|
},
|
|
2498
2562
|
enumerable: true,
|
|
2499
2563
|
configurable: true
|
|
@@ -2506,7 +2570,7 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2506
2570
|
this._elasticChunks = value;
|
|
2507
2571
|
this.total = 0;
|
|
2508
2572
|
this.needTotal = !this.elasticChunks;
|
|
2509
|
-
this.
|
|
2573
|
+
this.cachedRows = [];
|
|
2510
2574
|
},
|
|
2511
2575
|
enumerable: true,
|
|
2512
2576
|
configurable: true
|
|
@@ -2534,22 +2598,12 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2534
2598
|
endIndex = this.total;
|
|
2535
2599
|
}
|
|
2536
2600
|
}
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
var allChunksCached = true;
|
|
2540
|
-
for (var i = lbChunk; i <= ubChunk; i++) {
|
|
2541
|
-
if (!this.chunkMap[i]) {
|
|
2542
|
-
allChunksCached = false;
|
|
2543
|
-
break;
|
|
2544
|
-
}
|
|
2601
|
+
if (this.isInMemory && endIndex > this.cachedRows.length) {
|
|
2602
|
+
endIndex = this.cachedRows.length;
|
|
2545
2603
|
}
|
|
2604
|
+
var allChunksCached = endIndex <= this.cachedRows.length;
|
|
2546
2605
|
if (allChunksCached) {
|
|
2547
|
-
|
|
2548
|
-
for (var i = lbChunk; i <= ubChunk; i++) {
|
|
2549
|
-
resultArr = resultArr.concat(this.chunkMap[i].rows);
|
|
2550
|
-
}
|
|
2551
|
-
var firstChunkOffset = this.chunkMap[lbChunk].offset;
|
|
2552
|
-
return Promise.resolve(resultArr.slice(fromIndex - firstChunkOffset, endIndex - firstChunkOffset));
|
|
2606
|
+
return Promise.resolve(this.cachedRows.slice(fromIndex, endIndex));
|
|
2553
2607
|
}
|
|
2554
2608
|
//if loader is not defined
|
|
2555
2609
|
if (!this.loader) {
|
|
@@ -2560,53 +2614,34 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2560
2614
|
if (this.needTotal) {
|
|
2561
2615
|
this.needTotal = false;
|
|
2562
2616
|
}
|
|
2563
|
-
var
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2617
|
+
var offset = this.cachedRows.length;
|
|
2618
|
+
var limit = endIndex - offset;
|
|
2619
|
+
if (limit < this._chunkSize) {
|
|
2620
|
+
limit = this._chunkSize;
|
|
2621
|
+
}
|
|
2622
|
+
var resultPromise = this.loader.loadChunk({
|
|
2623
|
+
offset: offset,
|
|
2568
2624
|
limit: limit,
|
|
2569
2625
|
needTotal: needTotal
|
|
2570
2626
|
})
|
|
2571
2627
|
.then(function (result) {
|
|
2572
|
-
var chunks = result.table.getCachedChunks();
|
|
2573
2628
|
if (needTotal) {
|
|
2574
2629
|
_this.total = result.total;
|
|
2575
|
-
if (endIndex > _this.total) {
|
|
2576
|
-
endIndex = _this.total;
|
|
2577
|
-
}
|
|
2578
2630
|
}
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
_this.chunkMap[index] = {
|
|
2583
|
-
offset: index * _this._chunkSize,
|
|
2584
|
-
rows: chunk.rows
|
|
2585
|
-
};
|
|
2586
|
-
index++;
|
|
2631
|
+
Array.prototype.push.apply(_this.cachedRows, result.table.getCachedRows());
|
|
2632
|
+
if (endIndex > _this.cachedRows.length) {
|
|
2633
|
+
endIndex = _this.cachedRows.length;
|
|
2587
2634
|
}
|
|
2588
2635
|
if (_this.elasticChunks) {
|
|
2589
2636
|
var count_1 = result.table.getCachedCount();
|
|
2590
|
-
if (count_1
|
|
2591
|
-
|
|
2592
|
-
if (count_1 === limit) {
|
|
2593
|
-
chunk.rows.splice(chunk.rows.length - 1, 1);
|
|
2594
|
-
if (chunk.rows.length == 0) {
|
|
2595
|
-
delete _this.chunkMap[index - 1];
|
|
2596
|
-
}
|
|
2597
|
-
}
|
|
2598
|
-
if (count_1 < limit) {
|
|
2599
|
-
_this.total = _this.getCachedCount();
|
|
2600
|
-
}
|
|
2637
|
+
if (count_1 < limit) {
|
|
2638
|
+
_this.total = _this.cachedRows.length;
|
|
2601
2639
|
}
|
|
2602
2640
|
}
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
resultArr = resultArr.concat(_this.chunkMap[i].rows);
|
|
2606
|
-
}
|
|
2607
|
-
var firstChunkOffset = _this.chunkMap[lbChunk].offset;
|
|
2608
|
-
return resultArr.slice(fromIndex - firstChunkOffset, endIndex - firstChunkOffset);
|
|
2641
|
+
_this.fireUpdated();
|
|
2642
|
+
return _this.cachedRows.slice(fromIndex, endIndex);
|
|
2609
2643
|
});
|
|
2644
|
+
return resultPromise;
|
|
2610
2645
|
};
|
|
2611
2646
|
EasyDataTable.prototype.getRow = function (index) {
|
|
2612
2647
|
return this.getRows({ offset: index, limit: 1 })
|
|
@@ -2618,16 +2653,16 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2618
2653
|
EasyDataTable.prototype.setTotal = function (total) {
|
|
2619
2654
|
this.total = total;
|
|
2620
2655
|
this.needTotal = false;
|
|
2621
|
-
this.chunkMap = {};
|
|
2622
2656
|
};
|
|
2623
2657
|
EasyDataTable.prototype.getCachedCount = function () {
|
|
2624
|
-
return this.
|
|
2658
|
+
return this.cachedRows.length;
|
|
2625
2659
|
};
|
|
2626
2660
|
EasyDataTable.prototype.clear = function () {
|
|
2627
2661
|
this.columns.clear();
|
|
2628
|
-
this.
|
|
2662
|
+
this.cachedRows = [];
|
|
2629
2663
|
this.total = 0;
|
|
2630
2664
|
this.needTotal = !this._elasticChunks;
|
|
2665
|
+
this.fireUpdated();
|
|
2631
2666
|
};
|
|
2632
2667
|
EasyDataTable.prototype.createRow = function (dataOrRow) {
|
|
2633
2668
|
var _this = this;
|
|
@@ -2658,60 +2693,33 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2658
2693
|
}
|
|
2659
2694
|
return null;
|
|
2660
2695
|
};
|
|
2661
|
-
EasyDataTable.prototype.addRow = function (
|
|
2696
|
+
EasyDataTable.prototype.addRow = function (rowOrValues) {
|
|
2662
2697
|
var newRow;
|
|
2663
|
-
if (Array.isArray(
|
|
2698
|
+
if (Array.isArray(rowOrValues)) {
|
|
2699
|
+
var values = rowOrValues;
|
|
2664
2700
|
var dateIdx = this._columns.getDateColumnIndexes();
|
|
2665
2701
|
if (dateIdx.length > 0) {
|
|
2666
2702
|
for (var _i = 0, dateIdx_1 = dateIdx; _i < dateIdx_1.length; _i++) {
|
|
2667
2703
|
var idx = dateIdx_1[_i];
|
|
2668
|
-
if (
|
|
2669
|
-
|
|
2704
|
+
if (values[idx]) {
|
|
2705
|
+
values[idx] = this.mapDate(values[idx], this._columns.get(idx).type);
|
|
2670
2706
|
}
|
|
2671
2707
|
}
|
|
2672
2708
|
}
|
|
2673
|
-
newRow = new DataRow(this._columns,
|
|
2709
|
+
newRow = new DataRow(this._columns, values);
|
|
2674
2710
|
}
|
|
2675
2711
|
else {
|
|
2676
|
-
newRow = this.createRow(
|
|
2677
|
-
}
|
|
2678
|
-
var lastChunk = this.getLastChunk();
|
|
2679
|
-
if (!lastChunk || lastChunk.rows.length >= this._chunkSize) {
|
|
2680
|
-
lastChunk = this.createChunk();
|
|
2712
|
+
newRow = this.createRow(rowOrValues);
|
|
2681
2713
|
}
|
|
2682
|
-
|
|
2714
|
+
this.cachedRows.push(newRow);
|
|
2683
2715
|
var cachedTotal = this.getCachedCount();
|
|
2684
2716
|
if (cachedTotal > this.total) {
|
|
2685
2717
|
this.total = cachedTotal;
|
|
2686
2718
|
}
|
|
2687
2719
|
return newRow;
|
|
2688
2720
|
};
|
|
2689
|
-
EasyDataTable.prototype.createChunk = function (index) {
|
|
2690
|
-
if (typeof index == 'undefined') {
|
|
2691
|
-
index = this.getLastChunkIndex() + 1;
|
|
2692
|
-
}
|
|
2693
|
-
var chunk = { offset: index * this._chunkSize, rows: [] };
|
|
2694
|
-
this.chunkMap[index] = chunk;
|
|
2695
|
-
return chunk;
|
|
2696
|
-
};
|
|
2697
|
-
EasyDataTable.prototype.getLastChunkIndex = function () {
|
|
2698
|
-
var keys = Object.keys(this.chunkMap);
|
|
2699
|
-
return keys.length > 0
|
|
2700
|
-
? parseInt(keys[keys.length - 1])
|
|
2701
|
-
: -1;
|
|
2702
|
-
};
|
|
2703
|
-
EasyDataTable.prototype.getLastChunk = function () {
|
|
2704
|
-
var index = this.getLastChunkIndex();
|
|
2705
|
-
return index > -1
|
|
2706
|
-
? this.chunkMap[index]
|
|
2707
|
-
: null;
|
|
2708
|
-
};
|
|
2709
2721
|
EasyDataTable.prototype.getCachedRows = function () {
|
|
2710
|
-
return this.
|
|
2711
|
-
.reduce(function (acc, v) { return acc.concat(v.rows); }, []);
|
|
2712
|
-
};
|
|
2713
|
-
EasyDataTable.prototype.getCachedChunks = function () {
|
|
2714
|
-
return Object.values(this.chunkMap);
|
|
2722
|
+
return this.cachedRows;
|
|
2715
2723
|
};
|
|
2716
2724
|
EasyDataTable.prototype.totalIsKnown = function () {
|
|
2717
2725
|
if (this.elasticChunks) {
|
|
@@ -2720,6 +2728,11 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2720
2728
|
}
|
|
2721
2729
|
return !this.needTotal;
|
|
2722
2730
|
};
|
|
2731
|
+
EasyDataTable.prototype.fireUpdated = function () {
|
|
2732
|
+
if (this.onUpdate) {
|
|
2733
|
+
this.onUpdate(this);
|
|
2734
|
+
}
|
|
2735
|
+
};
|
|
2723
2736
|
return EasyDataTable;
|
|
2724
2737
|
}());
|
|
2725
2738
|
|
|
@@ -2904,7 +2917,6 @@ i18n_i18n.resetLocales();
|
|
|
2904
2917
|
|
|
2905
2918
|
|
|
2906
2919
|
|
|
2907
|
-
//data
|
|
2908
2920
|
|
|
2909
2921
|
|
|
2910
2922
|
|
|
@@ -3152,6 +3164,7 @@ __webpack_require__.d(__webpack_exports__, "Operand", function() { return /* ree
|
|
|
3152
3164
|
__webpack_require__.d(__webpack_exports__, "EqValueEditor", function() { return /* reexport */ EqValueEditor; });
|
|
3153
3165
|
__webpack_require__.d(__webpack_exports__, "EqAction", function() { return /* reexport */ EqAction; });
|
|
3154
3166
|
__webpack_require__.d(__webpack_exports__, "EqModelLoader", function() { return /* reexport */ EqModelLoader; });
|
|
3167
|
+
__webpack_require__.d(__webpack_exports__, "InMemoryModelStorage", function() { return /* reexport */ model_storage_InMemoryModelStorage; });
|
|
3155
3168
|
__webpack_require__.d(__webpack_exports__, "BrowserQueryStorage", function() { return /* reexport */ query_storage_BrowserQueryStorage; });
|
|
3156
3169
|
__webpack_require__.d(__webpack_exports__, "EqContext", function() { return /* reexport */ context_EqContext; });
|
|
3157
3170
|
__webpack_require__.d(__webpack_exports__, "Widget", function() { return /* reexport */ widget_Widget; });
|
|
@@ -3746,7 +3759,7 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
3746
3759
|
};
|
|
3747
3760
|
|
|
3748
3761
|
/** Represents editor tags*/
|
|
3749
|
-
var EqEditorTag = __assign({}, public_api["d" /* EditorTag */], {
|
|
3762
|
+
var EqEditorTag = __assign(__assign({}, public_api["d" /* EditorTag */]), {
|
|
3750
3763
|
/** SqlList tag value */
|
|
3751
3764
|
SqlList: "SQLLIST",
|
|
3752
3765
|
/** SubQuery tag value */
|
|
@@ -5620,20 +5633,19 @@ var query_Query = /** @class */ (function () {
|
|
|
5620
5633
|
this.processQueryForAggregation();
|
|
5621
5634
|
var aggrCols = this.columns.filter(function (c) { return c.enabled
|
|
5622
5635
|
&& c.expr.tag == ExprTag.AggregateFunction; });
|
|
5623
|
-
// query contains aggregate columns
|
|
5624
|
-
if (aggrCols.length) {
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
}
|
|
5636
|
+
// // query contains aggregate columns
|
|
5637
|
+
// if (aggrCols.length) {
|
|
5638
|
+
// for (const col of aggrCols) {
|
|
5639
|
+
// const attr = this.model.getAttributeById(col.expr.args[0].value);
|
|
5640
|
+
// this.changeColumnType(col, ExprTag.EntityAttribute, {
|
|
5641
|
+
// caption: this.model.getAttributeText(attr, `{attr}`)
|
|
5642
|
+
// });
|
|
5643
|
+
// }
|
|
5644
|
+
// this.fireChangedEvent({
|
|
5645
|
+
// part: QueryChangePart.Columns,
|
|
5646
|
+
// wasModified: true
|
|
5647
|
+
// });
|
|
5648
|
+
// }
|
|
5637
5649
|
}
|
|
5638
5650
|
if (!this._enableAggregation) {
|
|
5639
5651
|
this.aggrSettings.clear();
|
|
@@ -5668,8 +5680,8 @@ var query_Query = /** @class */ (function () {
|
|
|
5668
5680
|
var colsToGroup = _this.columns.filter(function (c) { return c.enabled
|
|
5669
5681
|
&& c.expr.tag == ExprTag.EntityAttribute; });
|
|
5670
5682
|
var aggrsToAdd = [];
|
|
5671
|
-
for (var _i = 0,
|
|
5672
|
-
var col =
|
|
5683
|
+
for (var _i = 0, aggrCols_1 = aggrCols; _i < aggrCols_1.length; _i++) {
|
|
5684
|
+
var col = aggrCols_1[_i];
|
|
5673
5685
|
aggrsToAdd.push({ id: col.id, func: col.expr.func });
|
|
5674
5686
|
_this.changeColumnType(col, ExprTag.EntityAttribute);
|
|
5675
5687
|
}
|
|
@@ -7182,9 +7194,9 @@ var EqQueryFileLoader = /** @class */ (function () {
|
|
|
7182
7194
|
fileName = options.fileName
|
|
7183
7195
|
+ fileName.substring(fileName.lastIndexOf('.'));
|
|
7184
7196
|
}
|
|
7185
|
-
if (window.navigator
|
|
7197
|
+
if (window.navigator['msSaveOrOpenBlob']) {
|
|
7186
7198
|
// Internet Explorer
|
|
7187
|
-
window.navigator
|
|
7199
|
+
window.navigator['msSaveOrOpenBlob'](blob, fileName);
|
|
7188
7200
|
}
|
|
7189
7201
|
else {
|
|
7190
7202
|
var a = document.createElement("a");
|
|
@@ -7220,13 +7232,12 @@ var EqAggregatesContainer = /** @class */ (function () {
|
|
|
7220
7232
|
this.context = context;
|
|
7221
7233
|
this.levels = {};
|
|
7222
7234
|
}
|
|
7223
|
-
EqAggregatesContainer.prototype.
|
|
7235
|
+
EqAggregatesContainer.prototype.getAggregateData = function (level, groupKey) {
|
|
7224
7236
|
var _this = this;
|
|
7225
7237
|
return new Promise(function (resolve, reject) {
|
|
7226
|
-
var desc = _this.getLevelDesc(level);
|
|
7227
7238
|
var processFunc = function (data) {
|
|
7228
7239
|
// map values
|
|
7229
|
-
var keyStr =
|
|
7240
|
+
var keyStr = _this.groupKeyToStr(groupKey);
|
|
7230
7241
|
var value = data.get(keyStr);
|
|
7231
7242
|
if (value) {
|
|
7232
7243
|
resolve(value);
|
|
@@ -7235,33 +7246,43 @@ var EqAggregatesContainer = /** @class */ (function () {
|
|
|
7235
7246
|
reject("Can't find data for " + keyStr);
|
|
7236
7247
|
}
|
|
7237
7248
|
};
|
|
7238
|
-
|
|
7249
|
+
var desc = _this.getLevelDesc(level, false);
|
|
7250
|
+
if (desc && desc.data) {
|
|
7239
7251
|
processFunc(desc.data);
|
|
7240
7252
|
}
|
|
7241
7253
|
else {
|
|
7242
|
-
desc.
|
|
7254
|
+
desc.receivedCallbacks.push(processFunc);
|
|
7243
7255
|
}
|
|
7244
7256
|
});
|
|
7245
7257
|
};
|
|
7246
|
-
EqAggregatesContainer.prototype.
|
|
7247
|
-
var desc = this.getLevelDesc(level);
|
|
7258
|
+
EqAggregatesContainer.prototype.setAggregateData = function (level, data) {
|
|
7259
|
+
var desc = this.getLevelDesc(level, true);
|
|
7248
7260
|
desc.data = data;
|
|
7249
|
-
if (desc.
|
|
7250
|
-
for (var _i = 0, _a = desc.
|
|
7261
|
+
if (desc.receivedCallbacks) {
|
|
7262
|
+
for (var _i = 0, _a = desc.receivedCallbacks; _i < _a.length; _i++) {
|
|
7251
7263
|
var callback = _a[_i];
|
|
7252
7264
|
callback(desc.data);
|
|
7253
7265
|
}
|
|
7254
7266
|
}
|
|
7255
|
-
desc.
|
|
7267
|
+
desc.receivedCallbacks = [];
|
|
7256
7268
|
};
|
|
7257
|
-
EqAggregatesContainer.prototype.
|
|
7269
|
+
EqAggregatesContainer.prototype.updateAggregateData = function (level, groupKey, values) {
|
|
7270
|
+
var desc = this.getLevelDesc(level, true);
|
|
7271
|
+
var key = this.groupKeyToStr(groupKey);
|
|
7272
|
+
desc.data.set(key, values);
|
|
7273
|
+
};
|
|
7274
|
+
EqAggregatesContainer.prototype.groupKeyToStr = function (groupKey) {
|
|
7275
|
+
return JSON.stringify(groupKey);
|
|
7276
|
+
};
|
|
7277
|
+
EqAggregatesContainer.prototype.getLevelDesc = function (level, createIfNotExists) {
|
|
7258
7278
|
var desc = this.levels[level];
|
|
7259
|
-
if (!desc) {
|
|
7279
|
+
if (!desc && createIfNotExists) {
|
|
7260
7280
|
desc = {
|
|
7261
|
-
|
|
7281
|
+
receivedCallbacks: [],
|
|
7282
|
+
data: new Map()
|
|
7262
7283
|
};
|
|
7284
|
+
this.levels[level] = desc;
|
|
7263
7285
|
}
|
|
7264
|
-
this.levels[level] = desc;
|
|
7265
7286
|
return desc;
|
|
7266
7287
|
};
|
|
7267
7288
|
EqAggregatesContainer.prototype.clear = function () {
|
|
@@ -7294,18 +7315,23 @@ var DefaultAggregatesCalculator = /** @class */ (function () {
|
|
|
7294
7315
|
columns[i].enabled = false;
|
|
7295
7316
|
}
|
|
7296
7317
|
if (settings.hasGrandTotals()) {
|
|
7297
|
-
this.aggrs.
|
|
7318
|
+
this.aggrs.setAggregateData(0, new Map());
|
|
7298
7319
|
if (options.resultObtained)
|
|
7299
7320
|
options.resultObtained({}, 0);
|
|
7300
7321
|
}
|
|
7301
7322
|
var groups = settings.getGroups();
|
|
7302
7323
|
for (var level = 1; level <= groups.length && level <= options.maxLevel; level++) {
|
|
7303
|
-
this.aggrs.
|
|
7324
|
+
this.aggrs.setAggregateData(level, new Map());
|
|
7304
7325
|
if (options.resultObtained)
|
|
7305
7326
|
options.resultObtained({}, level);
|
|
7306
7327
|
}
|
|
7307
7328
|
return Promise.resolve();
|
|
7308
7329
|
};
|
|
7330
|
+
DefaultAggregatesCalculator.prototype.needRecalculation = function () {
|
|
7331
|
+
return true;
|
|
7332
|
+
};
|
|
7333
|
+
DefaultAggregatesCalculator.prototype.reset = function () {
|
|
7334
|
+
};
|
|
7309
7335
|
return DefaultAggregatesCalculator;
|
|
7310
7336
|
}());
|
|
7311
7337
|
|
|
@@ -7332,8 +7358,9 @@ var eq_services_EqServiceProvider = /** @class */ (function () {
|
|
|
7332
7358
|
this.queryFileLoader = null;
|
|
7333
7359
|
this.aggrCalculator = null;
|
|
7334
7360
|
this.httpClient = new public_api["f" /* HttpClient */]();
|
|
7335
|
-
this.httpClient.defaultHeaders['x-eqjs-version'] = '7.
|
|
7361
|
+
this.httpClient.defaultHeaders['x-eqjs-version'] = '7.2.0';
|
|
7336
7362
|
this.modelResolver = function (_) { return new data_model_DataModel(); };
|
|
7363
|
+
this.modelStorageResolver = null;
|
|
7337
7364
|
this.queryResolver = function (context) { return new query_Query(context.getModel()); };
|
|
7338
7365
|
this.modelLoaderResolver = function (context) { return new EqServerModelLoader(context); };
|
|
7339
7366
|
this.queryStorageResolver = function (context) { return new query_storage_BrowserQueryStorage(context); };
|
|
@@ -7344,6 +7371,7 @@ var eq_services_EqServiceProvider = /** @class */ (function () {
|
|
|
7344
7371
|
this.aggrCalculatoResolver = function (context) { return new DefaultAggregatesCalculator(context); };
|
|
7345
7372
|
}
|
|
7346
7373
|
EqServiceProvider.prototype.reset = function () {
|
|
7374
|
+
this.modelStorage = null;
|
|
7347
7375
|
this.modelLoader = null;
|
|
7348
7376
|
this.queryStorage = null;
|
|
7349
7377
|
this.querySynchronizer = null;
|
|
@@ -7372,6 +7400,15 @@ var eq_services_EqServiceProvider = /** @class */ (function () {
|
|
|
7372
7400
|
}
|
|
7373
7401
|
return this.modelLoader;
|
|
7374
7402
|
};
|
|
7403
|
+
EqServiceProvider.prototype.getModelStorage = function () {
|
|
7404
|
+
if (!this.modelStorage) {
|
|
7405
|
+
if (!this.modelStorageResolver) {
|
|
7406
|
+
throw 'ModelStorageResolver is not defined';
|
|
7407
|
+
}
|
|
7408
|
+
this.modelStorage = this.modelStorageResolver(this.context);
|
|
7409
|
+
}
|
|
7410
|
+
return this.modelStorage;
|
|
7411
|
+
};
|
|
7375
7412
|
EqServiceProvider.prototype.getQueryStorage = function () {
|
|
7376
7413
|
if (!this.queryStorage) {
|
|
7377
7414
|
if (!this.queryStorageResolver) {
|
|
@@ -7420,7 +7457,7 @@ var eq_services_EqServiceProvider = /** @class */ (function () {
|
|
|
7420
7457
|
EqServiceProvider.prototype.getAggregatesCalculator = function () {
|
|
7421
7458
|
if (!this.aggrCalculator) {
|
|
7422
7459
|
if (!this.aggrCalculatoResolver) {
|
|
7423
|
-
throw 'Resolver for
|
|
7460
|
+
throw 'Resolver for AggregatesCalculator is not defined';
|
|
7424
7461
|
}
|
|
7425
7462
|
this.aggrCalculator = this.aggrCalculatoResolver(this.context);
|
|
7426
7463
|
}
|
|
@@ -7435,6 +7472,9 @@ var eq_services_EqServiceProvider = /** @class */ (function () {
|
|
|
7435
7472
|
EqServiceProvider.prototype.registerModelLoaderResolver = function (resolver) {
|
|
7436
7473
|
this.modelLoaderResolver = resolver;
|
|
7437
7474
|
};
|
|
7475
|
+
EqServiceProvider.prototype.registerModelStorageResolver = function (resolver) {
|
|
7476
|
+
this.modelStorageResolver = resolver;
|
|
7477
|
+
};
|
|
7438
7478
|
EqServiceProvider.prototype.registerQueryStorageResolver = function (resolver) {
|
|
7439
7479
|
this.queryStorageResolver = resolver;
|
|
7440
7480
|
};
|
|
@@ -7469,7 +7509,6 @@ var eq_data_loader_EasyQueryDataLoader = /** @class */ (function () {
|
|
|
7469
7509
|
// different grids
|
|
7470
7510
|
this.dataLoadPromise = new Promise(function (resolve, reject) {
|
|
7471
7511
|
var fetchOptions = {
|
|
7472
|
-
skipAggr: true,
|
|
7473
7512
|
chunk: chunk,
|
|
7474
7513
|
success: function (result) {
|
|
7475
7514
|
var dataTable = new public_api["c" /* EasyDataTable */]({
|
|
@@ -7549,6 +7588,25 @@ var EqAction;
|
|
|
7549
7588
|
EqAction["UploadQueryFile"] = "UploadQueryFile";
|
|
7550
7589
|
})(EqAction || (EqAction = {}));
|
|
7551
7590
|
|
|
7591
|
+
// CONCATENATED MODULE: ./src/main/model_storage.ts
|
|
7592
|
+
|
|
7593
|
+
var model_storage_InMemoryModelStorage = /** @class */ (function () {
|
|
7594
|
+
function InMemoryModelStorage(models) {
|
|
7595
|
+
this.models = [];
|
|
7596
|
+
if (models) {
|
|
7597
|
+
public_api["l" /* utils */].assign(this.models, [], models);
|
|
7598
|
+
}
|
|
7599
|
+
}
|
|
7600
|
+
InMemoryModelStorage.prototype.getModels = function () {
|
|
7601
|
+
var _this = this;
|
|
7602
|
+
return new Promise(function (resolve, reject) {
|
|
7603
|
+
resolve(_this.models);
|
|
7604
|
+
});
|
|
7605
|
+
};
|
|
7606
|
+
return InMemoryModelStorage;
|
|
7607
|
+
}());
|
|
7608
|
+
|
|
7609
|
+
|
|
7552
7610
|
// CONCATENATED MODULE: ./src/main/action.ts
|
|
7553
7611
|
var EqActionResult;
|
|
7554
7612
|
(function (EqActionResult) {
|
|
@@ -7587,9 +7645,9 @@ var EqServerExporter = /** @class */ (function () {
|
|
|
7587
7645
|
var blob = new Blob([responseData]);
|
|
7588
7646
|
var filename = request.getXMLHttpRequest()
|
|
7589
7647
|
.getResponseHeader("Content-Disposition").match(/filename="(.*)"/)[1];
|
|
7590
|
-
if (window.navigator
|
|
7648
|
+
if (window.navigator['msSaveOrOpenBlob']) {
|
|
7591
7649
|
// Internet Explorer
|
|
7592
|
-
window.navigator
|
|
7650
|
+
window.navigator['msSaveOrOpenBlob'](blob, filename);
|
|
7593
7651
|
}
|
|
7594
7652
|
else {
|
|
7595
7653
|
var a = document.createElement("a");
|
|
@@ -7728,7 +7786,8 @@ var context_EqContext = /** @class */ (function () {
|
|
|
7728
7786
|
this.endpoints = new Map();
|
|
7729
7787
|
this.dataLoader = new eq_data_loader_EasyQueryDataLoader(this);
|
|
7730
7788
|
this.resultTable = new public_api["c" /* EasyDataTable */]({
|
|
7731
|
-
loader: this.dataLoader
|
|
7789
|
+
loader: this.dataLoader,
|
|
7790
|
+
onUpdate: this.onResultTableUpdate.bind(this)
|
|
7732
7791
|
});
|
|
7733
7792
|
this.resultTable.id = 'ResultTable';
|
|
7734
7793
|
this.errorHandlerId = this.addEventListener('error', function (context, status) {
|
|
@@ -7849,10 +7908,14 @@ var context_EqContext = /** @class */ (function () {
|
|
|
7849
7908
|
}
|
|
7850
7909
|
if (options.endpoint) {
|
|
7851
7910
|
this.baseEndpoint = options.endpoint;
|
|
7852
|
-
console.warn('The `endpoint` option is deprecated
|
|
7911
|
+
console.warn('The `endpoint` option is deprecated.\n'
|
|
7853
7912
|
+ 'Please use `context.useEndpoint(endpointURL)` function instead.');
|
|
7854
7913
|
}
|
|
7855
7914
|
this.setDefaultEndpoints(this.baseEndpoint);
|
|
7915
|
+
if (options.modelStorageResolver) {
|
|
7916
|
+
var eqServices = this.getServices();
|
|
7917
|
+
eqServices.registerModelStorageResolver(options.modelStorageResolver);
|
|
7918
|
+
}
|
|
7856
7919
|
this.loadQueryOnStart = false;
|
|
7857
7920
|
if (options.loadQueryOnStart) {
|
|
7858
7921
|
this.loadQueryOnStart = options.loadQueryOnStart;
|
|
@@ -8704,17 +8767,24 @@ var context_EqContext = /** @class */ (function () {
|
|
|
8704
8767
|
})) {
|
|
8705
8768
|
return;
|
|
8706
8769
|
}
|
|
8770
|
+
//just to support the old way of catching "group fetch" operation finish
|
|
8771
|
+
if (options.groupFetchSuccess) {
|
|
8772
|
+
this.afterGroupFetch = options.groupFetchSuccess;
|
|
8773
|
+
}
|
|
8707
8774
|
if (this.resultTable.elasticChunks) {
|
|
8708
8775
|
options.chunk.limit++;
|
|
8709
8776
|
}
|
|
8710
|
-
this.fetchDataChunk(context_assign({}, options, { success: function (result) {
|
|
8777
|
+
this.fetchDataChunk(context_assign(context_assign({}, options), { success: function (result) {
|
|
8711
8778
|
if (result.statement) {
|
|
8712
8779
|
_this.resultStatement = result.statement;
|
|
8713
8780
|
_this.refreshWidgets(WidgetGroup.Statement);
|
|
8714
8781
|
}
|
|
8782
|
+
var aggrCalculator = _this.getServices().getAggregatesCalculator();
|
|
8783
|
+
aggrCalculator.reset();
|
|
8715
8784
|
_this.resultContent = result;
|
|
8716
8785
|
if (result.resultSet) {
|
|
8717
8786
|
_this.resultTable.clear();
|
|
8787
|
+
_this.resultTable.id = _this.query.getId();
|
|
8718
8788
|
var resultSet = result.resultSet;
|
|
8719
8789
|
for (var _i = 0, _a = resultSet.cols; _i < _a.length; _i++) {
|
|
8720
8790
|
var col = _a[_i];
|
|
@@ -8736,6 +8806,7 @@ var context_EqContext = /** @class */ (function () {
|
|
|
8736
8806
|
? resultSet.rows.length
|
|
8737
8807
|
: 0;
|
|
8738
8808
|
}
|
|
8809
|
+
_this.resultTable.fireUpdated();
|
|
8739
8810
|
}
|
|
8740
8811
|
if (options.success) {
|
|
8741
8812
|
options.success(result);
|
|
@@ -8811,55 +8882,30 @@ var context_EqContext = /** @class */ (function () {
|
|
|
8811
8882
|
};
|
|
8812
8883
|
EqContext.prototype.fetchDataChunk = function (options) {
|
|
8813
8884
|
var _this = this;
|
|
8814
|
-
if (this.beforeFetchData) {
|
|
8815
|
-
this.beforeFetchData(this, options);
|
|
8816
|
-
}
|
|
8817
8885
|
var queryId = this.getQuery().getId();
|
|
8818
8886
|
var fetchOptions = options || {};
|
|
8819
8887
|
if (this.useStoredQueryOnFetch) {
|
|
8820
8888
|
fetchOptions.queryId = this.query.getId();
|
|
8821
8889
|
}
|
|
8890
|
+
if (this.beforeFetchData) {
|
|
8891
|
+
this.beforeFetchData(this, fetchOptions);
|
|
8892
|
+
}
|
|
8822
8893
|
this.startProcess({
|
|
8823
8894
|
action: EqAction.FetchData,
|
|
8824
8895
|
text: 'Fetching data for the query: ' + queryId
|
|
8825
8896
|
}, WidgetGroup.Result);
|
|
8826
8897
|
var dataFetcher = this.eqServices.getDataFetcher();
|
|
8827
|
-
dataFetcher.fetchData(
|
|
8898
|
+
dataFetcher.fetchData(fetchOptions)
|
|
8828
8899
|
.then(function (result) {
|
|
8829
8900
|
if (result.statement) {
|
|
8830
8901
|
_this.resultStatement = result.statement;
|
|
8831
8902
|
}
|
|
8832
8903
|
_this.resultContent = result;
|
|
8833
|
-
if (!options.skipAggr) {
|
|
8834
|
-
var aggrSettings = _this.query.getAggregationSettings();
|
|
8835
|
-
if (aggrSettings.needAggrCalculation()) {
|
|
8836
|
-
var calculator = _this.getServices().getAggregatesCalculator();
|
|
8837
|
-
calculator.calculate({
|
|
8838
|
-
maxLevel: aggrSettings.getGroups().length + 1,
|
|
8839
|
-
resultObtained: function (result, level) {
|
|
8840
|
-
if (options.groupFetchSucess) {
|
|
8841
|
-
options.groupFetchSucess(result);
|
|
8842
|
-
}
|
|
8843
|
-
},
|
|
8844
|
-
errorOccurred: function (error) {
|
|
8845
|
-
var errorMessage = "Data fetching error on group level " + error.level + " query. \n" + error.message;
|
|
8846
|
-
_this.throwError({
|
|
8847
|
-
action: EqAction.FetchData,
|
|
8848
|
-
text: errorMessage,
|
|
8849
|
-
sourceError: error
|
|
8850
|
-
});
|
|
8851
|
-
if (options.error) {
|
|
8852
|
-
options.error(errorMessage, EqAction.FetchData);
|
|
8853
|
-
}
|
|
8854
|
-
}
|
|
8855
|
-
});
|
|
8856
|
-
}
|
|
8857
|
-
}
|
|
8858
8904
|
// we need to call success callback before firing fetchData,
|
|
8859
8905
|
// because otherwise, it won't update the result table
|
|
8860
8906
|
// in the context before afterFetchData callback is called.
|
|
8861
|
-
if (
|
|
8862
|
-
|
|
8907
|
+
if (fetchOptions.success) {
|
|
8908
|
+
fetchOptions.success(result);
|
|
8863
8909
|
}
|
|
8864
8910
|
_this.fireEvent('fetchData');
|
|
8865
8911
|
_this.endProcess({
|
|
@@ -8876,11 +8922,34 @@ var context_EqContext = /** @class */ (function () {
|
|
|
8876
8922
|
text: errorMessage,
|
|
8877
8923
|
sourceError: error
|
|
8878
8924
|
}, WidgetGroup.Result);
|
|
8879
|
-
if (
|
|
8880
|
-
|
|
8925
|
+
if (fetchOptions.error) {
|
|
8926
|
+
fetchOptions.error(errorMessage, EqAction.FetchData);
|
|
8881
8927
|
}
|
|
8882
8928
|
});
|
|
8883
8929
|
};
|
|
8930
|
+
EqContext.prototype.onResultTableUpdate = function () {
|
|
8931
|
+
var _this = this;
|
|
8932
|
+
var aggrSettings = this.query.getAggregationSettings();
|
|
8933
|
+
var calculator = this.getServices().getAggregatesCalculator();
|
|
8934
|
+
if (aggrSettings.needAggrCalculation() && calculator.needRecalculation()) {
|
|
8935
|
+
calculator.calculate({
|
|
8936
|
+
maxLevel: aggrSettings.getGroups().length + 1,
|
|
8937
|
+
resultObtained: function (result, level) {
|
|
8938
|
+
if (_this.afterGroupFetch) {
|
|
8939
|
+
_this.afterGroupFetch(result);
|
|
8940
|
+
}
|
|
8941
|
+
},
|
|
8942
|
+
errorOccurred: function (error) {
|
|
8943
|
+
var errorMessage = "Data fetching error on group level " + error.level + " query. \n" + error.message;
|
|
8944
|
+
_this.throwError({
|
|
8945
|
+
action: EqAction.FetchData,
|
|
8946
|
+
text: errorMessage,
|
|
8947
|
+
sourceError: error
|
|
8948
|
+
});
|
|
8949
|
+
}
|
|
8950
|
+
});
|
|
8951
|
+
}
|
|
8952
|
+
};
|
|
8884
8953
|
/**
|
|
8885
8954
|
* Fetches the data for a drill-down query (if defined) and processes the result.
|
|
8886
8955
|
* @param options
|
|
@@ -9180,6 +9249,7 @@ addEasyQueryCoreTexts();
|
|
|
9180
9249
|
|
|
9181
9250
|
|
|
9182
9251
|
|
|
9252
|
+
|
|
9183
9253
|
|
|
9184
9254
|
|
|
9185
9255
|
//for backward compatibility
|