@easyquery/core 7.1.2-rc04 → 7.1.3-beta02

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.
@@ -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/30/s/easydata/easydata.js/packs/core/dist/lib/types/data_type.js
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/30/s/easydata/easydata.js/packs/core/dist/lib/types/entity_attr_kind.js
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/30/s/easydata/easydata.js/packs/core/dist/lib/types/editor_tag.js
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/30/s/easydata/easydata.js/packs/core/dist/lib/http/http_method.js
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/30/s/easydata/easydata.js/packs/core/dist/lib/http/http_request.js
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/30/s/easydata/easydata.js/packs/core/dist/lib/utils/string_utils.js
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/30/s/easydata/easydata.js/packs/core/dist/lib/i18n/i18n.js
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,7 +759,7 @@ 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/30/s/easydata/easydata.js/packs/core/dist/lib/utils/utils.js
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
 
@@ -1148,10 +1148,10 @@ var utils_utils;
1148
1148
  return (621355968e9 + (new Date()).getTime() * 1e4);
1149
1149
  }
1150
1150
  function safeParseInt(str) {
1151
- var isnum = /^\d+$/.test(str);
1152
- if (!isnum)
1153
- throw "Is not a valid number";
1154
- return parseInt(str);
1151
+ var res = parseInt(str);
1152
+ if (isNaN(res))
1153
+ throw "\"" + str + "\" is not a valid number";
1154
+ return res;
1155
1155
  }
1156
1156
  function getDaysInMonth(month, year) {
1157
1157
  return new Date(year, month + 1, 0).getDate();
@@ -1161,10 +1161,10 @@ var utils_utils;
1161
1161
  function strToDateTime(value, format) {
1162
1162
  if (!value || value.length == 0)
1163
1163
  return new Date();
1164
- var normalized = value.replace(/[^a-zA-Z0-9_]/g, '-');
1164
+ var normalizedValue = value.replace(/[^a-zA-Z0-9_]/g, '-');
1165
1165
  var normalizedFormat = format.replace(/[^a-zA-Z0-9_]/g, '-');
1166
1166
  var formatItems = normalizedFormat.split('-');
1167
- var dateItems = normalized.split('-');
1167
+ var dateItems = normalizedValue.split('-');
1168
1168
  var monthIndex = formatItems.indexOf("MM");
1169
1169
  var dayIndex = formatItems.indexOf("dd");
1170
1170
  var yearIndex = formatItems.indexOf("yyyy");
@@ -1173,41 +1173,58 @@ var utils_utils;
1173
1173
  var secondsIndex = formatItems.indexOf("ss");
1174
1174
  var today = new Date();
1175
1175
  try {
1176
- var year = yearIndex > -1 && yearIndex < dateItems.length ? safeParseInt(dateItems[yearIndex]) : today.getFullYear();
1177
- var month = monthIndex > -1 && monthIndex < dateItems.length ? safeParseInt(dateItems[monthIndex]) - 1 : today.getMonth() - 1;
1176
+ var year = yearIndex > -1 && yearIndex < dateItems.length
1177
+ ? safeParseInt(dateItems[yearIndex])
1178
+ : today.getFullYear();
1179
+ var month = monthIndex > -1 && monthIndex < dateItems.length
1180
+ ? safeParseInt(dateItems[monthIndex]) - 1
1181
+ : today.getMonth() - 1;
1178
1182
  if (month > 11)
1179
1183
  throw '';
1180
- var day = dayIndex > -1 && dayIndex < dateItems.length ? safeParseInt(dateItems[dayIndex]) : today.getDate();
1184
+ var day = dayIndex > -1 && dayIndex < dateItems.length
1185
+ ? safeParseInt(dateItems[dayIndex])
1186
+ : today.getDate();
1181
1187
  if (day > getDaysInMonth(month, year))
1182
1188
  throw '';
1183
- var hour = hourIndex > -1 && hourIndex < dateItems.length ? safeParseInt(dateItems[hourIndex]) : 0;
1189
+ var hour = hourIndex > -1 && hourIndex < dateItems.length
1190
+ ? safeParseInt(dateItems[hourIndex])
1191
+ : 0;
1184
1192
  if (hour > 23)
1185
1193
  throw '';
1186
- var minute = minutesIndex > -1 && minutesIndex < dateItems.length ? safeParseInt(dateItems[minutesIndex]) : 0;
1194
+ var minute = minutesIndex > -1 && minutesIndex < dateItems.length
1195
+ ? safeParseInt(dateItems[minutesIndex])
1196
+ : 0;
1187
1197
  if (minute > 59)
1188
1198
  throw '';
1189
- var second = secondsIndex > -1 && secondsIndex < dateItems.length ? safeParseInt(dateItems[secondsIndex]) : 0;
1199
+ var second = secondsIndex > -1 && secondsIndex < dateItems.length
1200
+ ? safeParseInt(dateItems[secondsIndex])
1201
+ : 0;
1190
1202
  if (second > 59)
1191
1203
  throw '';
1192
1204
  return new Date(year, month, day, hour, minute, second);
1193
1205
  }
1194
1206
  catch (_a) {
1195
- throw "Is not a valid date time.";
1207
+ throw value + " is not a valid date.";
1196
1208
  }
1197
1209
  }
1198
1210
  utils.strToDateTime = strToDateTime;
1199
1211
  function strToTime(str) {
1200
1212
  var timeItems = str.split(':');
1201
- var hour = timeItems.length > 0 ? safeParseInt(timeItems[0]) : 0;
1202
- if (hour > 23)
1203
- throw '';
1204
- var minute = timeItems.length > 1 ? safeParseInt(timeItems[1]) : 0;
1205
- if (minute > 59)
1206
- throw '';
1207
- var second = timeItems.length > 1 ? safeParseInt(timeItems[1]) : 0;
1208
- if (second > 59)
1209
- throw '';
1210
- return new Date(0, 0, 0, hour, minute, second);
1213
+ try {
1214
+ var hour = timeItems.length > 0 ? safeParseInt(timeItems[0]) : 0;
1215
+ if (hour > 23)
1216
+ throw '';
1217
+ var minute = timeItems.length > 1 ? safeParseInt(timeItems[1]) : 0;
1218
+ if (minute > 59)
1219
+ throw '';
1220
+ var second = timeItems.length > 1 ? safeParseInt(timeItems[1]) : 0;
1221
+ if (second > 59)
1222
+ throw '';
1223
+ return new Date(0, 0, 0, hour, minute, second);
1224
+ }
1225
+ catch (_a) {
1226
+ throw str + " is not a valid time.";
1227
+ }
1211
1228
  }
1212
1229
  utils.strToTime = strToTime;
1213
1230
  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 +1276,7 @@ var utils_utils;
1259
1276
  utils.numberToStr = numberToStr;
1260
1277
  })(utils_utils || (utils_utils = {}));
1261
1278
  //# sourceMappingURL=utils.js.map
1262
- // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/30/s/easydata/easydata.js/packs/core/dist/lib/http/http_action_result.js
1279
+ // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/http/http_action_result.js
1263
1280
  var HttpActionResult = /** @class */ (function () {
1264
1281
  function HttpActionResult(request, promise) {
1265
1282
  this.request = request;
@@ -1284,7 +1301,7 @@ var HttpActionResult = /** @class */ (function () {
1284
1301
  }());
1285
1302
 
1286
1303
  //# sourceMappingURL=http_action_result.js.map
1287
- // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/30/s/easydata/easydata.js/packs/core/dist/lib/http/http_client.js
1304
+ // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/http/http_client.js
1288
1305
  var __extends = (undefined && undefined.__extends) || (function () {
1289
1306
  var extendStatics = function (d, b) {
1290
1307
  extendStatics = Object.setPrototypeOf ||
@@ -1384,7 +1401,7 @@ var http_client_HttpClient = /** @class */ (function () {
1384
1401
  }
1385
1402
  var responseContentType = xhr.getResponseHeader('Content-Type') || '';
1386
1403
  var status = xhr.status;
1387
- if (status >= 300 || status < 200) {
1404
+ if (status >= 400) {
1388
1405
  var rtPromise = (xhr.responseType === 'arraybuffer'
1389
1406
  || xhr.responseType === 'blob')
1390
1407
  ? HttpClient.decodeArrayBuffer(xhr.response)
@@ -1426,7 +1443,7 @@ var http_client_HttpClient = /** @class */ (function () {
1426
1443
  }());
1427
1444
 
1428
1445
  //# sourceMappingURL=http_client.js.map
1429
- // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/30/s/easydata/easydata.js/packs/core/dist/lib/meta/meta_entity.js
1446
+ // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/meta/meta_entity.js
1430
1447
 
1431
1448
 
1432
1449
 
@@ -1436,6 +1453,8 @@ var http_client_HttpClient = /** @class */ (function () {
1436
1453
  var MetaEntity = /** @class */ (function () {
1437
1454
  /** The default constructor. */
1438
1455
  function MetaEntity(parent) {
1456
+ /** Returns false if this entity is read-only */
1457
+ this.isEditable = true;
1439
1458
  this.name = "";
1440
1459
  this.caption = "";
1441
1460
  this.description = "";
@@ -1455,6 +1474,8 @@ var MetaEntity = /** @class */ (function () {
1455
1474
  this.captionPlural = dto.namePlur;
1456
1475
  this.caption = dto.name;
1457
1476
  this.description = dto.desc;
1477
+ if (typeof (dto.ied) !== 'undefined')
1478
+ this.isEditable = dto.ied;
1458
1479
  this.subEntities = new Array();
1459
1480
  if (dto.ents) {
1460
1481
  for (var i = 0; i < dto.ents.length; i++) {
@@ -1558,7 +1579,7 @@ var meta_entity_MetaEntityAttr = /** @class */ (function () {
1558
1579
  }());
1559
1580
 
1560
1581
  //# sourceMappingURL=meta_entity.js.map
1561
- // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/30/s/easydata/easydata.js/packs/core/dist/lib/meta/value_editor.js
1582
+ // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/meta/value_editor.js
1562
1583
 
1563
1584
 
1564
1585
  /**
@@ -1624,7 +1645,7 @@ var value_editor_ValueEditor = /** @class */ (function () {
1624
1645
  }());
1625
1646
 
1626
1647
  //# sourceMappingURL=value_editor.js.map
1627
- // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/30/s/easydata/easydata.js/packs/core/dist/lib/meta/meta_data.js
1648
+ // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/meta/meta_data.js
1628
1649
 
1629
1650
 
1630
1651
 
@@ -2116,7 +2137,7 @@ var meta_data_MetaData = /** @class */ (function () {
2116
2137
  }());
2117
2138
 
2118
2139
  //# sourceMappingURL=meta_data.js.map
2119
- // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/30/s/easydata/easydata.js/packs/core/dist/lib/data/aggr_calculator.js
2140
+ // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/data/aggr_calculator.js
2120
2141
  var aggr_calculator_assign = (undefined && undefined.__assign) || function () {
2121
2142
  aggr_calculator_assign = Object.assign || function(t) {
2122
2143
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -2269,7 +2290,7 @@ var AggregationSettings = /** @class */ (function () {
2269
2290
  }());
2270
2291
 
2271
2292
  //# sourceMappingURL=aggr_calculator.js.map
2272
- // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/30/s/easydata/easydata.js/packs/core/dist/lib/data/data_column.js
2293
+ // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/data/data_column.js
2273
2294
 
2274
2295
 
2275
2296
  var ColumnAlignment;
@@ -2295,6 +2316,7 @@ var data_column_DataColumn = /** @class */ (function () {
2295
2316
  this.displayFormat = desc.dfmt;
2296
2317
  this.groupFooterColumnTemplate = desc.gfct;
2297
2318
  this.style = desc.style || {};
2319
+ this.description = desc.description;
2298
2320
  }
2299
2321
  return DataColumn;
2300
2322
  }());
@@ -2376,7 +2398,7 @@ var data_column_DataColumnList = /** @class */ (function () {
2376
2398
  }());
2377
2399
 
2378
2400
  //# sourceMappingURL=data_column.js.map
2379
- // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/30/s/easydata/easydata.js/packs/core/dist/lib/data/data_row.js
2401
+ // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/data/data_row.js
2380
2402
  var DataRow = /** @class */ (function () {
2381
2403
  function DataRow(columns, values) {
2382
2404
  this.columns = columns;
@@ -2422,7 +2444,7 @@ var DataRow = /** @class */ (function () {
2422
2444
  }());
2423
2445
 
2424
2446
  //# sourceMappingURL=data_row.js.map
2425
- // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/30/s/easydata/easydata.js/packs/core/dist/lib/data/easy_data_table.js
2447
+ // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/data/easy_data_table.js
2426
2448
 
2427
2449
 
2428
2450
 
@@ -2702,7 +2724,7 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
2702
2724
  }());
2703
2725
 
2704
2726
  //# sourceMappingURL=easy_data_table.js.map
2705
- // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/30/s/easydata/easydata.js/packs/core/dist/lib/utils/easy_guid.js
2727
+ // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/utils/easy_guid.js
2706
2728
  /**
2707
2729
  * EasyData representation of GUID.
2708
2730
  */
@@ -2723,7 +2745,7 @@ var EasyGuid = /** @class */ (function () {
2723
2745
  }());
2724
2746
 
2725
2747
  //# sourceMappingURL=easy_guid.js.map
2726
- // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/30/s/easydata/easydata.js/packs/core/dist/lib/event/event_emitter.js
2748
+ // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/event/event_emitter.js
2727
2749
 
2728
2750
  /**
2729
2751
  * The representation of event emitter.
@@ -2849,11 +2871,27 @@ var event_emitter_EventEmitter = /** @class */ (function () {
2849
2871
  }());
2850
2872
 
2851
2873
  //# sourceMappingURL=event_emitter.js.map
2852
- // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/30/s/easydata/easydata.js/packs/core/dist/lib/i18n/load_default_locale_settings.js
2874
+ // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/utils/liquid.js
2875
+ var liquid;
2876
+ (function (liquid) {
2877
+ function renderLiquidTemplate(template, vars) {
2878
+ var result = template;
2879
+ if (vars) {
2880
+ for (var v in vars) {
2881
+ var liquidVarRegexp = new RegExp('\{\{' + v + '\}\}', 'g');
2882
+ result = result.replace(liquidVarRegexp, vars[v]);
2883
+ }
2884
+ }
2885
+ return result;
2886
+ }
2887
+ liquid.renderLiquidTemplate = renderLiquidTemplate;
2888
+ })(liquid || (liquid = {}));
2889
+ //# sourceMappingURL=liquid.js.map
2890
+ // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/i18n/load_default_locale_settings.js
2853
2891
 
2854
2892
  i18n_i18n.resetLocales();
2855
2893
  //# sourceMappingURL=load_default_locale_settings.js.map
2856
- // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/30/s/easydata/easydata.js/packs/core/dist/lib/public_api.js
2894
+ // CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/public_api.js
2857
2895
  //types
2858
2896
 
2859
2897
 
@@ -2880,6 +2918,7 @@ i18n_i18n.resetLocales();
2880
2918
 
2881
2919
 
2882
2920
 
2921
+
2883
2922
  if (typeof Object.values !== 'function') {
2884
2923
  Object.values = function (obj) {
2885
2924
  return Object.keys(obj).map(function (key) { return obj[key]; });
@@ -3135,7 +3174,7 @@ __webpack_require__.d(__webpack_exports__, "FormatParser", function() { return /
3135
3174
  __webpack_require__.d(__webpack_exports__, "versionInfo", function() { return /* reexport */ versionInfo; });
3136
3175
  __webpack_require__.d(__webpack_exports__, "i18n", function() { return /* reexport */ public_api["k" /* i18n */]; });
3137
3176
 
3138
- // EXTERNAL MODULE: c:/azuredevops-agents/korzhdev/_work/30/s/easydata/easydata.js/packs/core/dist/lib/public_api.js + 20 modules
3177
+ // EXTERNAL MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/public_api.js + 21 modules
3139
3178
  var public_api = __webpack_require__(0);
3140
3179
 
3141
3180
  // CONCATENATED MODULE: ./src/utils/format_parser.ts
@@ -3834,11 +3873,11 @@ var data_model_DataModel = /** @class */ (function (_super) {
3834
3873
  _this.operators = new Array();
3835
3874
  _this.rootEntity = new Entity();
3836
3875
  _this.aggrFunctions = new Array();
3837
- _this.dateMacros = ['${{Today}}', '${{Yesterday}}',
3838
- '${{Tomorrow}}', '${{FirstDayOfMonth}}', '${{LastDayOfMonth}}',
3839
- '${{FirstDayOfWeek}}', '${{FirstDayOfYear}}', '${{FirstDayOfNextWeek}}', '${{FirstDayOfPrevMonth}}',
3840
- '${{FirstDayOfNextMonth}}', '${{FirstDayOfNextYear}}', '${{FirstDayOfPrevYear}}', '${{FirstDayOfPrevWeek}}'];
3841
- _this.timeMacros = ['${{Now}}', '${{HourStart}}', '${{Midnight}}', '${{Noon}}'];
3876
+ _this.dateMacros = ['Today', 'Yesterday',
3877
+ 'Tomorrow', 'FirstDayOfMonth', 'LastDayOfMonth',
3878
+ 'FirstDayOfWeek', 'FirstDayOfYear', 'FirstDayOfNextWeek', 'FirstDayOfPrevMonth',
3879
+ 'FirstDayOfNextMonth', 'FirstDayOfNextYear', 'FirstDayOfPrevYear', 'FirstDayOfPrevWeek'];
3880
+ _this.timeMacros = ['Now', 'HourStart', 'Midnight', 'Noon'];
3842
3881
  _this.links = [];
3843
3882
  return _this;
3844
3883
  }
@@ -4567,16 +4606,51 @@ var data_model_DataModel = /** @class */ (function (_super) {
4567
4606
  DataModel.prototype.getAggrFunctions = function () {
4568
4607
  return this.aggrFunctions;
4569
4608
  };
4609
+ /**
4610
+ * Checks wether macro value is date.
4611
+ * @param macroExpr The macro value.
4612
+ * @retruns `true` if the macro value is date, otherwise `false`.
4613
+ */
4614
+ DataModel.prototype.isDateMacro = function (macroExpr, macroProcessor) {
4615
+ var match = macroExpr.match(/\${{?(.*?)}?}/);
4616
+ if (match != null) {
4617
+ var macroId = match[1];
4618
+ if (public_api["l" /* utils */].indexOfArrayItem(this.dateMacros, macroId) >= 0) {
4619
+ if (macroProcessor) {
4620
+ macroProcessor(macroId);
4621
+ }
4622
+ return true;
4623
+ }
4624
+ }
4625
+ return false;
4626
+ };
4627
+ /**
4628
+ * Checks whether the expression passed in the parameter is an time macro.
4629
+ * @param macroExpr The macro expression
4630
+ * @retruns `true` if the expression is a time macro (like Now), otherwise `false`.
4631
+ */
4632
+ DataModel.prototype.isTimeMacro = function (macroExpr, macroProcessor) {
4633
+ var match = macroExpr.match(/\${{?(.*?)}?}/);
4634
+ if (match != null) {
4635
+ var macroId = match[1];
4636
+ if (public_api["l" /* utils */].indexOfArrayItem(this.timeMacros, macroId) >= 0) {
4637
+ if (macroProcessor) {
4638
+ macroProcessor(macroId);
4639
+ }
4640
+ return true;
4641
+ }
4642
+ }
4643
+ return false;
4644
+ };
4570
4645
  /**
4571
4646
  * Gets date by its macro value.
4572
- * @param macro The macro value.
4647
+ * @param macroExpr The macro value.
4573
4648
  * @returns The date or `null`
4574
4649
  */
4575
- DataModel.prototype.getDateMacroValue = function (macro) {
4576
- if (this.isDateMacro(macro)) {
4577
- var d = new Date();
4578
- var macroName = macro.match(/\${{(.*?)}}/)[1];
4579
- switch (macroName) {
4650
+ DataModel.prototype.getDateMacroValue = function (macroExpr) {
4651
+ var d = new Date();
4652
+ var res = this.isDateMacro(macroExpr, function (macroId) {
4653
+ switch (macroId) {
4580
4654
  case 'Today':
4581
4655
  break;
4582
4656
  case 'Yesterday':
@@ -4623,37 +4697,27 @@ var data_model_DataModel = /** @class */ (function (_super) {
4623
4697
  break;
4624
4698
  }
4625
4699
  ;
4626
- return d;
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;
4700
+ });
4701
+ return res ? d : null;
4637
4702
  };
4638
4703
  /**
4639
- * Gets date or macro by macro value.
4640
- * @param macroValue The macro value.
4704
+ * Gets the date value by a macro expression of the expression itself.
4705
+ * @param macroExpr The macro value.
4641
4706
  * @returns The date or macro valu.
4642
4707
  */
4643
- DataModel.prototype.getDateOrMacroValue = function (macroValue) {
4644
- var d = this.getDateMacroValue(macroValue);
4645
- return d ? d : macroValue;
4708
+ DataModel.prototype.getDateOrMacroValue = function (macroExpr) {
4709
+ var d = this.getDateMacroValue(macroExpr);
4710
+ return d ? d : macroExpr;
4646
4711
  };
4647
4712
  /**
4648
4713
  * Gets time by its macro value.
4649
- * @param macro The macro value.
4714
+ * @param macroExpr The macro value.
4650
4715
  * @returns The date or `null`.
4651
4716
  */
4652
- DataModel.prototype.getTimeMacroValue = function (macro) {
4717
+ DataModel.prototype.getTimeMacroValue = function (macroExpr) {
4653
4718
  var d = new Date();
4654
- if (this.isTimeMacro(macro)) {
4655
- var macroName = macro.match(/\${{(.*?)}}/)[1];
4656
- switch (macroName) {
4719
+ var res = this.isDateMacro(macroExpr, function (macroId) {
4720
+ switch (macroId) {
4657
4721
  case 'Now':
4658
4722
  break;
4659
4723
  case 'HourStart':
@@ -4667,17 +4731,8 @@ var data_model_DataModel = /** @class */ (function (_super) {
4667
4731
  break;
4668
4732
  }
4669
4733
  ;
4670
- return d;
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;
4734
+ });
4735
+ return res ? d : null;
4681
4736
  };
4682
4737
  /**
4683
4738
  * Gets time or macro by macro value.
@@ -4688,10 +4743,10 @@ var data_model_DataModel = /** @class */ (function (_super) {
4688
4743
  var t = this.getTimeMacroValue(time);
4689
4744
  return t ? t : time;
4690
4745
  };
4691
- /**
4692
- * Gets all date marcos.
4693
- * @returns The array of marcos
4694
- */
4746
+ // /**
4747
+ // * Gets all date marcos.
4748
+ // * @returns The array of marcos
4749
+ // */
4695
4750
  DataModel.prototype.getAllDateMacros = function () {
4696
4751
  return this.dateMacros;
4697
4752
  };
@@ -6366,12 +6421,12 @@ var query_Query = /** @class */ (function () {
6366
6421
  if (column.isJustSorted())
6367
6422
  return;
6368
6423
  args = args || {};
6369
- if (typeof args.caption !== 'undefined') {
6370
- column.caption = args.caption;
6371
- }
6424
+ column.caption = (typeof args.caption !== 'undefined')
6425
+ ? args.caption
6426
+ : '';
6372
6427
  if (tag === ExprTag.AggregateFunction) {
6373
6428
  if (!args.funcId)
6374
- throw Error("'funcId' argument is not defined");
6429
+ throw Error('"funcId" argument is not defined');
6375
6430
  if (column.expr.tag == ExprTag.AggregateFunction) {
6376
6431
  column.expr.func = args.funcId;
6377
6432
  return;
@@ -7021,9 +7076,14 @@ var EqServerDataFetcher = /** @class */ (function () {
7021
7076
  var query = fetchOptions.query || this.context.getQuery();
7022
7077
  var queryId = query.getId();
7023
7078
  var requestData = {
7024
- 'query': query.toJSONData(),
7025
7079
  'options': fetchOptions.options
7026
7080
  };
7081
+ if (typeof (fetchOptions.queryId) !== 'undefined') {
7082
+ requestData.queryId = fetchOptions.queryId;
7083
+ }
7084
+ else {
7085
+ requestData.query = query.toJSONData();
7086
+ }
7027
7087
  if (fetchOptions.debug) {
7028
7088
  requestData.debug = fetchOptions.debug;
7029
7089
  }
@@ -7505,18 +7565,23 @@ var EqServerExporter = /** @class */ (function () {
7505
7565
  this.format = format;
7506
7566
  this.responseType = responseType;
7507
7567
  };
7508
- EqServerExporter.prototype.export = function (options) {
7509
- options = options || {};
7568
+ EqServerExporter.prototype.export = function (exportOptions) {
7569
+ exportOptions = exportOptions || {};
7510
7570
  var http = this.context.getServices().getHttpClient();
7511
7571
  var format = this.format || "csv";
7512
- var query = options.query || this.context.getQuery();
7572
+ var query = exportOptions.query || this.context.getQuery();
7513
7573
  var modelId = query.getModel().getId();
7514
- var data = {
7515
- 'query': query.toJSONData(),
7516
- 'settings': options.settings,
7574
+ var requestData = {
7575
+ 'settings': exportOptions.settings,
7517
7576
  };
7577
+ if (typeof (exportOptions.queryId) !== 'undefined') {
7578
+ requestData.queryId = exportOptions.queryId;
7579
+ }
7580
+ else {
7581
+ requestData.query = query.toJSONData();
7582
+ }
7518
7583
  var url = this.context.resolveEndpoint('ExportResult', { modelId: modelId, format: format });
7519
- var actionResult = http.post(url, data, { responseType: this.responseType });
7584
+ var actionResult = http.post(url, requestData, { responseType: this.responseType });
7520
7585
  var request = actionResult.getRequest();
7521
7586
  return actionResult.then(function (responseData) {
7522
7587
  var blob = new Blob([responseData]);
@@ -7576,10 +7641,11 @@ var context_assign = (undefined && undefined.__assign) || function () {
7576
7641
  var context_EqContext = /** @class */ (function () {
7577
7642
  function EqContext() {
7578
7643
  var _this = this;
7579
- this.isInitialized = false;
7644
+ this.servicesInitialized = false;
7580
7645
  this.internalListCache = {};
7581
7646
  this.loadModelOnStart = true;
7582
7647
  this.loadQueryOnStart = false;
7648
+ this.useStoredQueryOnFetch = false;
7583
7649
  this.debugMode = false;
7584
7650
  //----------- endpoint processing functions --------------
7585
7651
  this.endpointVarsRegex = /\{.*?\}/g;
@@ -7587,18 +7653,16 @@ var context_EqContext = /** @class */ (function () {
7587
7653
  this._predefinedListRequestHandlers = {
7588
7654
  '_DSDE': function (params, onResult) {
7589
7655
  var data = _this.getModel().getAllDateMacros()
7590
- .map(function (macro) {
7591
- var macroName = macro.match(/\${{(.*?)}}/)[1];
7592
- return { id: macro, text: public_api["k" /* i18n */].getText(macroName) };
7656
+ .map(function (macroId) {
7657
+ return { id: '${{' + macroId + '}}', text: public_api["k" /* i18n */].getText(macroId) };
7593
7658
  });
7594
7659
  onResult(data);
7595
7660
  return true;
7596
7661
  },
7597
7662
  '_DSTE': function (params, onResult) {
7598
7663
  var data = _this.getModel().getAllTimeMacros()
7599
- .map(function (macro) {
7600
- var macroName = macro.match(/\${{(.*?)}}/)[1];
7601
- return { id: macro, text: public_api["k" /* i18n */].getText(macroName) };
7664
+ .map(function (macroId) {
7665
+ return { id: '${{' + macroId + '}}', text: public_api["k" /* i18n */].getText(macroId) };
7602
7666
  });
7603
7667
  onResult(data);
7604
7668
  return true;
@@ -7667,6 +7731,15 @@ var context_EqContext = /** @class */ (function () {
7667
7731
  loader: this.dataLoader
7668
7732
  });
7669
7733
  this.resultTable.id = 'ResultTable';
7734
+ this.errorHandlerId = this.addEventListener('error', function (context, status) {
7735
+ status.result = EqActionResult.Error;
7736
+ var msgTitle = status.action ? status.action + ' error' : 'Error';
7737
+ var msgText = status.text ? status.text : '';
7738
+ if (status.sourceError && status.sourceError.message !== msgText) {
7739
+ msgText += '\n' + status.sourceError;
7740
+ }
7741
+ console.error(msgTitle + ': ' + msgText);
7742
+ });
7670
7743
  }
7671
7744
  EqContext.prototype.getServices = function () {
7672
7745
  return this.eqServices;
@@ -7744,13 +7817,17 @@ var context_EqContext = /** @class */ (function () {
7744
7817
  this.setEnpointIfNotExist('GetQueryFile', utils_equtils.combinePath(endpointBase, 'models/{modelId}/getqueryfile/{format}'));
7745
7818
  this.setEnpointIfNotExist('UploadQueryFile', utils_equtils.combinePath(endpointBase, 'models/{modelId}/uploadqueryfile'));
7746
7819
  };
7820
+ EqContext.prototype.initStart = function () {
7821
+ this.servicesInitialized = true;
7822
+ };
7747
7823
  /**
7748
7824
  * Initializes the context
7749
7825
  * @param options
7750
7826
  */
7751
7827
  EqContext.prototype.init = function (options) {
7752
7828
  var _this = this;
7753
- this.isInitialized = true;
7829
+ if (!this.servicesInitialized)
7830
+ this.initStart();
7754
7831
  options = options || {};
7755
7832
  if (typeof (options.debugMode) !== 'undefined') {
7756
7833
  this.debugMode = options.debugMode;
@@ -7760,7 +7837,6 @@ var context_EqContext = /** @class */ (function () {
7760
7837
  }
7761
7838
  if (typeof (options.elasticPaging) !== 'undefined') {
7762
7839
  this.elasticPaging = options.elasticPaging;
7763
- this.resultTable.elasticChunks = this.elasticPaging;
7764
7840
  }
7765
7841
  if (options.listCache) {
7766
7842
  this.setExternalListCache(options.listCache);
@@ -7811,19 +7887,9 @@ var context_EqContext = /** @class */ (function () {
7811
7887
  this.addEventListener('processEnd', options.handlers.onProcessEnd);
7812
7888
  }
7813
7889
  if (options.handlers.onError) {
7890
+ this.removeEventListener('error', this.errorHandlerId);
7814
7891
  this.addEventListener('error', options.handlers.onError);
7815
7892
  }
7816
- else {
7817
- this.addEventListener('error', function (context, msg) {
7818
- msg.result = EqActionResult.Error;
7819
- var msgTitle = msg && msg ? msg.action + ' error' : 'Error';
7820
- var msgText = msg && msg.text ? msg.text : '';
7821
- if (msg.sourceError.message !== msgText) {
7822
- msgText += '\n' + msg.sourceError;
7823
- }
7824
- console.error(msgTitle + ': ' + msgText);
7825
- });
7826
- }
7827
7893
  if (options.handlers.onListRequest) {
7828
7894
  this.clientListRequestHandler = options.handlers.onListRequest;
7829
7895
  }
@@ -7957,7 +8023,7 @@ var context_EqContext = /** @class */ (function () {
7957
8023
  */
7958
8024
  EqContext.prototype.getQuery = function () {
7959
8025
  if (!this.query) {
7960
- if (!this.isInitialized) {
8026
+ if (!this.servicesInitialized) {
7961
8027
  throw new Error("Can't create query until the context is initialized");
7962
8028
  }
7963
8029
  this.query = this.createQuery();
@@ -8620,11 +8686,15 @@ var context_EqContext = /** @class */ (function () {
8620
8686
  EqContext.prototype.fetchData = function (options) {
8621
8687
  var _this = this;
8622
8688
  options = options || {};
8689
+ var elasticPaging = typeof (options.elasticPaging) !== 'undefined'
8690
+ ? options.elasticPaging
8691
+ : this.elasticPaging;
8692
+ this.resultTable.elasticChunks = elasticPaging;
8623
8693
  options.chunk = options.chunk ||
8624
8694
  {
8625
8695
  offset: 0,
8626
8696
  limit: this.resultTable.chunkSize,
8627
- needTotal: !this.elasticPaging
8697
+ needTotal: !elasticPaging
8628
8698
  };
8629
8699
  if (this.debugMode) {
8630
8700
  options.debug = 'Fetching the result set. Initial chunk';
@@ -8745,6 +8815,10 @@ var context_EqContext = /** @class */ (function () {
8745
8815
  this.beforeFetchData(this, options);
8746
8816
  }
8747
8817
  var queryId = this.getQuery().getId();
8818
+ var fetchOptions = options || {};
8819
+ if (this.useStoredQueryOnFetch) {
8820
+ fetchOptions.queryId = this.query.getId();
8821
+ }
8748
8822
  this.startProcess({
8749
8823
  action: EqAction.FetchData,
8750
8824
  text: 'Fetching data for the query: ' + queryId
@@ -8879,6 +8953,9 @@ var context_EqContext = /** @class */ (function () {
8879
8953
  var exporter = this.getExporter(format);
8880
8954
  if (exporter) {
8881
8955
  var queryId_1 = this.getQuery().getId();
8956
+ if (this.useStoredQueryOnFetch) {
8957
+ options.queryId = queryId_1;
8958
+ }
8882
8959
  this.startProcess({
8883
8960
  action: EqAction.ExportResult,
8884
8961
  text: 'Exporting result for query: ' + queryId_1