@easyquery/core 7.1.3-beta01 → 7.2.0-rc03
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 +268 -213
- 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.js +2 -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 +44 -35
- package/dist/lib/main/context.js.map +1 -1
- package/dist/lib/main/context_options.d.ts +1 -2
- package/dist/lib/main/data_fetcher.d.ts +4 -1
- package/dist/lib/main/widget.d.ts +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 +19 -20
- package/dist/lib/query/query.js.map +1 -1
- package/dist/lib/query/query_column.d.ts +1 -1
- package/dist/lib/query/query_column.js.map +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/package.json +6 -7
- package/dist/bundles/easyquery.core.min.js.LICENSE.txt +0 -1
|
@@ -114,9 +114,9 @@ __webpack_require__.d(__webpack_exports__, "e", function() { return /* reexport
|
|
|
114
114
|
__webpack_require__.d(__webpack_exports__, "k", function() { return /* reexport */ i18n_i18n; });
|
|
115
115
|
__webpack_require__.d(__webpack_exports__, "l", function() { return /* reexport */ utils_utils; });
|
|
116
116
|
|
|
117
|
-
// UNUSED EXPORTS: EntityAttrKind, HttpMethod, HttpRequest, HttpResponseError, ColumnAlignment, DataColumn, DataColumnList, DataRow, EasyGuid, repeatString, reverseString, strEndsWith, combinePath
|
|
117
|
+
// UNUSED EXPORTS: EntityAttrKind, HttpMethod, HttpRequest, HttpResponseError, ColumnAlignment, DataColumn, DataColumnList, DataRow, EasyGuid, repeatString, reverseString, strEndsWith, combinePath, liquid
|
|
118
118
|
|
|
119
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
119
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/types/data_type.js
|
|
120
120
|
/** Represents the common types of the data. */
|
|
121
121
|
var DataType;
|
|
122
122
|
(function (DataType) {
|
|
@@ -163,7 +163,7 @@ var DataType;
|
|
|
163
163
|
DataType[DataType["Geography"] = 19] = "Geography";
|
|
164
164
|
})(DataType || (DataType = {}));
|
|
165
165
|
//# sourceMappingURL=data_type.js.map
|
|
166
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
166
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/types/entity_attr_kind.js
|
|
167
167
|
var EntityAttrKind;
|
|
168
168
|
(function (EntityAttrKind) {
|
|
169
169
|
EntityAttrKind[EntityAttrKind["Data"] = 0] = "Data";
|
|
@@ -171,7 +171,7 @@ var EntityAttrKind;
|
|
|
171
171
|
EntityAttrKind[EntityAttrKind["Lookup"] = 2] = "Lookup";
|
|
172
172
|
})(EntityAttrKind || (EntityAttrKind = {}));
|
|
173
173
|
//# sourceMappingURL=entity_attr_kind.js.map
|
|
174
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
174
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/types/editor_tag.js
|
|
175
175
|
var EditorTag = {
|
|
176
176
|
/** Unknown tag value */
|
|
177
177
|
Unknown: "Unknown",
|
|
@@ -187,7 +187,7 @@ var EditorTag = {
|
|
|
187
187
|
File: "FILE"
|
|
188
188
|
};
|
|
189
189
|
//# sourceMappingURL=editor_tag.js.map
|
|
190
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
190
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/http/http_method.js
|
|
191
191
|
var HttpMethod;
|
|
192
192
|
(function (HttpMethod) {
|
|
193
193
|
HttpMethod["Trace"] = "TRACE";
|
|
@@ -198,7 +198,7 @@ var HttpMethod;
|
|
|
198
198
|
HttpMethod["Delete"] = "DELETE";
|
|
199
199
|
})(HttpMethod || (HttpMethod = {}));
|
|
200
200
|
//# sourceMappingURL=http_method.js.map
|
|
201
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
201
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/http/http_request.js
|
|
202
202
|
var HttpRequest = /** @class */ (function () {
|
|
203
203
|
function HttpRequest(xhr, descriptor) {
|
|
204
204
|
this.xhr = xhr;
|
|
@@ -257,7 +257,7 @@ var HttpRequest = /** @class */ (function () {
|
|
|
257
257
|
}());
|
|
258
258
|
|
|
259
259
|
//# sourceMappingURL=http_request.js.map
|
|
260
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
260
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/utils/string_utils.js
|
|
261
261
|
function repeatString(str, times) {
|
|
262
262
|
var result = "";
|
|
263
263
|
for (var i = 0; i < times; i++) {
|
|
@@ -290,7 +290,7 @@ function combinePath(path1, path2) {
|
|
|
290
290
|
return result;
|
|
291
291
|
}
|
|
292
292
|
//# sourceMappingURL=string_utils.js.map
|
|
293
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
293
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/i18n/i18n.js
|
|
294
294
|
|
|
295
295
|
|
|
296
296
|
/**
|
|
@@ -759,14 +759,14 @@ var i18n_i18n;
|
|
|
759
759
|
}
|
|
760
760
|
})(i18n_i18n || (i18n_i18n = {}));
|
|
761
761
|
//# sourceMappingURL=i18n.js.map
|
|
762
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
762
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/utils/utils.js
|
|
763
763
|
|
|
764
764
|
|
|
765
765
|
|
|
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]);
|
|
@@ -1276,7 +1280,7 @@ var utils_utils;
|
|
|
1276
1280
|
utils.numberToStr = numberToStr;
|
|
1277
1281
|
})(utils_utils || (utils_utils = {}));
|
|
1278
1282
|
//# sourceMappingURL=utils.js.map
|
|
1279
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
1283
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/http/http_action_result.js
|
|
1280
1284
|
var HttpActionResult = /** @class */ (function () {
|
|
1281
1285
|
function HttpActionResult(request, promise) {
|
|
1282
1286
|
this.request = request;
|
|
@@ -1301,7 +1305,7 @@ var HttpActionResult = /** @class */ (function () {
|
|
|
1301
1305
|
}());
|
|
1302
1306
|
|
|
1303
1307
|
//# sourceMappingURL=http_action_result.js.map
|
|
1304
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
1308
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/http/http_client.js
|
|
1305
1309
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
1306
1310
|
var extendStatics = function (d, b) {
|
|
1307
1311
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -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
|
};
|
|
@@ -1401,7 +1405,7 @@ var http_client_HttpClient = /** @class */ (function () {
|
|
|
1401
1405
|
}
|
|
1402
1406
|
var responseContentType = xhr.getResponseHeader('Content-Type') || '';
|
|
1403
1407
|
var status = xhr.status;
|
|
1404
|
-
if (status >=
|
|
1408
|
+
if (status >= 400) {
|
|
1405
1409
|
var rtPromise = (xhr.responseType === 'arraybuffer'
|
|
1406
1410
|
|| xhr.responseType === 'blob')
|
|
1407
1411
|
? HttpClient.decodeArrayBuffer(xhr.response)
|
|
@@ -1443,7 +1447,7 @@ var http_client_HttpClient = /** @class */ (function () {
|
|
|
1443
1447
|
}());
|
|
1444
1448
|
|
|
1445
1449
|
//# sourceMappingURL=http_client.js.map
|
|
1446
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
1450
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/meta/meta_entity.js
|
|
1447
1451
|
|
|
1448
1452
|
|
|
1449
1453
|
|
|
@@ -1453,6 +1457,8 @@ var http_client_HttpClient = /** @class */ (function () {
|
|
|
1453
1457
|
var MetaEntity = /** @class */ (function () {
|
|
1454
1458
|
/** The default constructor. */
|
|
1455
1459
|
function MetaEntity(parent) {
|
|
1460
|
+
/** Returns false if this entity is read-only */
|
|
1461
|
+
this.isEditable = true;
|
|
1456
1462
|
this.name = "";
|
|
1457
1463
|
this.caption = "";
|
|
1458
1464
|
this.description = "";
|
|
@@ -1472,6 +1478,8 @@ var MetaEntity = /** @class */ (function () {
|
|
|
1472
1478
|
this.captionPlural = dto.namePlur;
|
|
1473
1479
|
this.caption = dto.name;
|
|
1474
1480
|
this.description = dto.desc;
|
|
1481
|
+
if (typeof (dto.ied) !== 'undefined')
|
|
1482
|
+
this.isEditable = dto.ied;
|
|
1475
1483
|
this.subEntities = new Array();
|
|
1476
1484
|
if (dto.ents) {
|
|
1477
1485
|
for (var i = 0; i < dto.ents.length; i++) {
|
|
@@ -1515,6 +1523,12 @@ var MetaEntity = /** @class */ (function () {
|
|
|
1515
1523
|
};
|
|
1516
1524
|
internalProcessEntity(this);
|
|
1517
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
|
+
};
|
|
1518
1532
|
return MetaEntity;
|
|
1519
1533
|
}());
|
|
1520
1534
|
|
|
@@ -1575,7 +1589,7 @@ var meta_entity_MetaEntityAttr = /** @class */ (function () {
|
|
|
1575
1589
|
}());
|
|
1576
1590
|
|
|
1577
1591
|
//# sourceMappingURL=meta_entity.js.map
|
|
1578
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
1592
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/meta/value_editor.js
|
|
1579
1593
|
|
|
1580
1594
|
|
|
1581
1595
|
/**
|
|
@@ -1641,7 +1655,7 @@ var value_editor_ValueEditor = /** @class */ (function () {
|
|
|
1641
1655
|
}());
|
|
1642
1656
|
|
|
1643
1657
|
//# sourceMappingURL=value_editor.js.map
|
|
1644
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
1658
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/meta/meta_data.js
|
|
1645
1659
|
|
|
1646
1660
|
|
|
1647
1661
|
|
|
@@ -2133,9 +2147,9 @@ var meta_data_MetaData = /** @class */ (function () {
|
|
|
2133
2147
|
}());
|
|
2134
2148
|
|
|
2135
2149
|
//# sourceMappingURL=meta_data.js.map
|
|
2136
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
2137
|
-
var
|
|
2138
|
-
|
|
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) {
|
|
2139
2153
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2140
2154
|
s = arguments[i];
|
|
2141
2155
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
@@ -2143,7 +2157,7 @@ var aggr_calculator_assign = (undefined && undefined.__assign) || function () {
|
|
|
2143
2157
|
}
|
|
2144
2158
|
return t;
|
|
2145
2159
|
};
|
|
2146
|
-
return
|
|
2160
|
+
return aggr_settings_assign.apply(this, arguments);
|
|
2147
2161
|
};
|
|
2148
2162
|
/**
|
|
2149
2163
|
* Defines aggregations settings for the current context.
|
|
@@ -2156,16 +2170,32 @@ var AggregationSettings = /** @class */ (function () {
|
|
|
2156
2170
|
this.groups = [];
|
|
2157
2171
|
this.useGrandTotals = false;
|
|
2158
2172
|
this.useRecordCount = false;
|
|
2159
|
-
this.
|
|
2173
|
+
this._caseSensitiveGroups = false;
|
|
2160
2174
|
this.COUNT_FIELD_NAME = 'GRPRECCNT';
|
|
2161
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
|
+
};
|
|
2162
2192
|
AggregationSettings.prototype.addGroup = function (settings) {
|
|
2163
2193
|
var cols = settings.columns || this.colStore.getColumnIds(settings.from, settings.to);
|
|
2164
2194
|
if (!this.colStore.validateColumns(cols))
|
|
2165
2195
|
throw "Invalid columns: " + cols;
|
|
2166
2196
|
if (this.hasColumnsInUse(cols))
|
|
2167
2197
|
throw "Can't add same columns to different groups/aggregates";
|
|
2168
|
-
this.groups.push(
|
|
2198
|
+
this.groups.push(aggr_settings_assign({ columns: cols }, settings));
|
|
2169
2199
|
return this;
|
|
2170
2200
|
};
|
|
2171
2201
|
AggregationSettings.prototype.addAggregateColumn = function (colIndexOrId, funcId) {
|
|
@@ -2190,7 +2220,7 @@ var AggregationSettings = /** @class */ (function () {
|
|
|
2190
2220
|
var cols = [];
|
|
2191
2221
|
var mappedGrops = this.groups.map(function (grp) {
|
|
2192
2222
|
cols = cols.concat(grp.columns);
|
|
2193
|
-
return
|
|
2223
|
+
return aggr_settings_assign(aggr_settings_assign({}, grp), { columns: Array.from(cols), aggregates: Array.from(_this.aggregates) });
|
|
2194
2224
|
});
|
|
2195
2225
|
return mappedGrops;
|
|
2196
2226
|
};
|
|
@@ -2282,11 +2312,36 @@ var AggregationSettings = /** @class */ (function () {
|
|
|
2282
2312
|
}
|
|
2283
2313
|
}
|
|
2284
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
|
+
};
|
|
2285
2340
|
return AggregationSettings;
|
|
2286
2341
|
}());
|
|
2287
2342
|
|
|
2288
|
-
//# sourceMappingURL=
|
|
2289
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
2343
|
+
//# sourceMappingURL=aggr_settings.js.map
|
|
2344
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/data/data_column.js
|
|
2290
2345
|
|
|
2291
2346
|
|
|
2292
2347
|
var ColumnAlignment;
|
|
@@ -2312,6 +2367,8 @@ var data_column_DataColumn = /** @class */ (function () {
|
|
|
2312
2367
|
this.displayFormat = desc.dfmt;
|
|
2313
2368
|
this.groupFooterColumnTemplate = desc.gfct;
|
|
2314
2369
|
this.style = desc.style || {};
|
|
2370
|
+
this.description = desc.description;
|
|
2371
|
+
this.calculatedWidth = 0;
|
|
2315
2372
|
}
|
|
2316
2373
|
return DataColumn;
|
|
2317
2374
|
}());
|
|
@@ -2351,9 +2408,10 @@ var data_column_DataColumnList = /** @class */ (function () {
|
|
|
2351
2408
|
.map(function (col, index) { return index; });
|
|
2352
2409
|
};
|
|
2353
2410
|
DataColumnList.prototype.put = function (index, col) {
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2411
|
+
if (index >= 0 && index < this.count) {
|
|
2412
|
+
this.items[index] = col;
|
|
2413
|
+
this.updateDateColumnIdx();
|
|
2414
|
+
}
|
|
2357
2415
|
};
|
|
2358
2416
|
DataColumnList.prototype.move = function (col, newIndex) {
|
|
2359
2417
|
var oldIndex = this.items.indexOf(col);
|
|
@@ -2363,8 +2421,12 @@ var data_column_DataColumnList = /** @class */ (function () {
|
|
|
2363
2421
|
}
|
|
2364
2422
|
};
|
|
2365
2423
|
DataColumnList.prototype.get = function (index) {
|
|
2366
|
-
|
|
2367
|
-
|
|
2424
|
+
if (index >= 0 && index < this.count) {
|
|
2425
|
+
return this.items[index];
|
|
2426
|
+
}
|
|
2427
|
+
else {
|
|
2428
|
+
return null;
|
|
2429
|
+
}
|
|
2368
2430
|
};
|
|
2369
2431
|
DataColumnList.prototype.getIndex = function (id) {
|
|
2370
2432
|
return this.mapper[id];
|
|
@@ -2393,7 +2455,7 @@ var data_column_DataColumnList = /** @class */ (function () {
|
|
|
2393
2455
|
}());
|
|
2394
2456
|
|
|
2395
2457
|
//# sourceMappingURL=data_column.js.map
|
|
2396
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
2458
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/data/data_row.js
|
|
2397
2459
|
var DataRow = /** @class */ (function () {
|
|
2398
2460
|
function DataRow(columns, values) {
|
|
2399
2461
|
this.columns = columns;
|
|
@@ -2439,7 +2501,7 @@ var DataRow = /** @class */ (function () {
|
|
|
2439
2501
|
}());
|
|
2440
2502
|
|
|
2441
2503
|
//# sourceMappingURL=data_row.js.map
|
|
2442
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
2504
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/data/easy_data_table.js
|
|
2443
2505
|
|
|
2444
2506
|
|
|
2445
2507
|
|
|
@@ -2448,16 +2510,23 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2448
2510
|
function EasyDataTable(options) {
|
|
2449
2511
|
this._chunkSize = 1000;
|
|
2450
2512
|
this._elasticChunks = false;
|
|
2451
|
-
|
|
2452
|
-
this.chunkMap = {};
|
|
2513
|
+
this.cachedRows = [];
|
|
2453
2514
|
this.total = 0;
|
|
2454
2515
|
this.loader = null;
|
|
2455
2516
|
this.needTotal = true;
|
|
2517
|
+
this.isInMemory = false;
|
|
2456
2518
|
options = options || {};
|
|
2457
2519
|
this._chunkSize = options.chunkSize || this._chunkSize;
|
|
2458
2520
|
this._elasticChunks = options.elasticChunks || this._elasticChunks;
|
|
2459
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
|
+
}
|
|
2460
2528
|
this._columns = new data_column_DataColumnList();
|
|
2529
|
+
this.onUpdate = options.onUpdate;
|
|
2461
2530
|
if (options.columns) {
|
|
2462
2531
|
for (var _i = 0, _a = options.columns; _i < _a.length; _i++) {
|
|
2463
2532
|
var colDesc = _a[_i];
|
|
@@ -2488,7 +2557,7 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2488
2557
|
this._chunkSize = value;
|
|
2489
2558
|
this.total = 0;
|
|
2490
2559
|
this.needTotal = !this.elasticChunks;
|
|
2491
|
-
this.
|
|
2560
|
+
this.cachedRows = [];
|
|
2492
2561
|
},
|
|
2493
2562
|
enumerable: true,
|
|
2494
2563
|
configurable: true
|
|
@@ -2501,7 +2570,7 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2501
2570
|
this._elasticChunks = value;
|
|
2502
2571
|
this.total = 0;
|
|
2503
2572
|
this.needTotal = !this.elasticChunks;
|
|
2504
|
-
this.
|
|
2573
|
+
this.cachedRows = [];
|
|
2505
2574
|
},
|
|
2506
2575
|
enumerable: true,
|
|
2507
2576
|
configurable: true
|
|
@@ -2529,22 +2598,12 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2529
2598
|
endIndex = this.total;
|
|
2530
2599
|
}
|
|
2531
2600
|
}
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
var allChunksCached = true;
|
|
2535
|
-
for (var i = lbChunk; i <= ubChunk; i++) {
|
|
2536
|
-
if (!this.chunkMap[i]) {
|
|
2537
|
-
allChunksCached = false;
|
|
2538
|
-
break;
|
|
2539
|
-
}
|
|
2601
|
+
if (this.isInMemory && endIndex > this.cachedRows.length) {
|
|
2602
|
+
endIndex = this.cachedRows.length;
|
|
2540
2603
|
}
|
|
2604
|
+
var allChunksCached = endIndex <= this.cachedRows.length;
|
|
2541
2605
|
if (allChunksCached) {
|
|
2542
|
-
|
|
2543
|
-
for (var i = lbChunk; i <= ubChunk; i++) {
|
|
2544
|
-
resultArr = resultArr.concat(this.chunkMap[i].rows);
|
|
2545
|
-
}
|
|
2546
|
-
var firstChunkOffset = this.chunkMap[lbChunk].offset;
|
|
2547
|
-
return Promise.resolve(resultArr.slice(fromIndex - firstChunkOffset, endIndex - firstChunkOffset));
|
|
2606
|
+
return Promise.resolve(this.cachedRows.slice(fromIndex, endIndex));
|
|
2548
2607
|
}
|
|
2549
2608
|
//if loader is not defined
|
|
2550
2609
|
if (!this.loader) {
|
|
@@ -2555,53 +2614,34 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2555
2614
|
if (this.needTotal) {
|
|
2556
2615
|
this.needTotal = false;
|
|
2557
2616
|
}
|
|
2558
|
-
var
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
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,
|
|
2563
2624
|
limit: limit,
|
|
2564
2625
|
needTotal: needTotal
|
|
2565
2626
|
})
|
|
2566
2627
|
.then(function (result) {
|
|
2567
|
-
var chunks = result.table.getCachedChunks();
|
|
2568
2628
|
if (needTotal) {
|
|
2569
2629
|
_this.total = result.total;
|
|
2570
|
-
if (endIndex > _this.total) {
|
|
2571
|
-
endIndex = _this.total;
|
|
2572
|
-
}
|
|
2573
2630
|
}
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
_this.chunkMap[index] = {
|
|
2578
|
-
offset: index * _this._chunkSize,
|
|
2579
|
-
rows: chunk.rows
|
|
2580
|
-
};
|
|
2581
|
-
index++;
|
|
2631
|
+
Array.prototype.push.apply(_this.cachedRows, result.table.getCachedRows());
|
|
2632
|
+
if (endIndex > _this.cachedRows.length) {
|
|
2633
|
+
endIndex = _this.cachedRows.length;
|
|
2582
2634
|
}
|
|
2583
2635
|
if (_this.elasticChunks) {
|
|
2584
2636
|
var count_1 = result.table.getCachedCount();
|
|
2585
|
-
if (count_1
|
|
2586
|
-
|
|
2587
|
-
if (count_1 === limit) {
|
|
2588
|
-
chunk.rows.splice(chunk.rows.length - 1, 1);
|
|
2589
|
-
if (chunk.rows.length == 0) {
|
|
2590
|
-
delete _this.chunkMap[index - 1];
|
|
2591
|
-
}
|
|
2592
|
-
}
|
|
2593
|
-
if (count_1 < limit) {
|
|
2594
|
-
_this.total = _this.getCachedCount();
|
|
2595
|
-
}
|
|
2637
|
+
if (count_1 < limit) {
|
|
2638
|
+
_this.total = _this.cachedRows.length;
|
|
2596
2639
|
}
|
|
2597
2640
|
}
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
resultArr = resultArr.concat(_this.chunkMap[i].rows);
|
|
2601
|
-
}
|
|
2602
|
-
var firstChunkOffset = _this.chunkMap[lbChunk].offset;
|
|
2603
|
-
return resultArr.slice(fromIndex - firstChunkOffset, endIndex - firstChunkOffset);
|
|
2641
|
+
_this.fireUpdated();
|
|
2642
|
+
return _this.cachedRows.slice(fromIndex, endIndex);
|
|
2604
2643
|
});
|
|
2644
|
+
return resultPromise;
|
|
2605
2645
|
};
|
|
2606
2646
|
EasyDataTable.prototype.getRow = function (index) {
|
|
2607
2647
|
return this.getRows({ offset: index, limit: 1 })
|
|
@@ -2613,16 +2653,16 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2613
2653
|
EasyDataTable.prototype.setTotal = function (total) {
|
|
2614
2654
|
this.total = total;
|
|
2615
2655
|
this.needTotal = false;
|
|
2616
|
-
this.chunkMap = {};
|
|
2617
2656
|
};
|
|
2618
2657
|
EasyDataTable.prototype.getCachedCount = function () {
|
|
2619
|
-
return this.
|
|
2658
|
+
return this.cachedRows.length;
|
|
2620
2659
|
};
|
|
2621
2660
|
EasyDataTable.prototype.clear = function () {
|
|
2622
2661
|
this.columns.clear();
|
|
2623
|
-
this.
|
|
2662
|
+
this.cachedRows = [];
|
|
2624
2663
|
this.total = 0;
|
|
2625
2664
|
this.needTotal = !this._elasticChunks;
|
|
2665
|
+
this.fireUpdated();
|
|
2626
2666
|
};
|
|
2627
2667
|
EasyDataTable.prototype.createRow = function (dataOrRow) {
|
|
2628
2668
|
var _this = this;
|
|
@@ -2653,60 +2693,33 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2653
2693
|
}
|
|
2654
2694
|
return null;
|
|
2655
2695
|
};
|
|
2656
|
-
EasyDataTable.prototype.addRow = function (
|
|
2696
|
+
EasyDataTable.prototype.addRow = function (rowOrValues) {
|
|
2657
2697
|
var newRow;
|
|
2658
|
-
if (Array.isArray(
|
|
2698
|
+
if (Array.isArray(rowOrValues)) {
|
|
2699
|
+
var values = rowOrValues;
|
|
2659
2700
|
var dateIdx = this._columns.getDateColumnIndexes();
|
|
2660
2701
|
if (dateIdx.length > 0) {
|
|
2661
2702
|
for (var _i = 0, dateIdx_1 = dateIdx; _i < dateIdx_1.length; _i++) {
|
|
2662
2703
|
var idx = dateIdx_1[_i];
|
|
2663
|
-
if (
|
|
2664
|
-
|
|
2704
|
+
if (values[idx]) {
|
|
2705
|
+
values[idx] = this.mapDate(values[idx], this._columns.get(idx).type);
|
|
2665
2706
|
}
|
|
2666
2707
|
}
|
|
2667
2708
|
}
|
|
2668
|
-
newRow = new DataRow(this._columns,
|
|
2709
|
+
newRow = new DataRow(this._columns, values);
|
|
2669
2710
|
}
|
|
2670
2711
|
else {
|
|
2671
|
-
newRow = this.createRow(
|
|
2712
|
+
newRow = this.createRow(rowOrValues);
|
|
2672
2713
|
}
|
|
2673
|
-
|
|
2674
|
-
if (!lastChunk || lastChunk.rows.length >= this._chunkSize) {
|
|
2675
|
-
lastChunk = this.createChunk();
|
|
2676
|
-
}
|
|
2677
|
-
lastChunk.rows.push(newRow);
|
|
2714
|
+
this.cachedRows.push(newRow);
|
|
2678
2715
|
var cachedTotal = this.getCachedCount();
|
|
2679
2716
|
if (cachedTotal > this.total) {
|
|
2680
2717
|
this.total = cachedTotal;
|
|
2681
2718
|
}
|
|
2682
2719
|
return newRow;
|
|
2683
2720
|
};
|
|
2684
|
-
EasyDataTable.prototype.createChunk = function (index) {
|
|
2685
|
-
if (typeof index == 'undefined') {
|
|
2686
|
-
index = this.getLastChunkIndex() + 1;
|
|
2687
|
-
}
|
|
2688
|
-
var chunk = { offset: index * this._chunkSize, rows: [] };
|
|
2689
|
-
this.chunkMap[index] = chunk;
|
|
2690
|
-
return chunk;
|
|
2691
|
-
};
|
|
2692
|
-
EasyDataTable.prototype.getLastChunkIndex = function () {
|
|
2693
|
-
var keys = Object.keys(this.chunkMap);
|
|
2694
|
-
return keys.length > 0
|
|
2695
|
-
? parseInt(keys[keys.length - 1])
|
|
2696
|
-
: -1;
|
|
2697
|
-
};
|
|
2698
|
-
EasyDataTable.prototype.getLastChunk = function () {
|
|
2699
|
-
var index = this.getLastChunkIndex();
|
|
2700
|
-
return index > -1
|
|
2701
|
-
? this.chunkMap[index]
|
|
2702
|
-
: null;
|
|
2703
|
-
};
|
|
2704
2721
|
EasyDataTable.prototype.getCachedRows = function () {
|
|
2705
|
-
return this.
|
|
2706
|
-
.reduce(function (acc, v) { return acc.concat(v.rows); }, []);
|
|
2707
|
-
};
|
|
2708
|
-
EasyDataTable.prototype.getCachedChunks = function () {
|
|
2709
|
-
return Object.values(this.chunkMap);
|
|
2722
|
+
return this.cachedRows;
|
|
2710
2723
|
};
|
|
2711
2724
|
EasyDataTable.prototype.totalIsKnown = function () {
|
|
2712
2725
|
if (this.elasticChunks) {
|
|
@@ -2715,11 +2728,16 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2715
2728
|
}
|
|
2716
2729
|
return !this.needTotal;
|
|
2717
2730
|
};
|
|
2731
|
+
EasyDataTable.prototype.fireUpdated = function () {
|
|
2732
|
+
if (this.onUpdate) {
|
|
2733
|
+
this.onUpdate(this);
|
|
2734
|
+
}
|
|
2735
|
+
};
|
|
2718
2736
|
return EasyDataTable;
|
|
2719
2737
|
}());
|
|
2720
2738
|
|
|
2721
2739
|
//# sourceMappingURL=easy_data_table.js.map
|
|
2722
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
2740
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/utils/easy_guid.js
|
|
2723
2741
|
/**
|
|
2724
2742
|
* EasyData representation of GUID.
|
|
2725
2743
|
*/
|
|
@@ -2740,7 +2758,7 @@ var EasyGuid = /** @class */ (function () {
|
|
|
2740
2758
|
}());
|
|
2741
2759
|
|
|
2742
2760
|
//# sourceMappingURL=easy_guid.js.map
|
|
2743
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
2761
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/event/event_emitter.js
|
|
2744
2762
|
|
|
2745
2763
|
/**
|
|
2746
2764
|
* The representation of event emitter.
|
|
@@ -2866,11 +2884,27 @@ var event_emitter_EventEmitter = /** @class */ (function () {
|
|
|
2866
2884
|
}());
|
|
2867
2885
|
|
|
2868
2886
|
//# sourceMappingURL=event_emitter.js.map
|
|
2869
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
2887
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/utils/liquid.js
|
|
2888
|
+
var liquid;
|
|
2889
|
+
(function (liquid) {
|
|
2890
|
+
function renderLiquidTemplate(template, vars) {
|
|
2891
|
+
var result = template;
|
|
2892
|
+
if (vars) {
|
|
2893
|
+
for (var v in vars) {
|
|
2894
|
+
var liquidVarRegexp = new RegExp('\{\{' + v + '\}\}', 'g');
|
|
2895
|
+
result = result.replace(liquidVarRegexp, vars[v]);
|
|
2896
|
+
}
|
|
2897
|
+
}
|
|
2898
|
+
return result;
|
|
2899
|
+
}
|
|
2900
|
+
liquid.renderLiquidTemplate = renderLiquidTemplate;
|
|
2901
|
+
})(liquid || (liquid = {}));
|
|
2902
|
+
//# sourceMappingURL=liquid.js.map
|
|
2903
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/i18n/load_default_locale_settings.js
|
|
2870
2904
|
|
|
2871
2905
|
i18n_i18n.resetLocales();
|
|
2872
2906
|
//# sourceMappingURL=load_default_locale_settings.js.map
|
|
2873
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
2907
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/public_api.js
|
|
2874
2908
|
//types
|
|
2875
2909
|
|
|
2876
2910
|
|
|
@@ -2883,7 +2917,6 @@ i18n_i18n.resetLocales();
|
|
|
2883
2917
|
|
|
2884
2918
|
|
|
2885
2919
|
|
|
2886
|
-
//data
|
|
2887
2920
|
|
|
2888
2921
|
|
|
2889
2922
|
|
|
@@ -2897,6 +2930,7 @@ i18n_i18n.resetLocales();
|
|
|
2897
2930
|
|
|
2898
2931
|
|
|
2899
2932
|
|
|
2933
|
+
|
|
2900
2934
|
if (typeof Object.values !== 'function') {
|
|
2901
2935
|
Object.values = function (obj) {
|
|
2902
2936
|
return Object.keys(obj).map(function (key) { return obj[key]; });
|
|
@@ -3152,7 +3186,7 @@ __webpack_require__.d(__webpack_exports__, "FormatParser", function() { return /
|
|
|
3152
3186
|
__webpack_require__.d(__webpack_exports__, "versionInfo", function() { return /* reexport */ versionInfo; });
|
|
3153
3187
|
__webpack_require__.d(__webpack_exports__, "i18n", function() { return /* reexport */ public_api["k" /* i18n */]; });
|
|
3154
3188
|
|
|
3155
|
-
// EXTERNAL MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
3189
|
+
// EXTERNAL MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/public_api.js + 21 modules
|
|
3156
3190
|
var public_api = __webpack_require__(0);
|
|
3157
3191
|
|
|
3158
3192
|
// CONCATENATED MODULE: ./src/utils/format_parser.ts
|
|
@@ -3724,7 +3758,7 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
3724
3758
|
};
|
|
3725
3759
|
|
|
3726
3760
|
/** Represents editor tags*/
|
|
3727
|
-
var EqEditorTag = __assign({}, public_api["d" /* EditorTag */], {
|
|
3761
|
+
var EqEditorTag = __assign(__assign({}, public_api["d" /* EditorTag */]), {
|
|
3728
3762
|
/** SqlList tag value */
|
|
3729
3763
|
SqlList: "SQLLIST",
|
|
3730
3764
|
/** SubQuery tag value */
|
|
@@ -5598,20 +5632,19 @@ var query_Query = /** @class */ (function () {
|
|
|
5598
5632
|
this.processQueryForAggregation();
|
|
5599
5633
|
var aggrCols = this.columns.filter(function (c) { return c.enabled
|
|
5600
5634
|
&& c.expr.tag == ExprTag.AggregateFunction; });
|
|
5601
|
-
// query contains aggregate columns
|
|
5602
|
-
if (aggrCols.length) {
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
}
|
|
5635
|
+
// // query contains aggregate columns
|
|
5636
|
+
// if (aggrCols.length) {
|
|
5637
|
+
// for (const col of aggrCols) {
|
|
5638
|
+
// const attr = this.model.getAttributeById(col.expr.args[0].value);
|
|
5639
|
+
// this.changeColumnType(col, ExprTag.EntityAttribute, {
|
|
5640
|
+
// caption: this.model.getAttributeText(attr, `{attr}`)
|
|
5641
|
+
// });
|
|
5642
|
+
// }
|
|
5643
|
+
// this.fireChangedEvent({
|
|
5644
|
+
// part: QueryChangePart.Columns,
|
|
5645
|
+
// wasModified: true
|
|
5646
|
+
// });
|
|
5647
|
+
// }
|
|
5615
5648
|
}
|
|
5616
5649
|
if (!this._enableAggregation) {
|
|
5617
5650
|
this.aggrSettings.clear();
|
|
@@ -5646,8 +5679,8 @@ var query_Query = /** @class */ (function () {
|
|
|
5646
5679
|
var colsToGroup = _this.columns.filter(function (c) { return c.enabled
|
|
5647
5680
|
&& c.expr.tag == ExprTag.EntityAttribute; });
|
|
5648
5681
|
var aggrsToAdd = [];
|
|
5649
|
-
for (var _i = 0,
|
|
5650
|
-
var col =
|
|
5682
|
+
for (var _i = 0, aggrCols_1 = aggrCols; _i < aggrCols_1.length; _i++) {
|
|
5683
|
+
var col = aggrCols_1[_i];
|
|
5651
5684
|
aggrsToAdd.push({ id: col.id, func: col.expr.func });
|
|
5652
5685
|
_this.changeColumnType(col, ExprTag.EntityAttribute);
|
|
5653
5686
|
}
|
|
@@ -6399,12 +6432,12 @@ var query_Query = /** @class */ (function () {
|
|
|
6399
6432
|
if (column.isJustSorted())
|
|
6400
6433
|
return;
|
|
6401
6434
|
args = args || {};
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6435
|
+
column.caption = (typeof args.caption !== 'undefined')
|
|
6436
|
+
? args.caption
|
|
6437
|
+
: '';
|
|
6405
6438
|
if (tag === ExprTag.AggregateFunction) {
|
|
6406
6439
|
if (!args.funcId)
|
|
6407
|
-
throw Error("
|
|
6440
|
+
throw Error('"funcId" argument is not defined');
|
|
6408
6441
|
if (column.expr.tag == ExprTag.AggregateFunction) {
|
|
6409
6442
|
column.expr.func = args.funcId;
|
|
6410
6443
|
return;
|
|
@@ -7160,9 +7193,9 @@ var EqQueryFileLoader = /** @class */ (function () {
|
|
|
7160
7193
|
fileName = options.fileName
|
|
7161
7194
|
+ fileName.substring(fileName.lastIndexOf('.'));
|
|
7162
7195
|
}
|
|
7163
|
-
if (window.navigator
|
|
7196
|
+
if (window.navigator['msSaveOrOpenBlob']) {
|
|
7164
7197
|
// Internet Explorer
|
|
7165
|
-
window.navigator
|
|
7198
|
+
window.navigator['msSaveOrOpenBlob'](blob, fileName);
|
|
7166
7199
|
}
|
|
7167
7200
|
else {
|
|
7168
7201
|
var a = document.createElement("a");
|
|
@@ -7198,13 +7231,12 @@ var EqAggregatesContainer = /** @class */ (function () {
|
|
|
7198
7231
|
this.context = context;
|
|
7199
7232
|
this.levels = {};
|
|
7200
7233
|
}
|
|
7201
|
-
EqAggregatesContainer.prototype.
|
|
7234
|
+
EqAggregatesContainer.prototype.getAggregateData = function (level, groupKey) {
|
|
7202
7235
|
var _this = this;
|
|
7203
7236
|
return new Promise(function (resolve, reject) {
|
|
7204
|
-
var desc = _this.getLevelDesc(level);
|
|
7205
7237
|
var processFunc = function (data) {
|
|
7206
7238
|
// map values
|
|
7207
|
-
var keyStr =
|
|
7239
|
+
var keyStr = _this.groupKeyToStr(groupKey);
|
|
7208
7240
|
var value = data.get(keyStr);
|
|
7209
7241
|
if (value) {
|
|
7210
7242
|
resolve(value);
|
|
@@ -7213,33 +7245,43 @@ var EqAggregatesContainer = /** @class */ (function () {
|
|
|
7213
7245
|
reject("Can't find data for " + keyStr);
|
|
7214
7246
|
}
|
|
7215
7247
|
};
|
|
7216
|
-
|
|
7248
|
+
var desc = _this.getLevelDesc(level, false);
|
|
7249
|
+
if (desc && desc.data) {
|
|
7217
7250
|
processFunc(desc.data);
|
|
7218
7251
|
}
|
|
7219
7252
|
else {
|
|
7220
|
-
desc.
|
|
7253
|
+
desc.receivedCallbacks.push(processFunc);
|
|
7221
7254
|
}
|
|
7222
7255
|
});
|
|
7223
7256
|
};
|
|
7224
|
-
EqAggregatesContainer.prototype.
|
|
7225
|
-
var desc = this.getLevelDesc(level);
|
|
7257
|
+
EqAggregatesContainer.prototype.setAggregateData = function (level, data) {
|
|
7258
|
+
var desc = this.getLevelDesc(level, true);
|
|
7226
7259
|
desc.data = data;
|
|
7227
|
-
if (desc.
|
|
7228
|
-
for (var _i = 0, _a = desc.
|
|
7260
|
+
if (desc.receivedCallbacks) {
|
|
7261
|
+
for (var _i = 0, _a = desc.receivedCallbacks; _i < _a.length; _i++) {
|
|
7229
7262
|
var callback = _a[_i];
|
|
7230
7263
|
callback(desc.data);
|
|
7231
7264
|
}
|
|
7232
7265
|
}
|
|
7233
|
-
desc.
|
|
7266
|
+
desc.receivedCallbacks = [];
|
|
7267
|
+
};
|
|
7268
|
+
EqAggregatesContainer.prototype.updateAggregateData = function (level, groupKey, values) {
|
|
7269
|
+
var desc = this.getLevelDesc(level, true);
|
|
7270
|
+
var key = this.groupKeyToStr(groupKey);
|
|
7271
|
+
desc.data.set(key, values);
|
|
7272
|
+
};
|
|
7273
|
+
EqAggregatesContainer.prototype.groupKeyToStr = function (groupKey) {
|
|
7274
|
+
return JSON.stringify(groupKey);
|
|
7234
7275
|
};
|
|
7235
|
-
EqAggregatesContainer.prototype.getLevelDesc = function (level) {
|
|
7276
|
+
EqAggregatesContainer.prototype.getLevelDesc = function (level, createIfNotExists) {
|
|
7236
7277
|
var desc = this.levels[level];
|
|
7237
|
-
if (!desc) {
|
|
7278
|
+
if (!desc && createIfNotExists) {
|
|
7238
7279
|
desc = {
|
|
7239
|
-
|
|
7280
|
+
receivedCallbacks: [],
|
|
7281
|
+
data: new Map()
|
|
7240
7282
|
};
|
|
7283
|
+
this.levels[level] = desc;
|
|
7241
7284
|
}
|
|
7242
|
-
this.levels[level] = desc;
|
|
7243
7285
|
return desc;
|
|
7244
7286
|
};
|
|
7245
7287
|
EqAggregatesContainer.prototype.clear = function () {
|
|
@@ -7272,18 +7314,23 @@ var DefaultAggregatesCalculator = /** @class */ (function () {
|
|
|
7272
7314
|
columns[i].enabled = false;
|
|
7273
7315
|
}
|
|
7274
7316
|
if (settings.hasGrandTotals()) {
|
|
7275
|
-
this.aggrs.
|
|
7317
|
+
this.aggrs.setAggregateData(0, new Map());
|
|
7276
7318
|
if (options.resultObtained)
|
|
7277
7319
|
options.resultObtained({}, 0);
|
|
7278
7320
|
}
|
|
7279
7321
|
var groups = settings.getGroups();
|
|
7280
7322
|
for (var level = 1; level <= groups.length && level <= options.maxLevel; level++) {
|
|
7281
|
-
this.aggrs.
|
|
7323
|
+
this.aggrs.setAggregateData(level, new Map());
|
|
7282
7324
|
if (options.resultObtained)
|
|
7283
7325
|
options.resultObtained({}, level);
|
|
7284
7326
|
}
|
|
7285
7327
|
return Promise.resolve();
|
|
7286
7328
|
};
|
|
7329
|
+
DefaultAggregatesCalculator.prototype.needRecalculation = function () {
|
|
7330
|
+
return true;
|
|
7331
|
+
};
|
|
7332
|
+
DefaultAggregatesCalculator.prototype.reset = function () {
|
|
7333
|
+
};
|
|
7287
7334
|
return DefaultAggregatesCalculator;
|
|
7288
7335
|
}());
|
|
7289
7336
|
|
|
@@ -7310,7 +7357,7 @@ var eq_services_EqServiceProvider = /** @class */ (function () {
|
|
|
7310
7357
|
this.queryFileLoader = null;
|
|
7311
7358
|
this.aggrCalculator = null;
|
|
7312
7359
|
this.httpClient = new public_api["f" /* HttpClient */]();
|
|
7313
|
-
this.httpClient.defaultHeaders['x-eqjs-version'] = '7.
|
|
7360
|
+
this.httpClient.defaultHeaders['x-eqjs-version'] = '7.2.0';
|
|
7314
7361
|
this.modelResolver = function (_) { return new data_model_DataModel(); };
|
|
7315
7362
|
this.queryResolver = function (context) { return new query_Query(context.getModel()); };
|
|
7316
7363
|
this.modelLoaderResolver = function (context) { return new EqServerModelLoader(context); };
|
|
@@ -7398,7 +7445,7 @@ var eq_services_EqServiceProvider = /** @class */ (function () {
|
|
|
7398
7445
|
EqServiceProvider.prototype.getAggregatesCalculator = function () {
|
|
7399
7446
|
if (!this.aggrCalculator) {
|
|
7400
7447
|
if (!this.aggrCalculatoResolver) {
|
|
7401
|
-
throw 'Resolver for
|
|
7448
|
+
throw 'Resolver for AggregatesCalculator is not defined';
|
|
7402
7449
|
}
|
|
7403
7450
|
this.aggrCalculator = this.aggrCalculatoResolver(this.context);
|
|
7404
7451
|
}
|
|
@@ -7447,7 +7494,6 @@ var eq_data_loader_EasyQueryDataLoader = /** @class */ (function () {
|
|
|
7447
7494
|
// different grids
|
|
7448
7495
|
this.dataLoadPromise = new Promise(function (resolve, reject) {
|
|
7449
7496
|
var fetchOptions = {
|
|
7450
|
-
skipAggr: true,
|
|
7451
7497
|
chunk: chunk,
|
|
7452
7498
|
success: function (result) {
|
|
7453
7499
|
var dataTable = new public_api["c" /* EasyDataTable */]({
|
|
@@ -7565,9 +7611,9 @@ var EqServerExporter = /** @class */ (function () {
|
|
|
7565
7611
|
var blob = new Blob([responseData]);
|
|
7566
7612
|
var filename = request.getXMLHttpRequest()
|
|
7567
7613
|
.getResponseHeader("Content-Disposition").match(/filename="(.*)"/)[1];
|
|
7568
|
-
if (window.navigator
|
|
7614
|
+
if (window.navigator['msSaveOrOpenBlob']) {
|
|
7569
7615
|
// Internet Explorer
|
|
7570
|
-
window.navigator
|
|
7616
|
+
window.navigator['msSaveOrOpenBlob'](blob, filename);
|
|
7571
7617
|
}
|
|
7572
7618
|
else {
|
|
7573
7619
|
var a = document.createElement("a");
|
|
@@ -7706,7 +7752,8 @@ var context_EqContext = /** @class */ (function () {
|
|
|
7706
7752
|
this.endpoints = new Map();
|
|
7707
7753
|
this.dataLoader = new eq_data_loader_EasyQueryDataLoader(this);
|
|
7708
7754
|
this.resultTable = new public_api["c" /* EasyDataTable */]({
|
|
7709
|
-
loader: this.dataLoader
|
|
7755
|
+
loader: this.dataLoader,
|
|
7756
|
+
onUpdate: this.onResultTableUpdate.bind(this)
|
|
7710
7757
|
});
|
|
7711
7758
|
this.resultTable.id = 'ResultTable';
|
|
7712
7759
|
this.errorHandlerId = this.addEventListener('error', function (context, status) {
|
|
@@ -7804,6 +7851,8 @@ var context_EqContext = /** @class */ (function () {
|
|
|
7804
7851
|
*/
|
|
7805
7852
|
EqContext.prototype.init = function (options) {
|
|
7806
7853
|
var _this = this;
|
|
7854
|
+
if (!this.servicesInitialized)
|
|
7855
|
+
this.initStart();
|
|
7807
7856
|
options = options || {};
|
|
7808
7857
|
if (typeof (options.debugMode) !== 'undefined') {
|
|
7809
7858
|
this.debugMode = options.debugMode;
|
|
@@ -8680,17 +8729,24 @@ var context_EqContext = /** @class */ (function () {
|
|
|
8680
8729
|
})) {
|
|
8681
8730
|
return;
|
|
8682
8731
|
}
|
|
8732
|
+
//just to support the old way of catching "group fetch" operation finish
|
|
8733
|
+
if (options.groupFetchSuccess) {
|
|
8734
|
+
this.afterGroupFetch = options.groupFetchSuccess;
|
|
8735
|
+
}
|
|
8683
8736
|
if (this.resultTable.elasticChunks) {
|
|
8684
8737
|
options.chunk.limit++;
|
|
8685
8738
|
}
|
|
8686
|
-
this.fetchDataChunk(context_assign({}, options, { success: function (result) {
|
|
8739
|
+
this.fetchDataChunk(context_assign(context_assign({}, options), { success: function (result) {
|
|
8687
8740
|
if (result.statement) {
|
|
8688
8741
|
_this.resultStatement = result.statement;
|
|
8689
8742
|
_this.refreshWidgets(WidgetGroup.Statement);
|
|
8690
8743
|
}
|
|
8744
|
+
var aggrCalculator = _this.getServices().getAggregatesCalculator();
|
|
8745
|
+
aggrCalculator.reset();
|
|
8691
8746
|
_this.resultContent = result;
|
|
8692
8747
|
if (result.resultSet) {
|
|
8693
8748
|
_this.resultTable.clear();
|
|
8749
|
+
_this.resultTable.id = _this.query.getId();
|
|
8694
8750
|
var resultSet = result.resultSet;
|
|
8695
8751
|
for (var _i = 0, _a = resultSet.cols; _i < _a.length; _i++) {
|
|
8696
8752
|
var col = _a[_i];
|
|
@@ -8712,6 +8768,7 @@ var context_EqContext = /** @class */ (function () {
|
|
|
8712
8768
|
? resultSet.rows.length
|
|
8713
8769
|
: 0;
|
|
8714
8770
|
}
|
|
8771
|
+
_this.resultTable.fireUpdated();
|
|
8715
8772
|
}
|
|
8716
8773
|
if (options.success) {
|
|
8717
8774
|
options.success(result);
|
|
@@ -8787,55 +8844,30 @@ var context_EqContext = /** @class */ (function () {
|
|
|
8787
8844
|
};
|
|
8788
8845
|
EqContext.prototype.fetchDataChunk = function (options) {
|
|
8789
8846
|
var _this = this;
|
|
8790
|
-
if (this.beforeFetchData) {
|
|
8791
|
-
this.beforeFetchData(this, options);
|
|
8792
|
-
}
|
|
8793
8847
|
var queryId = this.getQuery().getId();
|
|
8794
8848
|
var fetchOptions = options || {};
|
|
8795
8849
|
if (this.useStoredQueryOnFetch) {
|
|
8796
8850
|
fetchOptions.queryId = this.query.getId();
|
|
8797
8851
|
}
|
|
8852
|
+
if (this.beforeFetchData) {
|
|
8853
|
+
this.beforeFetchData(this, fetchOptions);
|
|
8854
|
+
}
|
|
8798
8855
|
this.startProcess({
|
|
8799
8856
|
action: EqAction.FetchData,
|
|
8800
8857
|
text: 'Fetching data for the query: ' + queryId
|
|
8801
8858
|
}, WidgetGroup.Result);
|
|
8802
8859
|
var dataFetcher = this.eqServices.getDataFetcher();
|
|
8803
|
-
dataFetcher.fetchData(
|
|
8860
|
+
dataFetcher.fetchData(fetchOptions)
|
|
8804
8861
|
.then(function (result) {
|
|
8805
8862
|
if (result.statement) {
|
|
8806
8863
|
_this.resultStatement = result.statement;
|
|
8807
8864
|
}
|
|
8808
8865
|
_this.resultContent = result;
|
|
8809
|
-
if (!options.skipAggr) {
|
|
8810
|
-
var aggrSettings = _this.query.getAggregationSettings();
|
|
8811
|
-
if (aggrSettings.needAggrCalculation()) {
|
|
8812
|
-
var calculator = _this.getServices().getAggregatesCalculator();
|
|
8813
|
-
calculator.calculate({
|
|
8814
|
-
maxLevel: aggrSettings.getGroups().length + 1,
|
|
8815
|
-
resultObtained: function (result, level) {
|
|
8816
|
-
if (options.groupFetchSucess) {
|
|
8817
|
-
options.groupFetchSucess(result);
|
|
8818
|
-
}
|
|
8819
|
-
},
|
|
8820
|
-
errorOccurred: function (error) {
|
|
8821
|
-
var errorMessage = "Data fetching error on group level " + error.level + " query. \n" + error.message;
|
|
8822
|
-
_this.throwError({
|
|
8823
|
-
action: EqAction.FetchData,
|
|
8824
|
-
text: errorMessage,
|
|
8825
|
-
sourceError: error
|
|
8826
|
-
});
|
|
8827
|
-
if (options.error) {
|
|
8828
|
-
options.error(errorMessage, EqAction.FetchData);
|
|
8829
|
-
}
|
|
8830
|
-
}
|
|
8831
|
-
});
|
|
8832
|
-
}
|
|
8833
|
-
}
|
|
8834
8866
|
// we need to call success callback before firing fetchData,
|
|
8835
8867
|
// because otherwise, it won't update the result table
|
|
8836
8868
|
// in the context before afterFetchData callback is called.
|
|
8837
|
-
if (
|
|
8838
|
-
|
|
8869
|
+
if (fetchOptions.success) {
|
|
8870
|
+
fetchOptions.success(result);
|
|
8839
8871
|
}
|
|
8840
8872
|
_this.fireEvent('fetchData');
|
|
8841
8873
|
_this.endProcess({
|
|
@@ -8852,11 +8884,34 @@ var context_EqContext = /** @class */ (function () {
|
|
|
8852
8884
|
text: errorMessage,
|
|
8853
8885
|
sourceError: error
|
|
8854
8886
|
}, WidgetGroup.Result);
|
|
8855
|
-
if (
|
|
8856
|
-
|
|
8887
|
+
if (fetchOptions.error) {
|
|
8888
|
+
fetchOptions.error(errorMessage, EqAction.FetchData);
|
|
8857
8889
|
}
|
|
8858
8890
|
});
|
|
8859
8891
|
};
|
|
8892
|
+
EqContext.prototype.onResultTableUpdate = function () {
|
|
8893
|
+
var _this = this;
|
|
8894
|
+
var aggrSettings = this.query.getAggregationSettings();
|
|
8895
|
+
var calculator = this.getServices().getAggregatesCalculator();
|
|
8896
|
+
if (aggrSettings.needAggrCalculation() && calculator.needRecalculation()) {
|
|
8897
|
+
calculator.calculate({
|
|
8898
|
+
maxLevel: aggrSettings.getGroups().length + 1,
|
|
8899
|
+
resultObtained: function (result, level) {
|
|
8900
|
+
if (_this.afterGroupFetch) {
|
|
8901
|
+
_this.afterGroupFetch(result);
|
|
8902
|
+
}
|
|
8903
|
+
},
|
|
8904
|
+
errorOccurred: function (error) {
|
|
8905
|
+
var errorMessage = "Data fetching error on group level " + error.level + " query. \n" + error.message;
|
|
8906
|
+
_this.throwError({
|
|
8907
|
+
action: EqAction.FetchData,
|
|
8908
|
+
text: errorMessage,
|
|
8909
|
+
sourceError: error
|
|
8910
|
+
});
|
|
8911
|
+
}
|
|
8912
|
+
});
|
|
8913
|
+
}
|
|
8914
|
+
};
|
|
8860
8915
|
/**
|
|
8861
8916
|
* Fetches the data for a drill-down query (if defined) and processes the result.
|
|
8862
8917
|
* @param options
|