@easyquery/core 7.1.2-rc07 → 7.2.0-rc01
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 +392 -304
- 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 +1 -1
- 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/dm/data_model.d.ts +19 -23
- package/dist/lib/dm/data_model.js +63 -47
- package/dist/lib/dm/data_model.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 +5 -1
- package/dist/lib/main/context.js +67 -57
- 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 +13 -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]);
|
|
@@ -1148,10 +1152,10 @@ var utils_utils;
|
|
|
1148
1152
|
return (621355968e9 + (new Date()).getTime() * 1e4);
|
|
1149
1153
|
}
|
|
1150
1154
|
function safeParseInt(str) {
|
|
1151
|
-
var
|
|
1152
|
-
if (
|
|
1153
|
-
throw "
|
|
1154
|
-
return
|
|
1155
|
+
var res = parseInt(str);
|
|
1156
|
+
if (isNaN(res))
|
|
1157
|
+
throw "\"" + str + "\" is not a valid number";
|
|
1158
|
+
return res;
|
|
1155
1159
|
}
|
|
1156
1160
|
function getDaysInMonth(month, year) {
|
|
1157
1161
|
return new Date(year, month + 1, 0).getDate();
|
|
@@ -1161,10 +1165,10 @@ var utils_utils;
|
|
|
1161
1165
|
function strToDateTime(value, format) {
|
|
1162
1166
|
if (!value || value.length == 0)
|
|
1163
1167
|
return new Date();
|
|
1164
|
-
var
|
|
1168
|
+
var normalizedValue = value.replace(/[^a-zA-Z0-9_]/g, '-');
|
|
1165
1169
|
var normalizedFormat = format.replace(/[^a-zA-Z0-9_]/g, '-');
|
|
1166
1170
|
var formatItems = normalizedFormat.split('-');
|
|
1167
|
-
var dateItems =
|
|
1171
|
+
var dateItems = normalizedValue.split('-');
|
|
1168
1172
|
var monthIndex = formatItems.indexOf("MM");
|
|
1169
1173
|
var dayIndex = formatItems.indexOf("dd");
|
|
1170
1174
|
var yearIndex = formatItems.indexOf("yyyy");
|
|
@@ -1173,41 +1177,58 @@ var utils_utils;
|
|
|
1173
1177
|
var secondsIndex = formatItems.indexOf("ss");
|
|
1174
1178
|
var today = new Date();
|
|
1175
1179
|
try {
|
|
1176
|
-
var year = yearIndex > -1 && yearIndex < dateItems.length
|
|
1177
|
-
|
|
1180
|
+
var year = yearIndex > -1 && yearIndex < dateItems.length
|
|
1181
|
+
? safeParseInt(dateItems[yearIndex])
|
|
1182
|
+
: today.getFullYear();
|
|
1183
|
+
var month = monthIndex > -1 && monthIndex < dateItems.length
|
|
1184
|
+
? safeParseInt(dateItems[monthIndex]) - 1
|
|
1185
|
+
: today.getMonth() - 1;
|
|
1178
1186
|
if (month > 11)
|
|
1179
1187
|
throw '';
|
|
1180
|
-
var day = dayIndex > -1 && dayIndex < dateItems.length
|
|
1188
|
+
var day = dayIndex > -1 && dayIndex < dateItems.length
|
|
1189
|
+
? safeParseInt(dateItems[dayIndex])
|
|
1190
|
+
: today.getDate();
|
|
1181
1191
|
if (day > getDaysInMonth(month, year))
|
|
1182
1192
|
throw '';
|
|
1183
|
-
var hour = hourIndex > -1 && hourIndex < dateItems.length
|
|
1193
|
+
var hour = hourIndex > -1 && hourIndex < dateItems.length
|
|
1194
|
+
? safeParseInt(dateItems[hourIndex])
|
|
1195
|
+
: 0;
|
|
1184
1196
|
if (hour > 23)
|
|
1185
1197
|
throw '';
|
|
1186
|
-
var minute = minutesIndex > -1 && minutesIndex < dateItems.length
|
|
1198
|
+
var minute = minutesIndex > -1 && minutesIndex < dateItems.length
|
|
1199
|
+
? safeParseInt(dateItems[minutesIndex])
|
|
1200
|
+
: 0;
|
|
1187
1201
|
if (minute > 59)
|
|
1188
1202
|
throw '';
|
|
1189
|
-
var second = secondsIndex > -1 && secondsIndex < dateItems.length
|
|
1203
|
+
var second = secondsIndex > -1 && secondsIndex < dateItems.length
|
|
1204
|
+
? safeParseInt(dateItems[secondsIndex])
|
|
1205
|
+
: 0;
|
|
1190
1206
|
if (second > 59)
|
|
1191
1207
|
throw '';
|
|
1192
1208
|
return new Date(year, month, day, hour, minute, second);
|
|
1193
1209
|
}
|
|
1194
1210
|
catch (_a) {
|
|
1195
|
-
throw "
|
|
1211
|
+
throw value + " is not a valid date.";
|
|
1196
1212
|
}
|
|
1197
1213
|
}
|
|
1198
1214
|
utils.strToDateTime = strToDateTime;
|
|
1199
1215
|
function strToTime(str) {
|
|
1200
1216
|
var timeItems = str.split(':');
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1217
|
+
try {
|
|
1218
|
+
var hour = timeItems.length > 0 ? safeParseInt(timeItems[0]) : 0;
|
|
1219
|
+
if (hour > 23)
|
|
1220
|
+
throw '';
|
|
1221
|
+
var minute = timeItems.length > 1 ? safeParseInt(timeItems[1]) : 0;
|
|
1222
|
+
if (minute > 59)
|
|
1223
|
+
throw '';
|
|
1224
|
+
var second = timeItems.length > 1 ? safeParseInt(timeItems[1]) : 0;
|
|
1225
|
+
if (second > 59)
|
|
1226
|
+
throw '';
|
|
1227
|
+
return new Date(0, 0, 0, hour, minute, second);
|
|
1228
|
+
}
|
|
1229
|
+
catch (_a) {
|
|
1230
|
+
throw str + " is not a valid time.";
|
|
1231
|
+
}
|
|
1211
1232
|
}
|
|
1212
1233
|
utils.strToTime = strToTime;
|
|
1213
1234
|
var DT_FORMAT_RGEX = /\[([^\]]+)]|y{4}|M{1,4}|d{1,2}|H{1,2}|h{1,2}|m{2}|s{2}|t{2}/g;
|
|
@@ -1259,7 +1280,7 @@ var utils_utils;
|
|
|
1259
1280
|
utils.numberToStr = numberToStr;
|
|
1260
1281
|
})(utils_utils || (utils_utils = {}));
|
|
1261
1282
|
//# sourceMappingURL=utils.js.map
|
|
1262
|
-
// 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
|
|
1263
1284
|
var HttpActionResult = /** @class */ (function () {
|
|
1264
1285
|
function HttpActionResult(request, promise) {
|
|
1265
1286
|
this.request = request;
|
|
@@ -1284,7 +1305,7 @@ var HttpActionResult = /** @class */ (function () {
|
|
|
1284
1305
|
}());
|
|
1285
1306
|
|
|
1286
1307
|
//# sourceMappingURL=http_action_result.js.map
|
|
1287
|
-
// 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
|
|
1288
1309
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
1289
1310
|
var extendStatics = function (d, b) {
|
|
1290
1311
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -1356,7 +1377,7 @@ var http_client_HttpClient = /** @class */ (function () {
|
|
|
1356
1377
|
var desc = {
|
|
1357
1378
|
method: method,
|
|
1358
1379
|
url: url,
|
|
1359
|
-
headers: __assign({}, this.defaultHeaders, options.headers || {}),
|
|
1380
|
+
headers: __assign(__assign({}, this.defaultHeaders), options.headers || {}),
|
|
1360
1381
|
queryParams: options.queryParams || {},
|
|
1361
1382
|
data: data
|
|
1362
1383
|
};
|
|
@@ -1384,7 +1405,7 @@ var http_client_HttpClient = /** @class */ (function () {
|
|
|
1384
1405
|
}
|
|
1385
1406
|
var responseContentType = xhr.getResponseHeader('Content-Type') || '';
|
|
1386
1407
|
var status = xhr.status;
|
|
1387
|
-
if (status >=
|
|
1408
|
+
if (status >= 400) {
|
|
1388
1409
|
var rtPromise = (xhr.responseType === 'arraybuffer'
|
|
1389
1410
|
|| xhr.responseType === 'blob')
|
|
1390
1411
|
? HttpClient.decodeArrayBuffer(xhr.response)
|
|
@@ -1426,7 +1447,7 @@ var http_client_HttpClient = /** @class */ (function () {
|
|
|
1426
1447
|
}());
|
|
1427
1448
|
|
|
1428
1449
|
//# sourceMappingURL=http_client.js.map
|
|
1429
|
-
// 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
|
|
1430
1451
|
|
|
1431
1452
|
|
|
1432
1453
|
|
|
@@ -1436,6 +1457,8 @@ var http_client_HttpClient = /** @class */ (function () {
|
|
|
1436
1457
|
var MetaEntity = /** @class */ (function () {
|
|
1437
1458
|
/** The default constructor. */
|
|
1438
1459
|
function MetaEntity(parent) {
|
|
1460
|
+
/** Returns false if this entity is read-only */
|
|
1461
|
+
this.isEditable = true;
|
|
1439
1462
|
this.name = "";
|
|
1440
1463
|
this.caption = "";
|
|
1441
1464
|
this.description = "";
|
|
@@ -1455,6 +1478,8 @@ var MetaEntity = /** @class */ (function () {
|
|
|
1455
1478
|
this.captionPlural = dto.namePlur;
|
|
1456
1479
|
this.caption = dto.name;
|
|
1457
1480
|
this.description = dto.desc;
|
|
1481
|
+
if (typeof (dto.ied) !== 'undefined')
|
|
1482
|
+
this.isEditable = dto.ied;
|
|
1458
1483
|
this.subEntities = new Array();
|
|
1459
1484
|
if (dto.ents) {
|
|
1460
1485
|
for (var i = 0; i < dto.ents.length; i++) {
|
|
@@ -1498,6 +1523,12 @@ var MetaEntity = /** @class */ (function () {
|
|
|
1498
1523
|
};
|
|
1499
1524
|
internalProcessEntity(this);
|
|
1500
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
|
+
};
|
|
1501
1532
|
return MetaEntity;
|
|
1502
1533
|
}());
|
|
1503
1534
|
|
|
@@ -1558,7 +1589,7 @@ var meta_entity_MetaEntityAttr = /** @class */ (function () {
|
|
|
1558
1589
|
}());
|
|
1559
1590
|
|
|
1560
1591
|
//# sourceMappingURL=meta_entity.js.map
|
|
1561
|
-
// 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
|
|
1562
1593
|
|
|
1563
1594
|
|
|
1564
1595
|
/**
|
|
@@ -1624,7 +1655,7 @@ var value_editor_ValueEditor = /** @class */ (function () {
|
|
|
1624
1655
|
}());
|
|
1625
1656
|
|
|
1626
1657
|
//# sourceMappingURL=value_editor.js.map
|
|
1627
|
-
// 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
|
|
1628
1659
|
|
|
1629
1660
|
|
|
1630
1661
|
|
|
@@ -2116,9 +2147,9 @@ var meta_data_MetaData = /** @class */ (function () {
|
|
|
2116
2147
|
}());
|
|
2117
2148
|
|
|
2118
2149
|
//# sourceMappingURL=meta_data.js.map
|
|
2119
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
2120
|
-
var
|
|
2121
|
-
|
|
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) {
|
|
2122
2153
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2123
2154
|
s = arguments[i];
|
|
2124
2155
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
@@ -2126,7 +2157,7 @@ var aggr_calculator_assign = (undefined && undefined.__assign) || function () {
|
|
|
2126
2157
|
}
|
|
2127
2158
|
return t;
|
|
2128
2159
|
};
|
|
2129
|
-
return
|
|
2160
|
+
return aggr_settings_assign.apply(this, arguments);
|
|
2130
2161
|
};
|
|
2131
2162
|
/**
|
|
2132
2163
|
* Defines aggregations settings for the current context.
|
|
@@ -2139,16 +2170,32 @@ var AggregationSettings = /** @class */ (function () {
|
|
|
2139
2170
|
this.groups = [];
|
|
2140
2171
|
this.useGrandTotals = false;
|
|
2141
2172
|
this.useRecordCount = false;
|
|
2142
|
-
this.
|
|
2173
|
+
this._caseSensitiveGroups = false;
|
|
2143
2174
|
this.COUNT_FIELD_NAME = 'GRPRECCNT';
|
|
2144
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
|
+
};
|
|
2145
2192
|
AggregationSettings.prototype.addGroup = function (settings) {
|
|
2146
2193
|
var cols = settings.columns || this.colStore.getColumnIds(settings.from, settings.to);
|
|
2147
2194
|
if (!this.colStore.validateColumns(cols))
|
|
2148
2195
|
throw "Invalid columns: " + cols;
|
|
2149
2196
|
if (this.hasColumnsInUse(cols))
|
|
2150
2197
|
throw "Can't add same columns to different groups/aggregates";
|
|
2151
|
-
this.groups.push(
|
|
2198
|
+
this.groups.push(aggr_settings_assign({ columns: cols }, settings));
|
|
2152
2199
|
return this;
|
|
2153
2200
|
};
|
|
2154
2201
|
AggregationSettings.prototype.addAggregateColumn = function (colIndexOrId, funcId) {
|
|
@@ -2173,7 +2220,7 @@ var AggregationSettings = /** @class */ (function () {
|
|
|
2173
2220
|
var cols = [];
|
|
2174
2221
|
var mappedGrops = this.groups.map(function (grp) {
|
|
2175
2222
|
cols = cols.concat(grp.columns);
|
|
2176
|
-
return
|
|
2223
|
+
return aggr_settings_assign(aggr_settings_assign({}, grp), { columns: Array.from(cols), aggregates: Array.from(_this.aggregates) });
|
|
2177
2224
|
});
|
|
2178
2225
|
return mappedGrops;
|
|
2179
2226
|
};
|
|
@@ -2265,11 +2312,36 @@ var AggregationSettings = /** @class */ (function () {
|
|
|
2265
2312
|
}
|
|
2266
2313
|
}
|
|
2267
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
|
+
};
|
|
2268
2340
|
return AggregationSettings;
|
|
2269
2341
|
}());
|
|
2270
2342
|
|
|
2271
|
-
//# sourceMappingURL=
|
|
2272
|
-
// 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
|
|
2273
2345
|
|
|
2274
2346
|
|
|
2275
2347
|
var ColumnAlignment;
|
|
@@ -2295,6 +2367,8 @@ var data_column_DataColumn = /** @class */ (function () {
|
|
|
2295
2367
|
this.displayFormat = desc.dfmt;
|
|
2296
2368
|
this.groupFooterColumnTemplate = desc.gfct;
|
|
2297
2369
|
this.style = desc.style || {};
|
|
2370
|
+
this.description = desc.description;
|
|
2371
|
+
this.calculatedWidth = 0;
|
|
2298
2372
|
}
|
|
2299
2373
|
return DataColumn;
|
|
2300
2374
|
}());
|
|
@@ -2334,9 +2408,10 @@ var data_column_DataColumnList = /** @class */ (function () {
|
|
|
2334
2408
|
.map(function (col, index) { return index; });
|
|
2335
2409
|
};
|
|
2336
2410
|
DataColumnList.prototype.put = function (index, col) {
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2411
|
+
if (index >= 0 && index < this.count) {
|
|
2412
|
+
this.items[index] = col;
|
|
2413
|
+
this.updateDateColumnIdx();
|
|
2414
|
+
}
|
|
2340
2415
|
};
|
|
2341
2416
|
DataColumnList.prototype.move = function (col, newIndex) {
|
|
2342
2417
|
var oldIndex = this.items.indexOf(col);
|
|
@@ -2346,8 +2421,12 @@ var data_column_DataColumnList = /** @class */ (function () {
|
|
|
2346
2421
|
}
|
|
2347
2422
|
};
|
|
2348
2423
|
DataColumnList.prototype.get = function (index) {
|
|
2349
|
-
|
|
2350
|
-
|
|
2424
|
+
if (index >= 0 && index < this.count) {
|
|
2425
|
+
return this.items[index];
|
|
2426
|
+
}
|
|
2427
|
+
else {
|
|
2428
|
+
return null;
|
|
2429
|
+
}
|
|
2351
2430
|
};
|
|
2352
2431
|
DataColumnList.prototype.getIndex = function (id) {
|
|
2353
2432
|
return this.mapper[id];
|
|
@@ -2376,7 +2455,7 @@ var data_column_DataColumnList = /** @class */ (function () {
|
|
|
2376
2455
|
}());
|
|
2377
2456
|
|
|
2378
2457
|
//# sourceMappingURL=data_column.js.map
|
|
2379
|
-
// 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
|
|
2380
2459
|
var DataRow = /** @class */ (function () {
|
|
2381
2460
|
function DataRow(columns, values) {
|
|
2382
2461
|
this.columns = columns;
|
|
@@ -2422,7 +2501,7 @@ var DataRow = /** @class */ (function () {
|
|
|
2422
2501
|
}());
|
|
2423
2502
|
|
|
2424
2503
|
//# sourceMappingURL=data_row.js.map
|
|
2425
|
-
// 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
|
|
2426
2505
|
|
|
2427
2506
|
|
|
2428
2507
|
|
|
@@ -2431,16 +2510,23 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2431
2510
|
function EasyDataTable(options) {
|
|
2432
2511
|
this._chunkSize = 1000;
|
|
2433
2512
|
this._elasticChunks = false;
|
|
2434
|
-
|
|
2435
|
-
this.chunkMap = {};
|
|
2513
|
+
this.cachedRows = [];
|
|
2436
2514
|
this.total = 0;
|
|
2437
2515
|
this.loader = null;
|
|
2438
2516
|
this.needTotal = true;
|
|
2517
|
+
this.isInMemory = false;
|
|
2439
2518
|
options = options || {};
|
|
2440
2519
|
this._chunkSize = options.chunkSize || this._chunkSize;
|
|
2441
2520
|
this._elasticChunks = options.elasticChunks || this._elasticChunks;
|
|
2442
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
|
+
}
|
|
2443
2528
|
this._columns = new data_column_DataColumnList();
|
|
2529
|
+
this.onUpdate = options.onUpdate;
|
|
2444
2530
|
if (options.columns) {
|
|
2445
2531
|
for (var _i = 0, _a = options.columns; _i < _a.length; _i++) {
|
|
2446
2532
|
var colDesc = _a[_i];
|
|
@@ -2471,7 +2557,7 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2471
2557
|
this._chunkSize = value;
|
|
2472
2558
|
this.total = 0;
|
|
2473
2559
|
this.needTotal = !this.elasticChunks;
|
|
2474
|
-
this.
|
|
2560
|
+
this.cachedRows = [];
|
|
2475
2561
|
},
|
|
2476
2562
|
enumerable: true,
|
|
2477
2563
|
configurable: true
|
|
@@ -2484,7 +2570,7 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2484
2570
|
this._elasticChunks = value;
|
|
2485
2571
|
this.total = 0;
|
|
2486
2572
|
this.needTotal = !this.elasticChunks;
|
|
2487
|
-
this.
|
|
2573
|
+
this.cachedRows = [];
|
|
2488
2574
|
},
|
|
2489
2575
|
enumerable: true,
|
|
2490
2576
|
configurable: true
|
|
@@ -2512,22 +2598,12 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2512
2598
|
endIndex = this.total;
|
|
2513
2599
|
}
|
|
2514
2600
|
}
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
var allChunksCached = true;
|
|
2518
|
-
for (var i = lbChunk; i <= ubChunk; i++) {
|
|
2519
|
-
if (!this.chunkMap[i]) {
|
|
2520
|
-
allChunksCached = false;
|
|
2521
|
-
break;
|
|
2522
|
-
}
|
|
2601
|
+
if (this.isInMemory && endIndex > this.cachedRows.length) {
|
|
2602
|
+
endIndex = this.cachedRows.length;
|
|
2523
2603
|
}
|
|
2604
|
+
var allChunksCached = endIndex <= this.cachedRows.length;
|
|
2524
2605
|
if (allChunksCached) {
|
|
2525
|
-
|
|
2526
|
-
for (var i = lbChunk; i <= ubChunk; i++) {
|
|
2527
|
-
resultArr = resultArr.concat(this.chunkMap[i].rows);
|
|
2528
|
-
}
|
|
2529
|
-
var firstChunkOffset = this.chunkMap[lbChunk].offset;
|
|
2530
|
-
return Promise.resolve(resultArr.slice(fromIndex - firstChunkOffset, endIndex - firstChunkOffset));
|
|
2606
|
+
return Promise.resolve(this.cachedRows.slice(fromIndex, endIndex));
|
|
2531
2607
|
}
|
|
2532
2608
|
//if loader is not defined
|
|
2533
2609
|
if (!this.loader) {
|
|
@@ -2538,53 +2614,34 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2538
2614
|
if (this.needTotal) {
|
|
2539
2615
|
this.needTotal = false;
|
|
2540
2616
|
}
|
|
2541
|
-
var
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
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,
|
|
2546
2624
|
limit: limit,
|
|
2547
2625
|
needTotal: needTotal
|
|
2548
2626
|
})
|
|
2549
2627
|
.then(function (result) {
|
|
2550
|
-
var chunks = result.table.getCachedChunks();
|
|
2551
2628
|
if (needTotal) {
|
|
2552
2629
|
_this.total = result.total;
|
|
2553
|
-
if (endIndex > _this.total) {
|
|
2554
|
-
endIndex = _this.total;
|
|
2555
|
-
}
|
|
2556
2630
|
}
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
_this.chunkMap[index] = {
|
|
2561
|
-
offset: index * _this._chunkSize,
|
|
2562
|
-
rows: chunk.rows
|
|
2563
|
-
};
|
|
2564
|
-
index++;
|
|
2631
|
+
Array.prototype.push.apply(_this.cachedRows, result.table.getCachedRows());
|
|
2632
|
+
if (endIndex > _this.cachedRows.length) {
|
|
2633
|
+
endIndex = _this.cachedRows.length;
|
|
2565
2634
|
}
|
|
2566
2635
|
if (_this.elasticChunks) {
|
|
2567
2636
|
var count_1 = result.table.getCachedCount();
|
|
2568
|
-
if (count_1
|
|
2569
|
-
|
|
2570
|
-
if (count_1 === limit) {
|
|
2571
|
-
chunk.rows.splice(chunk.rows.length - 1, 1);
|
|
2572
|
-
if (chunk.rows.length == 0) {
|
|
2573
|
-
delete _this.chunkMap[index - 1];
|
|
2574
|
-
}
|
|
2575
|
-
}
|
|
2576
|
-
if (count_1 < limit) {
|
|
2577
|
-
_this.total = _this.getCachedCount();
|
|
2578
|
-
}
|
|
2637
|
+
if (count_1 < limit) {
|
|
2638
|
+
_this.total = _this.cachedRows.length;
|
|
2579
2639
|
}
|
|
2580
2640
|
}
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
resultArr = resultArr.concat(_this.chunkMap[i].rows);
|
|
2584
|
-
}
|
|
2585
|
-
var firstChunkOffset = _this.chunkMap[lbChunk].offset;
|
|
2586
|
-
return resultArr.slice(fromIndex - firstChunkOffset, endIndex - firstChunkOffset);
|
|
2641
|
+
_this.fireUpdated();
|
|
2642
|
+
return _this.cachedRows.slice(fromIndex, endIndex);
|
|
2587
2643
|
});
|
|
2644
|
+
return resultPromise;
|
|
2588
2645
|
};
|
|
2589
2646
|
EasyDataTable.prototype.getRow = function (index) {
|
|
2590
2647
|
return this.getRows({ offset: index, limit: 1 })
|
|
@@ -2596,14 +2653,13 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2596
2653
|
EasyDataTable.prototype.setTotal = function (total) {
|
|
2597
2654
|
this.total = total;
|
|
2598
2655
|
this.needTotal = false;
|
|
2599
|
-
this.chunkMap = {};
|
|
2600
2656
|
};
|
|
2601
2657
|
EasyDataTable.prototype.getCachedCount = function () {
|
|
2602
|
-
return this.
|
|
2658
|
+
return this.cachedRows.length;
|
|
2603
2659
|
};
|
|
2604
2660
|
EasyDataTable.prototype.clear = function () {
|
|
2605
2661
|
this.columns.clear();
|
|
2606
|
-
this.
|
|
2662
|
+
this.cachedRows = [];
|
|
2607
2663
|
this.total = 0;
|
|
2608
2664
|
this.needTotal = !this._elasticChunks;
|
|
2609
2665
|
};
|
|
@@ -2636,60 +2692,33 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2636
2692
|
}
|
|
2637
2693
|
return null;
|
|
2638
2694
|
};
|
|
2639
|
-
EasyDataTable.prototype.addRow = function (
|
|
2695
|
+
EasyDataTable.prototype.addRow = function (rowOrValues) {
|
|
2640
2696
|
var newRow;
|
|
2641
|
-
if (Array.isArray(
|
|
2697
|
+
if (Array.isArray(rowOrValues)) {
|
|
2698
|
+
var values = rowOrValues;
|
|
2642
2699
|
var dateIdx = this._columns.getDateColumnIndexes();
|
|
2643
2700
|
if (dateIdx.length > 0) {
|
|
2644
2701
|
for (var _i = 0, dateIdx_1 = dateIdx; _i < dateIdx_1.length; _i++) {
|
|
2645
2702
|
var idx = dateIdx_1[_i];
|
|
2646
|
-
if (
|
|
2647
|
-
|
|
2703
|
+
if (values[idx]) {
|
|
2704
|
+
values[idx] = this.mapDate(values[idx], this._columns.get(idx).type);
|
|
2648
2705
|
}
|
|
2649
2706
|
}
|
|
2650
2707
|
}
|
|
2651
|
-
newRow = new DataRow(this._columns,
|
|
2708
|
+
newRow = new DataRow(this._columns, values);
|
|
2652
2709
|
}
|
|
2653
2710
|
else {
|
|
2654
|
-
newRow = this.createRow(
|
|
2711
|
+
newRow = this.createRow(rowOrValues);
|
|
2655
2712
|
}
|
|
2656
|
-
|
|
2657
|
-
if (!lastChunk || lastChunk.rows.length >= this._chunkSize) {
|
|
2658
|
-
lastChunk = this.createChunk();
|
|
2659
|
-
}
|
|
2660
|
-
lastChunk.rows.push(newRow);
|
|
2713
|
+
this.cachedRows.push(newRow);
|
|
2661
2714
|
var cachedTotal = this.getCachedCount();
|
|
2662
2715
|
if (cachedTotal > this.total) {
|
|
2663
2716
|
this.total = cachedTotal;
|
|
2664
2717
|
}
|
|
2665
2718
|
return newRow;
|
|
2666
2719
|
};
|
|
2667
|
-
EasyDataTable.prototype.createChunk = function (index) {
|
|
2668
|
-
if (typeof index == 'undefined') {
|
|
2669
|
-
index = this.getLastChunkIndex() + 1;
|
|
2670
|
-
}
|
|
2671
|
-
var chunk = { offset: index * this._chunkSize, rows: [] };
|
|
2672
|
-
this.chunkMap[index] = chunk;
|
|
2673
|
-
return chunk;
|
|
2674
|
-
};
|
|
2675
|
-
EasyDataTable.prototype.getLastChunkIndex = function () {
|
|
2676
|
-
var keys = Object.keys(this.chunkMap);
|
|
2677
|
-
return keys.length > 0
|
|
2678
|
-
? parseInt(keys[keys.length - 1])
|
|
2679
|
-
: -1;
|
|
2680
|
-
};
|
|
2681
|
-
EasyDataTable.prototype.getLastChunk = function () {
|
|
2682
|
-
var index = this.getLastChunkIndex();
|
|
2683
|
-
return index > -1
|
|
2684
|
-
? this.chunkMap[index]
|
|
2685
|
-
: null;
|
|
2686
|
-
};
|
|
2687
2720
|
EasyDataTable.prototype.getCachedRows = function () {
|
|
2688
|
-
return this.
|
|
2689
|
-
.reduce(function (acc, v) { return acc.concat(v.rows); }, []);
|
|
2690
|
-
};
|
|
2691
|
-
EasyDataTable.prototype.getCachedChunks = function () {
|
|
2692
|
-
return Object.values(this.chunkMap);
|
|
2721
|
+
return this.cachedRows;
|
|
2693
2722
|
};
|
|
2694
2723
|
EasyDataTable.prototype.totalIsKnown = function () {
|
|
2695
2724
|
if (this.elasticChunks) {
|
|
@@ -2698,11 +2727,16 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2698
2727
|
}
|
|
2699
2728
|
return !this.needTotal;
|
|
2700
2729
|
};
|
|
2730
|
+
EasyDataTable.prototype.fireUpdated = function () {
|
|
2731
|
+
if (this.onUpdate) {
|
|
2732
|
+
this.onUpdate(this);
|
|
2733
|
+
}
|
|
2734
|
+
};
|
|
2701
2735
|
return EasyDataTable;
|
|
2702
2736
|
}());
|
|
2703
2737
|
|
|
2704
2738
|
//# sourceMappingURL=easy_data_table.js.map
|
|
2705
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
2739
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/utils/easy_guid.js
|
|
2706
2740
|
/**
|
|
2707
2741
|
* EasyData representation of GUID.
|
|
2708
2742
|
*/
|
|
@@ -2723,7 +2757,7 @@ var EasyGuid = /** @class */ (function () {
|
|
|
2723
2757
|
}());
|
|
2724
2758
|
|
|
2725
2759
|
//# sourceMappingURL=easy_guid.js.map
|
|
2726
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
2760
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/event/event_emitter.js
|
|
2727
2761
|
|
|
2728
2762
|
/**
|
|
2729
2763
|
* The representation of event emitter.
|
|
@@ -2849,11 +2883,27 @@ var event_emitter_EventEmitter = /** @class */ (function () {
|
|
|
2849
2883
|
}());
|
|
2850
2884
|
|
|
2851
2885
|
//# sourceMappingURL=event_emitter.js.map
|
|
2852
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
2886
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/utils/liquid.js
|
|
2887
|
+
var liquid;
|
|
2888
|
+
(function (liquid) {
|
|
2889
|
+
function renderLiquidTemplate(template, vars) {
|
|
2890
|
+
var result = template;
|
|
2891
|
+
if (vars) {
|
|
2892
|
+
for (var v in vars) {
|
|
2893
|
+
var liquidVarRegexp = new RegExp('\{\{' + v + '\}\}', 'g');
|
|
2894
|
+
result = result.replace(liquidVarRegexp, vars[v]);
|
|
2895
|
+
}
|
|
2896
|
+
}
|
|
2897
|
+
return result;
|
|
2898
|
+
}
|
|
2899
|
+
liquid.renderLiquidTemplate = renderLiquidTemplate;
|
|
2900
|
+
})(liquid || (liquid = {}));
|
|
2901
|
+
//# sourceMappingURL=liquid.js.map
|
|
2902
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/i18n/load_default_locale_settings.js
|
|
2853
2903
|
|
|
2854
2904
|
i18n_i18n.resetLocales();
|
|
2855
2905
|
//# sourceMappingURL=load_default_locale_settings.js.map
|
|
2856
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
2906
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/public_api.js
|
|
2857
2907
|
//types
|
|
2858
2908
|
|
|
2859
2909
|
|
|
@@ -2866,7 +2916,6 @@ i18n_i18n.resetLocales();
|
|
|
2866
2916
|
|
|
2867
2917
|
|
|
2868
2918
|
|
|
2869
|
-
//data
|
|
2870
2919
|
|
|
2871
2920
|
|
|
2872
2921
|
|
|
@@ -2880,6 +2929,7 @@ i18n_i18n.resetLocales();
|
|
|
2880
2929
|
|
|
2881
2930
|
|
|
2882
2931
|
|
|
2932
|
+
|
|
2883
2933
|
if (typeof Object.values !== 'function') {
|
|
2884
2934
|
Object.values = function (obj) {
|
|
2885
2935
|
return Object.keys(obj).map(function (key) { return obj[key]; });
|
|
@@ -3135,7 +3185,7 @@ __webpack_require__.d(__webpack_exports__, "FormatParser", function() { return /
|
|
|
3135
3185
|
__webpack_require__.d(__webpack_exports__, "versionInfo", function() { return /* reexport */ versionInfo; });
|
|
3136
3186
|
__webpack_require__.d(__webpack_exports__, "i18n", function() { return /* reexport */ public_api["k" /* i18n */]; });
|
|
3137
3187
|
|
|
3138
|
-
// EXTERNAL MODULE: c:/azuredevops-agents/korzhdev/_work/
|
|
3188
|
+
// EXTERNAL MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/public_api.js + 21 modules
|
|
3139
3189
|
var public_api = __webpack_require__(0);
|
|
3140
3190
|
|
|
3141
3191
|
// CONCATENATED MODULE: ./src/utils/format_parser.ts
|
|
@@ -3707,7 +3757,7 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
3707
3757
|
};
|
|
3708
3758
|
|
|
3709
3759
|
/** Represents editor tags*/
|
|
3710
|
-
var EqEditorTag = __assign({}, public_api["d" /* EditorTag */], {
|
|
3760
|
+
var EqEditorTag = __assign(__assign({}, public_api["d" /* EditorTag */]), {
|
|
3711
3761
|
/** SqlList tag value */
|
|
3712
3762
|
SqlList: "SQLLIST",
|
|
3713
3763
|
/** SubQuery tag value */
|
|
@@ -3834,11 +3884,11 @@ var data_model_DataModel = /** @class */ (function (_super) {
|
|
|
3834
3884
|
_this.operators = new Array();
|
|
3835
3885
|
_this.rootEntity = new Entity();
|
|
3836
3886
|
_this.aggrFunctions = new Array();
|
|
3837
|
-
_this.dateMacros = ['
|
|
3838
|
-
'
|
|
3839
|
-
'
|
|
3840
|
-
'
|
|
3841
|
-
_this.timeMacros = ['
|
|
3887
|
+
_this.dateMacros = ['Today', 'Yesterday',
|
|
3888
|
+
'Tomorrow', 'FirstDayOfMonth', 'LastDayOfMonth',
|
|
3889
|
+
'FirstDayOfWeek', 'FirstDayOfYear', 'FirstDayOfNextWeek', 'FirstDayOfPrevMonth',
|
|
3890
|
+
'FirstDayOfNextMonth', 'FirstDayOfNextYear', 'FirstDayOfPrevYear', 'FirstDayOfPrevWeek'];
|
|
3891
|
+
_this.timeMacros = ['Now', 'HourStart', 'Midnight', 'Noon'];
|
|
3842
3892
|
_this.links = [];
|
|
3843
3893
|
return _this;
|
|
3844
3894
|
}
|
|
@@ -4567,16 +4617,51 @@ var data_model_DataModel = /** @class */ (function (_super) {
|
|
|
4567
4617
|
DataModel.prototype.getAggrFunctions = function () {
|
|
4568
4618
|
return this.aggrFunctions;
|
|
4569
4619
|
};
|
|
4620
|
+
/**
|
|
4621
|
+
* Checks wether macro value is date.
|
|
4622
|
+
* @param macroExpr The macro value.
|
|
4623
|
+
* @retruns `true` if the macro value is date, otherwise `false`.
|
|
4624
|
+
*/
|
|
4625
|
+
DataModel.prototype.isDateMacro = function (macroExpr, macroProcessor) {
|
|
4626
|
+
var match = macroExpr.match(/\${{?(.*?)}?}/);
|
|
4627
|
+
if (match != null) {
|
|
4628
|
+
var macroId = match[1];
|
|
4629
|
+
if (public_api["l" /* utils */].indexOfArrayItem(this.dateMacros, macroId) >= 0) {
|
|
4630
|
+
if (macroProcessor) {
|
|
4631
|
+
macroProcessor(macroId);
|
|
4632
|
+
}
|
|
4633
|
+
return true;
|
|
4634
|
+
}
|
|
4635
|
+
}
|
|
4636
|
+
return false;
|
|
4637
|
+
};
|
|
4638
|
+
/**
|
|
4639
|
+
* Checks whether the expression passed in the parameter is an time macro.
|
|
4640
|
+
* @param macroExpr The macro expression
|
|
4641
|
+
* @retruns `true` if the expression is a time macro (like Now), otherwise `false`.
|
|
4642
|
+
*/
|
|
4643
|
+
DataModel.prototype.isTimeMacro = function (macroExpr, macroProcessor) {
|
|
4644
|
+
var match = macroExpr.match(/\${{?(.*?)}?}/);
|
|
4645
|
+
if (match != null) {
|
|
4646
|
+
var macroId = match[1];
|
|
4647
|
+
if (public_api["l" /* utils */].indexOfArrayItem(this.timeMacros, macroId) >= 0) {
|
|
4648
|
+
if (macroProcessor) {
|
|
4649
|
+
macroProcessor(macroId);
|
|
4650
|
+
}
|
|
4651
|
+
return true;
|
|
4652
|
+
}
|
|
4653
|
+
}
|
|
4654
|
+
return false;
|
|
4655
|
+
};
|
|
4570
4656
|
/**
|
|
4571
4657
|
* Gets date by its macro value.
|
|
4572
|
-
* @param
|
|
4658
|
+
* @param macroExpr The macro value.
|
|
4573
4659
|
* @returns The date or `null`
|
|
4574
4660
|
*/
|
|
4575
|
-
DataModel.prototype.getDateMacroValue = function (
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
switch (macroName) {
|
|
4661
|
+
DataModel.prototype.getDateMacroValue = function (macroExpr) {
|
|
4662
|
+
var d = new Date();
|
|
4663
|
+
var res = this.isDateMacro(macroExpr, function (macroId) {
|
|
4664
|
+
switch (macroId) {
|
|
4580
4665
|
case 'Today':
|
|
4581
4666
|
break;
|
|
4582
4667
|
case 'Yesterday':
|
|
@@ -4623,37 +4708,27 @@ var data_model_DataModel = /** @class */ (function (_super) {
|
|
|
4623
4708
|
break;
|
|
4624
4709
|
}
|
|
4625
4710
|
;
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
return null;
|
|
4629
|
-
};
|
|
4630
|
-
/**
|
|
4631
|
-
* Checks wether macro value is date.
|
|
4632
|
-
* @param macro The macro value.
|
|
4633
|
-
* @retruns `true` if the macro value is date, otherwise `false`.
|
|
4634
|
-
*/
|
|
4635
|
-
DataModel.prototype.isDateMacro = function (macro) {
|
|
4636
|
-
return public_api["l" /* utils */].indexOfArrayItem(this.dateMacros, macro) >= 0;
|
|
4711
|
+
});
|
|
4712
|
+
return res ? d : null;
|
|
4637
4713
|
};
|
|
4638
4714
|
/**
|
|
4639
|
-
* Gets date
|
|
4640
|
-
* @param
|
|
4715
|
+
* Gets the date value by a macro expression of the expression itself.
|
|
4716
|
+
* @param macroExpr The macro value.
|
|
4641
4717
|
* @returns The date or macro valu.
|
|
4642
4718
|
*/
|
|
4643
|
-
DataModel.prototype.getDateOrMacroValue = function (
|
|
4644
|
-
var d = this.getDateMacroValue(
|
|
4645
|
-
return d ? d :
|
|
4719
|
+
DataModel.prototype.getDateOrMacroValue = function (macroExpr) {
|
|
4720
|
+
var d = this.getDateMacroValue(macroExpr);
|
|
4721
|
+
return d ? d : macroExpr;
|
|
4646
4722
|
};
|
|
4647
4723
|
/**
|
|
4648
4724
|
* Gets time by its macro value.
|
|
4649
|
-
* @param
|
|
4725
|
+
* @param macroExpr The macro value.
|
|
4650
4726
|
* @returns The date or `null`.
|
|
4651
4727
|
*/
|
|
4652
|
-
DataModel.prototype.getTimeMacroValue = function (
|
|
4728
|
+
DataModel.prototype.getTimeMacroValue = function (macroExpr) {
|
|
4653
4729
|
var d = new Date();
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
switch (macroName) {
|
|
4730
|
+
var res = this.isDateMacro(macroExpr, function (macroId) {
|
|
4731
|
+
switch (macroId) {
|
|
4657
4732
|
case 'Now':
|
|
4658
4733
|
break;
|
|
4659
4734
|
case 'HourStart':
|
|
@@ -4667,17 +4742,8 @@ var data_model_DataModel = /** @class */ (function (_super) {
|
|
|
4667
4742
|
break;
|
|
4668
4743
|
}
|
|
4669
4744
|
;
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
return null;
|
|
4673
|
-
};
|
|
4674
|
-
/**
|
|
4675
|
-
* Checks wether macro value is time.
|
|
4676
|
-
* @param macro The macro value.
|
|
4677
|
-
* @retruns `true` if the macro value is time, otherwise `false`.
|
|
4678
|
-
*/
|
|
4679
|
-
DataModel.prototype.isTimeMacro = function (macro) {
|
|
4680
|
-
return public_api["l" /* utils */].indexOfArrayItem(this.timeMacros, macro) >= 0;
|
|
4745
|
+
});
|
|
4746
|
+
return res ? d : null;
|
|
4681
4747
|
};
|
|
4682
4748
|
/**
|
|
4683
4749
|
* Gets time or macro by macro value.
|
|
@@ -4688,10 +4754,10 @@ var data_model_DataModel = /** @class */ (function (_super) {
|
|
|
4688
4754
|
var t = this.getTimeMacroValue(time);
|
|
4689
4755
|
return t ? t : time;
|
|
4690
4756
|
};
|
|
4691
|
-
/**
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4757
|
+
// /**
|
|
4758
|
+
// * Gets all date marcos.
|
|
4759
|
+
// * @returns The array of marcos
|
|
4760
|
+
// */
|
|
4695
4761
|
DataModel.prototype.getAllDateMacros = function () {
|
|
4696
4762
|
return this.dateMacros;
|
|
4697
4763
|
};
|
|
@@ -5565,20 +5631,19 @@ var query_Query = /** @class */ (function () {
|
|
|
5565
5631
|
this.processQueryForAggregation();
|
|
5566
5632
|
var aggrCols = this.columns.filter(function (c) { return c.enabled
|
|
5567
5633
|
&& c.expr.tag == ExprTag.AggregateFunction; });
|
|
5568
|
-
// query contains aggregate columns
|
|
5569
|
-
if (aggrCols.length) {
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
}
|
|
5634
|
+
// // query contains aggregate columns
|
|
5635
|
+
// if (aggrCols.length) {
|
|
5636
|
+
// for (const col of aggrCols) {
|
|
5637
|
+
// const attr = this.model.getAttributeById(col.expr.args[0].value);
|
|
5638
|
+
// this.changeColumnType(col, ExprTag.EntityAttribute, {
|
|
5639
|
+
// caption: this.model.getAttributeText(attr, `{attr}`)
|
|
5640
|
+
// });
|
|
5641
|
+
// }
|
|
5642
|
+
// this.fireChangedEvent({
|
|
5643
|
+
// part: QueryChangePart.Columns,
|
|
5644
|
+
// wasModified: true
|
|
5645
|
+
// });
|
|
5646
|
+
// }
|
|
5582
5647
|
}
|
|
5583
5648
|
if (!this._enableAggregation) {
|
|
5584
5649
|
this.aggrSettings.clear();
|
|
@@ -5613,8 +5678,8 @@ var query_Query = /** @class */ (function () {
|
|
|
5613
5678
|
var colsToGroup = _this.columns.filter(function (c) { return c.enabled
|
|
5614
5679
|
&& c.expr.tag == ExprTag.EntityAttribute; });
|
|
5615
5680
|
var aggrsToAdd = [];
|
|
5616
|
-
for (var _i = 0,
|
|
5617
|
-
var col =
|
|
5681
|
+
for (var _i = 0, aggrCols_1 = aggrCols; _i < aggrCols_1.length; _i++) {
|
|
5682
|
+
var col = aggrCols_1[_i];
|
|
5618
5683
|
aggrsToAdd.push({ id: col.id, func: col.expr.func });
|
|
5619
5684
|
_this.changeColumnType(col, ExprTag.EntityAttribute);
|
|
5620
5685
|
}
|
|
@@ -6366,12 +6431,12 @@ var query_Query = /** @class */ (function () {
|
|
|
6366
6431
|
if (column.isJustSorted())
|
|
6367
6432
|
return;
|
|
6368
6433
|
args = args || {};
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6434
|
+
column.caption = (typeof args.caption !== 'undefined')
|
|
6435
|
+
? args.caption
|
|
6436
|
+
: '';
|
|
6372
6437
|
if (tag === ExprTag.AggregateFunction) {
|
|
6373
6438
|
if (!args.funcId)
|
|
6374
|
-
throw Error("
|
|
6439
|
+
throw Error('"funcId" argument is not defined');
|
|
6375
6440
|
if (column.expr.tag == ExprTag.AggregateFunction) {
|
|
6376
6441
|
column.expr.func = args.funcId;
|
|
6377
6442
|
return;
|
|
@@ -7127,9 +7192,9 @@ var EqQueryFileLoader = /** @class */ (function () {
|
|
|
7127
7192
|
fileName = options.fileName
|
|
7128
7193
|
+ fileName.substring(fileName.lastIndexOf('.'));
|
|
7129
7194
|
}
|
|
7130
|
-
if (window.navigator
|
|
7195
|
+
if (window.navigator['msSaveOrOpenBlob']) {
|
|
7131
7196
|
// Internet Explorer
|
|
7132
|
-
window.navigator
|
|
7197
|
+
window.navigator['msSaveOrOpenBlob'](blob, fileName);
|
|
7133
7198
|
}
|
|
7134
7199
|
else {
|
|
7135
7200
|
var a = document.createElement("a");
|
|
@@ -7165,13 +7230,12 @@ var EqAggregatesContainer = /** @class */ (function () {
|
|
|
7165
7230
|
this.context = context;
|
|
7166
7231
|
this.levels = {};
|
|
7167
7232
|
}
|
|
7168
|
-
EqAggregatesContainer.prototype.
|
|
7233
|
+
EqAggregatesContainer.prototype.getAggregateData = function (level, groupKey) {
|
|
7169
7234
|
var _this = this;
|
|
7170
7235
|
return new Promise(function (resolve, reject) {
|
|
7171
|
-
var desc = _this.getLevelDesc(level);
|
|
7172
7236
|
var processFunc = function (data) {
|
|
7173
7237
|
// map values
|
|
7174
|
-
var keyStr =
|
|
7238
|
+
var keyStr = _this.groupKeyToStr(groupKey);
|
|
7175
7239
|
var value = data.get(keyStr);
|
|
7176
7240
|
if (value) {
|
|
7177
7241
|
resolve(value);
|
|
@@ -7180,33 +7244,43 @@ var EqAggregatesContainer = /** @class */ (function () {
|
|
|
7180
7244
|
reject("Can't find data for " + keyStr);
|
|
7181
7245
|
}
|
|
7182
7246
|
};
|
|
7183
|
-
|
|
7247
|
+
var desc = _this.getLevelDesc(level, false);
|
|
7248
|
+
if (desc && desc.data) {
|
|
7184
7249
|
processFunc(desc.data);
|
|
7185
7250
|
}
|
|
7186
7251
|
else {
|
|
7187
|
-
desc.
|
|
7252
|
+
desc.receivedCallbacks.push(processFunc);
|
|
7188
7253
|
}
|
|
7189
7254
|
});
|
|
7190
7255
|
};
|
|
7191
|
-
EqAggregatesContainer.prototype.
|
|
7192
|
-
var desc = this.getLevelDesc(level);
|
|
7256
|
+
EqAggregatesContainer.prototype.setAggregateData = function (level, data) {
|
|
7257
|
+
var desc = this.getLevelDesc(level, true);
|
|
7193
7258
|
desc.data = data;
|
|
7194
|
-
if (desc.
|
|
7195
|
-
for (var _i = 0, _a = desc.
|
|
7259
|
+
if (desc.receivedCallbacks) {
|
|
7260
|
+
for (var _i = 0, _a = desc.receivedCallbacks; _i < _a.length; _i++) {
|
|
7196
7261
|
var callback = _a[_i];
|
|
7197
7262
|
callback(desc.data);
|
|
7198
7263
|
}
|
|
7199
7264
|
}
|
|
7200
|
-
desc.
|
|
7265
|
+
desc.receivedCallbacks = [];
|
|
7201
7266
|
};
|
|
7202
|
-
EqAggregatesContainer.prototype.
|
|
7267
|
+
EqAggregatesContainer.prototype.updateAggregateData = function (level, groupKey, values) {
|
|
7268
|
+
var desc = this.getLevelDesc(level, true);
|
|
7269
|
+
var key = this.groupKeyToStr(groupKey);
|
|
7270
|
+
desc.data.set(key, values);
|
|
7271
|
+
};
|
|
7272
|
+
EqAggregatesContainer.prototype.groupKeyToStr = function (groupKey) {
|
|
7273
|
+
return JSON.stringify(groupKey);
|
|
7274
|
+
};
|
|
7275
|
+
EqAggregatesContainer.prototype.getLevelDesc = function (level, createIfNotExists) {
|
|
7203
7276
|
var desc = this.levels[level];
|
|
7204
|
-
if (!desc) {
|
|
7277
|
+
if (!desc && createIfNotExists) {
|
|
7205
7278
|
desc = {
|
|
7206
|
-
|
|
7279
|
+
receivedCallbacks: [],
|
|
7280
|
+
data: new Map()
|
|
7207
7281
|
};
|
|
7282
|
+
this.levels[level] = desc;
|
|
7208
7283
|
}
|
|
7209
|
-
this.levels[level] = desc;
|
|
7210
7284
|
return desc;
|
|
7211
7285
|
};
|
|
7212
7286
|
EqAggregatesContainer.prototype.clear = function () {
|
|
@@ -7239,18 +7313,23 @@ var DefaultAggregatesCalculator = /** @class */ (function () {
|
|
|
7239
7313
|
columns[i].enabled = false;
|
|
7240
7314
|
}
|
|
7241
7315
|
if (settings.hasGrandTotals()) {
|
|
7242
|
-
this.aggrs.
|
|
7316
|
+
this.aggrs.setAggregateData(0, new Map());
|
|
7243
7317
|
if (options.resultObtained)
|
|
7244
7318
|
options.resultObtained({}, 0);
|
|
7245
7319
|
}
|
|
7246
7320
|
var groups = settings.getGroups();
|
|
7247
7321
|
for (var level = 1; level <= groups.length && level <= options.maxLevel; level++) {
|
|
7248
|
-
this.aggrs.
|
|
7322
|
+
this.aggrs.setAggregateData(level, new Map());
|
|
7249
7323
|
if (options.resultObtained)
|
|
7250
7324
|
options.resultObtained({}, level);
|
|
7251
7325
|
}
|
|
7252
7326
|
return Promise.resolve();
|
|
7253
7327
|
};
|
|
7328
|
+
DefaultAggregatesCalculator.prototype.needRecalculation = function () {
|
|
7329
|
+
return true;
|
|
7330
|
+
};
|
|
7331
|
+
DefaultAggregatesCalculator.prototype.reset = function () {
|
|
7332
|
+
};
|
|
7254
7333
|
return DefaultAggregatesCalculator;
|
|
7255
7334
|
}());
|
|
7256
7335
|
|
|
@@ -7365,7 +7444,7 @@ var eq_services_EqServiceProvider = /** @class */ (function () {
|
|
|
7365
7444
|
EqServiceProvider.prototype.getAggregatesCalculator = function () {
|
|
7366
7445
|
if (!this.aggrCalculator) {
|
|
7367
7446
|
if (!this.aggrCalculatoResolver) {
|
|
7368
|
-
throw 'Resolver for
|
|
7447
|
+
throw 'Resolver for AggregatesCalculator is not defined';
|
|
7369
7448
|
}
|
|
7370
7449
|
this.aggrCalculator = this.aggrCalculatoResolver(this.context);
|
|
7371
7450
|
}
|
|
@@ -7414,7 +7493,6 @@ var eq_data_loader_EasyQueryDataLoader = /** @class */ (function () {
|
|
|
7414
7493
|
// different grids
|
|
7415
7494
|
this.dataLoadPromise = new Promise(function (resolve, reject) {
|
|
7416
7495
|
var fetchOptions = {
|
|
7417
|
-
skipAggr: true,
|
|
7418
7496
|
chunk: chunk,
|
|
7419
7497
|
success: function (result) {
|
|
7420
7498
|
var dataTable = new public_api["c" /* EasyDataTable */]({
|
|
@@ -7532,9 +7610,9 @@ var EqServerExporter = /** @class */ (function () {
|
|
|
7532
7610
|
var blob = new Blob([responseData]);
|
|
7533
7611
|
var filename = request.getXMLHttpRequest()
|
|
7534
7612
|
.getResponseHeader("Content-Disposition").match(/filename="(.*)"/)[1];
|
|
7535
|
-
if (window.navigator
|
|
7613
|
+
if (window.navigator['msSaveOrOpenBlob']) {
|
|
7536
7614
|
// Internet Explorer
|
|
7537
|
-
window.navigator
|
|
7615
|
+
window.navigator['msSaveOrOpenBlob'](blob, filename);
|
|
7538
7616
|
}
|
|
7539
7617
|
else {
|
|
7540
7618
|
var a = document.createElement("a");
|
|
@@ -7586,7 +7664,7 @@ var context_assign = (undefined && undefined.__assign) || function () {
|
|
|
7586
7664
|
var context_EqContext = /** @class */ (function () {
|
|
7587
7665
|
function EqContext() {
|
|
7588
7666
|
var _this = this;
|
|
7589
|
-
this.
|
|
7667
|
+
this.servicesInitialized = false;
|
|
7590
7668
|
this.internalListCache = {};
|
|
7591
7669
|
this.loadModelOnStart = true;
|
|
7592
7670
|
this.loadQueryOnStart = false;
|
|
@@ -7598,18 +7676,16 @@ var context_EqContext = /** @class */ (function () {
|
|
|
7598
7676
|
this._predefinedListRequestHandlers = {
|
|
7599
7677
|
'_DSDE': function (params, onResult) {
|
|
7600
7678
|
var data = _this.getModel().getAllDateMacros()
|
|
7601
|
-
.map(function (
|
|
7602
|
-
|
|
7603
|
-
return { id: macro, text: public_api["k" /* i18n */].getText(macroName) };
|
|
7679
|
+
.map(function (macroId) {
|
|
7680
|
+
return { id: '${{' + macroId + '}}', text: public_api["k" /* i18n */].getText(macroId) };
|
|
7604
7681
|
});
|
|
7605
7682
|
onResult(data);
|
|
7606
7683
|
return true;
|
|
7607
7684
|
},
|
|
7608
7685
|
'_DSTE': function (params, onResult) {
|
|
7609
7686
|
var data = _this.getModel().getAllTimeMacros()
|
|
7610
|
-
.map(function (
|
|
7611
|
-
|
|
7612
|
-
return { id: macro, text: public_api["k" /* i18n */].getText(macroName) };
|
|
7687
|
+
.map(function (macroId) {
|
|
7688
|
+
return { id: '${{' + macroId + '}}', text: public_api["k" /* i18n */].getText(macroId) };
|
|
7613
7689
|
});
|
|
7614
7690
|
onResult(data);
|
|
7615
7691
|
return true;
|
|
@@ -7675,9 +7751,19 @@ var context_EqContext = /** @class */ (function () {
|
|
|
7675
7751
|
this.endpoints = new Map();
|
|
7676
7752
|
this.dataLoader = new eq_data_loader_EasyQueryDataLoader(this);
|
|
7677
7753
|
this.resultTable = new public_api["c" /* EasyDataTable */]({
|
|
7678
|
-
loader: this.dataLoader
|
|
7754
|
+
loader: this.dataLoader,
|
|
7755
|
+
onUpdate: this.onResultTableUpdate.bind(this)
|
|
7679
7756
|
});
|
|
7680
7757
|
this.resultTable.id = 'ResultTable';
|
|
7758
|
+
this.errorHandlerId = this.addEventListener('error', function (context, status) {
|
|
7759
|
+
status.result = EqActionResult.Error;
|
|
7760
|
+
var msgTitle = status.action ? status.action + ' error' : 'Error';
|
|
7761
|
+
var msgText = status.text ? status.text : '';
|
|
7762
|
+
if (status.sourceError && status.sourceError.message !== msgText) {
|
|
7763
|
+
msgText += '\n' + status.sourceError;
|
|
7764
|
+
}
|
|
7765
|
+
console.error(msgTitle + ': ' + msgText);
|
|
7766
|
+
});
|
|
7681
7767
|
}
|
|
7682
7768
|
EqContext.prototype.getServices = function () {
|
|
7683
7769
|
return this.eqServices;
|
|
@@ -7755,13 +7841,17 @@ var context_EqContext = /** @class */ (function () {
|
|
|
7755
7841
|
this.setEnpointIfNotExist('GetQueryFile', utils_equtils.combinePath(endpointBase, 'models/{modelId}/getqueryfile/{format}'));
|
|
7756
7842
|
this.setEnpointIfNotExist('UploadQueryFile', utils_equtils.combinePath(endpointBase, 'models/{modelId}/uploadqueryfile'));
|
|
7757
7843
|
};
|
|
7844
|
+
EqContext.prototype.initStart = function () {
|
|
7845
|
+
this.servicesInitialized = true;
|
|
7846
|
+
};
|
|
7758
7847
|
/**
|
|
7759
7848
|
* Initializes the context
|
|
7760
7849
|
* @param options
|
|
7761
7850
|
*/
|
|
7762
7851
|
EqContext.prototype.init = function (options) {
|
|
7763
7852
|
var _this = this;
|
|
7764
|
-
this.
|
|
7853
|
+
if (!this.servicesInitialized)
|
|
7854
|
+
this.initStart();
|
|
7765
7855
|
options = options || {};
|
|
7766
7856
|
if (typeof (options.debugMode) !== 'undefined') {
|
|
7767
7857
|
this.debugMode = options.debugMode;
|
|
@@ -7771,7 +7861,6 @@ var context_EqContext = /** @class */ (function () {
|
|
|
7771
7861
|
}
|
|
7772
7862
|
if (typeof (options.elasticPaging) !== 'undefined') {
|
|
7773
7863
|
this.elasticPaging = options.elasticPaging;
|
|
7774
|
-
this.resultTable.elasticChunks = this.elasticPaging;
|
|
7775
7864
|
}
|
|
7776
7865
|
if (options.listCache) {
|
|
7777
7866
|
this.setExternalListCache(options.listCache);
|
|
@@ -7822,19 +7911,9 @@ var context_EqContext = /** @class */ (function () {
|
|
|
7822
7911
|
this.addEventListener('processEnd', options.handlers.onProcessEnd);
|
|
7823
7912
|
}
|
|
7824
7913
|
if (options.handlers.onError) {
|
|
7914
|
+
this.removeEventListener('error', this.errorHandlerId);
|
|
7825
7915
|
this.addEventListener('error', options.handlers.onError);
|
|
7826
7916
|
}
|
|
7827
|
-
else {
|
|
7828
|
-
this.addEventListener('error', function (context, msg) {
|
|
7829
|
-
msg.result = EqActionResult.Error;
|
|
7830
|
-
var msgTitle = msg && msg ? msg.action + ' error' : 'Error';
|
|
7831
|
-
var msgText = msg && msg.text ? msg.text : '';
|
|
7832
|
-
if (msg.sourceError.message !== msgText) {
|
|
7833
|
-
msgText += '\n' + msg.sourceError;
|
|
7834
|
-
}
|
|
7835
|
-
console.error(msgTitle + ': ' + msgText);
|
|
7836
|
-
});
|
|
7837
|
-
}
|
|
7838
7917
|
if (options.handlers.onListRequest) {
|
|
7839
7918
|
this.clientListRequestHandler = options.handlers.onListRequest;
|
|
7840
7919
|
}
|
|
@@ -7968,7 +8047,7 @@ var context_EqContext = /** @class */ (function () {
|
|
|
7968
8047
|
*/
|
|
7969
8048
|
EqContext.prototype.getQuery = function () {
|
|
7970
8049
|
if (!this.query) {
|
|
7971
|
-
if (!this.
|
|
8050
|
+
if (!this.servicesInitialized) {
|
|
7972
8051
|
throw new Error("Can't create query until the context is initialized");
|
|
7973
8052
|
}
|
|
7974
8053
|
this.query = this.createQuery();
|
|
@@ -8631,11 +8710,15 @@ var context_EqContext = /** @class */ (function () {
|
|
|
8631
8710
|
EqContext.prototype.fetchData = function (options) {
|
|
8632
8711
|
var _this = this;
|
|
8633
8712
|
options = options || {};
|
|
8713
|
+
var elasticPaging = typeof (options.elasticPaging) !== 'undefined'
|
|
8714
|
+
? options.elasticPaging
|
|
8715
|
+
: this.elasticPaging;
|
|
8716
|
+
this.resultTable.elasticChunks = elasticPaging;
|
|
8634
8717
|
options.chunk = options.chunk ||
|
|
8635
8718
|
{
|
|
8636
8719
|
offset: 0,
|
|
8637
8720
|
limit: this.resultTable.chunkSize,
|
|
8638
|
-
needTotal: !
|
|
8721
|
+
needTotal: !elasticPaging
|
|
8639
8722
|
};
|
|
8640
8723
|
if (this.debugMode) {
|
|
8641
8724
|
options.debug = 'Fetching the result set. Initial chunk';
|
|
@@ -8645,14 +8728,20 @@ var context_EqContext = /** @class */ (function () {
|
|
|
8645
8728
|
})) {
|
|
8646
8729
|
return;
|
|
8647
8730
|
}
|
|
8731
|
+
//just to support the old way of catching "group fetch" operation finish
|
|
8732
|
+
if (options.groupFetchSuccess) {
|
|
8733
|
+
this.afterGroupFetch = options.groupFetchSuccess;
|
|
8734
|
+
}
|
|
8648
8735
|
if (this.resultTable.elasticChunks) {
|
|
8649
8736
|
options.chunk.limit++;
|
|
8650
8737
|
}
|
|
8651
|
-
this.fetchDataChunk(context_assign({}, options, { success: function (result) {
|
|
8738
|
+
this.fetchDataChunk(context_assign(context_assign({}, options), { success: function (result) {
|
|
8652
8739
|
if (result.statement) {
|
|
8653
8740
|
_this.resultStatement = result.statement;
|
|
8654
8741
|
_this.refreshWidgets(WidgetGroup.Statement);
|
|
8655
8742
|
}
|
|
8743
|
+
var aggrCalculator = _this.getServices().getAggregatesCalculator();
|
|
8744
|
+
aggrCalculator.reset();
|
|
8656
8745
|
_this.resultContent = result;
|
|
8657
8746
|
if (result.resultSet) {
|
|
8658
8747
|
_this.resultTable.clear();
|
|
@@ -8677,6 +8766,7 @@ var context_EqContext = /** @class */ (function () {
|
|
|
8677
8766
|
? resultSet.rows.length
|
|
8678
8767
|
: 0;
|
|
8679
8768
|
}
|
|
8769
|
+
_this.resultTable.fireUpdated();
|
|
8680
8770
|
}
|
|
8681
8771
|
if (options.success) {
|
|
8682
8772
|
options.success(result);
|
|
@@ -8752,55 +8842,30 @@ var context_EqContext = /** @class */ (function () {
|
|
|
8752
8842
|
};
|
|
8753
8843
|
EqContext.prototype.fetchDataChunk = function (options) {
|
|
8754
8844
|
var _this = this;
|
|
8755
|
-
if (this.beforeFetchData) {
|
|
8756
|
-
this.beforeFetchData(this, options);
|
|
8757
|
-
}
|
|
8758
8845
|
var queryId = this.getQuery().getId();
|
|
8759
8846
|
var fetchOptions = options || {};
|
|
8760
8847
|
if (this.useStoredQueryOnFetch) {
|
|
8761
8848
|
fetchOptions.queryId = this.query.getId();
|
|
8762
8849
|
}
|
|
8850
|
+
if (this.beforeFetchData) {
|
|
8851
|
+
this.beforeFetchData(this, fetchOptions);
|
|
8852
|
+
}
|
|
8763
8853
|
this.startProcess({
|
|
8764
8854
|
action: EqAction.FetchData,
|
|
8765
8855
|
text: 'Fetching data for the query: ' + queryId
|
|
8766
8856
|
}, WidgetGroup.Result);
|
|
8767
8857
|
var dataFetcher = this.eqServices.getDataFetcher();
|
|
8768
|
-
dataFetcher.fetchData(
|
|
8858
|
+
dataFetcher.fetchData(fetchOptions)
|
|
8769
8859
|
.then(function (result) {
|
|
8770
8860
|
if (result.statement) {
|
|
8771
8861
|
_this.resultStatement = result.statement;
|
|
8772
8862
|
}
|
|
8773
8863
|
_this.resultContent = result;
|
|
8774
|
-
if (!options.skipAggr) {
|
|
8775
|
-
var aggrSettings = _this.query.getAggregationSettings();
|
|
8776
|
-
if (aggrSettings.needAggrCalculation()) {
|
|
8777
|
-
var calculator = _this.getServices().getAggregatesCalculator();
|
|
8778
|
-
calculator.calculate({
|
|
8779
|
-
maxLevel: aggrSettings.getGroups().length + 1,
|
|
8780
|
-
resultObtained: function (result, level) {
|
|
8781
|
-
if (options.groupFetchSucess) {
|
|
8782
|
-
options.groupFetchSucess(result);
|
|
8783
|
-
}
|
|
8784
|
-
},
|
|
8785
|
-
errorOccurred: function (error) {
|
|
8786
|
-
var errorMessage = "Data fetching error on group level " + error.level + " query. \n" + error.message;
|
|
8787
|
-
_this.throwError({
|
|
8788
|
-
action: EqAction.FetchData,
|
|
8789
|
-
text: errorMessage,
|
|
8790
|
-
sourceError: error
|
|
8791
|
-
});
|
|
8792
|
-
if (options.error) {
|
|
8793
|
-
options.error(errorMessage, EqAction.FetchData);
|
|
8794
|
-
}
|
|
8795
|
-
}
|
|
8796
|
-
});
|
|
8797
|
-
}
|
|
8798
|
-
}
|
|
8799
8864
|
// we need to call success callback before firing fetchData,
|
|
8800
8865
|
// because otherwise, it won't update the result table
|
|
8801
8866
|
// in the context before afterFetchData callback is called.
|
|
8802
|
-
if (
|
|
8803
|
-
|
|
8867
|
+
if (fetchOptions.success) {
|
|
8868
|
+
fetchOptions.success(result);
|
|
8804
8869
|
}
|
|
8805
8870
|
_this.fireEvent('fetchData');
|
|
8806
8871
|
_this.endProcess({
|
|
@@ -8817,11 +8882,34 @@ var context_EqContext = /** @class */ (function () {
|
|
|
8817
8882
|
text: errorMessage,
|
|
8818
8883
|
sourceError: error
|
|
8819
8884
|
}, WidgetGroup.Result);
|
|
8820
|
-
if (
|
|
8821
|
-
|
|
8885
|
+
if (fetchOptions.error) {
|
|
8886
|
+
fetchOptions.error(errorMessage, EqAction.FetchData);
|
|
8822
8887
|
}
|
|
8823
8888
|
});
|
|
8824
8889
|
};
|
|
8890
|
+
EqContext.prototype.onResultTableUpdate = function () {
|
|
8891
|
+
var _this = this;
|
|
8892
|
+
var aggrSettings = this.query.getAggregationSettings();
|
|
8893
|
+
var calculator = this.getServices().getAggregatesCalculator();
|
|
8894
|
+
if (aggrSettings.needAggrCalculation() && calculator.needRecalculation()) {
|
|
8895
|
+
calculator.calculate({
|
|
8896
|
+
maxLevel: aggrSettings.getGroups().length + 1,
|
|
8897
|
+
resultObtained: function (result, level) {
|
|
8898
|
+
if (_this.afterGroupFetch) {
|
|
8899
|
+
_this.afterGroupFetch(result);
|
|
8900
|
+
}
|
|
8901
|
+
},
|
|
8902
|
+
errorOccurred: function (error) {
|
|
8903
|
+
var errorMessage = "Data fetching error on group level " + error.level + " query. \n" + error.message;
|
|
8904
|
+
_this.throwError({
|
|
8905
|
+
action: EqAction.FetchData,
|
|
8906
|
+
text: errorMessage,
|
|
8907
|
+
sourceError: error
|
|
8908
|
+
});
|
|
8909
|
+
}
|
|
8910
|
+
});
|
|
8911
|
+
}
|
|
8912
|
+
};
|
|
8825
8913
|
/**
|
|
8826
8914
|
* Fetches the data for a drill-down query (if defined) and processes the result.
|
|
8827
8915
|
* @param options
|