@easyquery/core 7.2.2-rc01 → 7.2.2-rc04

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -655,7 +655,7 @@ var i18n_i18n;
655
655
  }
656
656
  else if (['D', 'F', 'C'].indexOf(type) >= 0) {
657
657
  var locale = getCurrentLocale();
658
- return number.toLocaleString(locale, getNumberFromatOptions(format));
658
+ return number.toLocaleString(locale, getNumberFormatOptions(format));
659
659
  }
660
660
  else {
661
661
  return convertWithMask(Math.trunc(number), format);
@@ -731,7 +731,7 @@ var i18n_i18n;
731
731
  }
732
732
  return result.split('').reverse().join('');
733
733
  }
734
- function getNumberFromatOptions(format) {
734
+ function getNumberFormatOptions(format) {
735
735
  var localeSettings = getLocaleSettings();
736
736
  var type = format[0].toUpperCase();
737
737
  var digits = (format.length > 1)
@@ -753,7 +753,8 @@ var i18n_i18n;
753
753
  default:
754
754
  return {
755
755
  style: 'decimal',
756
- minimumFractionDigits: digits
756
+ minimumFractionDigits: digits,
757
+ maximumFractionDigits: digits
757
758
  };
758
759
  }
759
760
  }
@@ -1349,6 +1350,14 @@ var http_client_HttpClient = /** @class */ (function () {
1349
1350
  this.defaultHeaders = {};
1350
1351
  this.customPayload = undefined;
1351
1352
  }
1353
+ Object.defineProperty(HttpClient.prototype, "responseBody", {
1354
+ /** Gets the response body for the latest request */
1355
+ get: function () {
1356
+ return this._responseBody;
1357
+ },
1358
+ enumerable: true,
1359
+ configurable: true
1360
+ });
1352
1361
  HttpClient.prototype.get = function (url, options) {
1353
1362
  return this.send(HttpMethod.Get, url, null, options);
1354
1363
  };
@@ -1362,6 +1371,7 @@ var http_client_HttpClient = /** @class */ (function () {
1362
1371
  return this.send(HttpMethod.Delete, url, data, options);
1363
1372
  };
1364
1373
  HttpClient.prototype.send = function (method, url, data, options) {
1374
+ var _this = this;
1365
1375
  options = options || {};
1366
1376
  var dataType = options.dataType || 'json';
1367
1377
  var contentType = options.contentType || (dataType !== 'form-data')
@@ -1417,6 +1427,10 @@ var http_client_HttpClient = /** @class */ (function () {
1417
1427
  : (responseContentType.indexOf('application/json') == 0
1418
1428
  ? JSON.parse(xhr.responseText)
1419
1429
  : xhr.responseText);
1430
+ _this._responseBody = responseObj;
1431
+ if (_this.onResponse) {
1432
+ _this.onResponse(xhr);
1433
+ }
1420
1434
  resolve(responseObj);
1421
1435
  }
1422
1436
  else {
@@ -1428,6 +1442,7 @@ var http_client_HttpClient = /** @class */ (function () {
1428
1442
  var responseObj = (responseContentType.indexOf('application/json') == 0)
1429
1443
  ? JSON.parse(responseText)
1430
1444
  : responseText;
1445
+ _this._responseBody = responseObj;
1431
1446
  var message = responseObj.message ||
1432
1447
  (status == 404
1433
1448
  ? "No such endpoint: " + url
@@ -1577,7 +1592,8 @@ var meta_entity_MetaEntityAttr = /** @class */ (function () {
1577
1592
  this.lookupEntity = dto.lent;
1578
1593
  this.dataAttr = dto.dattr;
1579
1594
  this.lookupDataAttr = dto.ldattr;
1580
- this.defaultValue = dto.defVal;
1595
+ var isDataType = utils_utils.getDateDataTypes().indexOf(this.dataType);
1596
+ this.defaultValue = dto.defVal && isDataType ? new Date(dto.defVal) : dto.defVal;
1581
1597
  this.isNullable = utils_utils.getIfDefined(dto.nul, this.isNullable);
1582
1598
  this.isEditable = utils_utils.getIfDefined(dto.ied, this.isEditable);
1583
1599
  this.showOnView = utils_utils.getIfDefined(dto.ivis || dto.sov, this.showOnView);
@@ -7227,8 +7243,10 @@ var EqQueryFileLoader = /** @class */ (function () {
7227
7243
  var request = actionResult.getRequest();
7228
7244
  return actionResult.then(function (responseData) {
7229
7245
  var blob = new Blob([responseData]);
7230
- var fileName = request.getXMLHttpRequest()
7231
- .getResponseHeader("Content-Disposition").match(/filename="(.*)"/)[1];
7246
+ var dispositionHeader = request.getXMLHttpRequest().getResponseHeader("Content-Disposition");
7247
+ var fileName = dispositionHeader
7248
+ ? dispositionHeader.match(/filename="(.*)"/)[1]
7249
+ : 'query.json';
7232
7250
  if (options.fileName) {
7233
7251
  fileName = options.fileName
7234
7252
  + fileName.substring(fileName.lastIndexOf('.'));
@@ -7677,13 +7695,18 @@ var EqServerExporter = /** @class */ (function () {
7677
7695
  else {
7678
7696
  requestData.query = query.toJSONData();
7679
7697
  }
7698
+ if (exportOptions.data) {
7699
+ requestData.data = exportOptions.data;
7700
+ }
7680
7701
  var url = this.context.resolveEndpoint('ExportResult', { modelId: modelId, format: format });
7681
7702
  var actionResult = http.post(url, requestData, { responseType: this.responseType });
7682
7703
  var request = actionResult.getRequest();
7683
7704
  return actionResult.then(function (responseData) {
7684
7705
  var blob = new Blob([responseData]);
7685
- var filename = request.getXMLHttpRequest()
7686
- .getResponseHeader("Content-Disposition").match(/filename="(.*)"/)[1];
7706
+ var dispositionHeader = request.getXMLHttpRequest().getResponseHeader("Content-Disposition");
7707
+ var filename = dispositionHeader
7708
+ ? dispositionHeader.match(/filename="(.*)"/)[1]
7709
+ : 'export-data.' + format;
7687
7710
  if (window.navigator['msSaveOrOpenBlob']) {
7688
7711
  // Internet Explorer
7689
7712
  window.navigator['msSaveOrOpenBlob'](blob, filename);
@@ -8816,7 +8839,7 @@ var context_EqContext = /** @class */ (function () {
8816
8839
  /**
8817
8840
  * Fetches the data (usuall by executing current query) and processes the result.
8818
8841
  * @param options
8819
- * The `options` parameter in addition to the options defined in ExecuteQueryOptions structure may also contain `success` and `error` callbacks.
8842
+ * The `options` parameter in addition to the options defined in FetchDataOptions structure may also contain `success` and `error` callbacks.
8820
8843
  * @example
8821
8844
  * context.fetchData({ success: function(result) {
8822
8845
  * //do whatever you want with the result