@easyquery/core 7.2.2-rc02 → 7.2.2-rc03

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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
@@ -7228,8 +7243,10 @@ var EqQueryFileLoader = /** @class */ (function () {
7228
7243
  var request = actionResult.getRequest();
7229
7244
  return actionResult.then(function (responseData) {
7230
7245
  var blob = new Blob([responseData]);
7231
- var fileName = request.getXMLHttpRequest()
7232
- .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';
7233
7250
  if (options.fileName) {
7234
7251
  fileName = options.fileName
7235
7252
  + fileName.substring(fileName.lastIndexOf('.'));
@@ -7686,8 +7703,10 @@ var EqServerExporter = /** @class */ (function () {
7686
7703
  var request = actionResult.getRequest();
7687
7704
  return actionResult.then(function (responseData) {
7688
7705
  var blob = new Blob([responseData]);
7689
- var filename = request.getXMLHttpRequest()
7690
- .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;
7691
7710
  if (window.navigator['msSaveOrOpenBlob']) {
7692
7711
  // Internet Explorer
7693
7712
  window.navigator['msSaveOrOpenBlob'](blob, filename);
@@ -8820,7 +8839,7 @@ var context_EqContext = /** @class */ (function () {
8820
8839
  /**
8821
8840
  * Fetches the data (usuall by executing current query) and processes the result.
8822
8841
  * @param options
8823
- * 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.
8824
8843
  * @example
8825
8844
  * context.fetchData({ success: function(result) {
8826
8845
  * //do whatever you want with the result