@easyquery/core 7.2.0-rc06 → 7.2.1-rc02

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.
@@ -1399,15 +1399,29 @@ var http_client_HttpClient = /** @class */ (function () {
1399
1399
  return new HttpActionResult(request, new Promise(function (resolve, reject) {
1400
1400
  if (options.responseType)
1401
1401
  xhr.responseType = options.responseType;
1402
+ xhr.onerror = function (error) {
1403
+ reject(new HttpResponseError(xhr.status, xhr.responseText));
1404
+ };
1402
1405
  xhr.onreadystatechange = function () {
1403
- if (xhr.readyState != 4) {
1404
- return;
1405
- }
1406
+ if (xhr.readyState != 4)
1407
+ return; //we process only the state change to DONE(4)
1406
1408
  var responseContentType = xhr.getResponseHeader('Content-Type') || '';
1407
1409
  var status = xhr.status;
1408
- if (status >= 400) {
1409
- var rtPromise = (xhr.responseType === 'arraybuffer'
1410
- || xhr.responseType === 'blob')
1410
+ if (status === 0) {
1411
+ reject(new HttpResponseError(status, "Network error or the request was aborted"));
1412
+ }
1413
+ else if (status >= 200 && status < 400) {
1414
+ //Success
1415
+ var responseObj = (xhr.responseType === 'arraybuffer' || xhr.responseType === 'blob')
1416
+ ? xhr.response
1417
+ : (responseContentType.indexOf('application/json') == 0
1418
+ ? JSON.parse(xhr.responseText)
1419
+ : xhr.responseText);
1420
+ resolve(responseObj);
1421
+ }
1422
+ else {
1423
+ //Error
1424
+ var rtPromise = (xhr.responseType === 'arraybuffer' || xhr.responseType === 'blob')
1411
1425
  ? HttpClient.decodeArrayBuffer(xhr.response)
1412
1426
  : Promise.resolve(xhr.responseText);
1413
1427
  rtPromise.then(function (responseText) {
@@ -1420,14 +1434,7 @@ var http_client_HttpClient = /** @class */ (function () {
1420
1434
  : responseObj);
1421
1435
  reject(new HttpResponseError(status, message));
1422
1436
  });
1423
- return;
1424
1437
  }
1425
- var responseObj = (xhr.responseType === 'arraybuffer' || xhr.responseType === 'blob')
1426
- ? xhr.response
1427
- : (responseContentType.indexOf('application/json') == 0)
1428
- ? JSON.parse(xhr.responseText)
1429
- : xhr.responseText;
1430
- resolve(responseObj);
1431
1438
  };
1432
1439
  xhr.send(dataToSend);
1433
1440
  }));
@@ -3873,6 +3880,7 @@ var data_model_extends = (undefined && undefined.__extends) || (function () {
3873
3880
 
3874
3881
 
3875
3882
 
3883
+
3876
3884
  /**
3877
3885
  * Represents a data model
3878
3886
  */
@@ -3972,6 +3980,13 @@ var data_model_DataModel = /** @class */ (function (_super) {
3972
3980
  DataModel.prototype.createEntityAttr = function (parent) {
3973
3981
  return new EntityAttr(parent);
3974
3982
  };
3983
+ /**
3984
+ * Creates new EqValueEditor
3985
+ * @returns An instance of EqValueEditor class
3986
+ */
3987
+ DataModel.prototype.createValueEditor = function () {
3988
+ return new EqValueEditor();
3989
+ };
3975
3990
  /**
3976
3991
  * Creates query.
3977
3992
  * @returns The Query.
@@ -7750,49 +7765,49 @@ var context_EqContext = /** @class */ (function () {
7750
7765
  return true;
7751
7766
  }
7752
7767
  };
7753
- this._listRequestHandler = function (params, onResult) {
7754
- if (params == null || !params.listName)
7768
+ this._listRequestHandler = function (options, onResult) {
7769
+ if (options == null || !options.listName)
7755
7770
  return;
7756
7771
  var query = _this.getQuery();
7757
- var newParams = public_api["l" /* utils */].assign({ listName: params.listName }, params.editorParams);
7758
- var procParams = {};
7772
+ var params = public_api["l" /* utils */].assign({ listName: options.listName }, options.editorParams);
7773
+ var reqParams = {};
7759
7774
  var attrPattern = /@{{(.+?)}}/;
7760
- for (var prop in newParams) {
7761
- if (!procParams[prop])
7775
+ for (var prop in params) {
7776
+ if (!params[prop])
7762
7777
  continue;
7763
- var dynamicParam = newParams[prop].match(attrPattern);
7764
- if (dynamicParam) {
7765
- var paramValue = query.getOneValueForAttr(dynamicParam[1]);
7778
+ var match = params[prop].match(attrPattern);
7779
+ if (match) {
7780
+ var paramValue = query.getOneValueForAttr(match[1]);
7766
7781
  if (!paramValue) {
7767
7782
  paramValue = '';
7768
7783
  }
7769
- procParams[prop] = newParams[prop].replace(attrPattern, paramValue);
7784
+ reqParams[prop] = params[prop].replace(attrPattern, paramValue);
7770
7785
  }
7771
7786
  }
7772
7787
  var requestParams = {
7773
- listName: procParams.listName,
7774
- editorId: params.editorId,
7775
- queryParams: procParams
7788
+ listName: reqParams.listName,
7789
+ editorId: options.editorId,
7790
+ queryParams: reqParams
7776
7791
  };
7777
- var list = _this.getListFromCache(params);
7792
+ var list = _this.getListFromCache(options);
7778
7793
  if (list && list.length > 0) {
7779
7794
  onResult(list);
7780
7795
  return;
7781
7796
  }
7782
7797
  var processed = false;
7783
- var predefinedHandler = _this._predefinedListRequestHandlers[params.editorId];
7798
+ var predefinedHandler = _this._predefinedListRequestHandlers[options.editorId];
7784
7799
  if (predefinedHandler) {
7785
- processed = predefinedHandler(params, onResult);
7800
+ processed = predefinedHandler(options, onResult);
7786
7801
  }
7787
7802
  if (!processed && _this.clientListRequestHandler) {
7788
- processed = _this.clientListRequestHandler(params, onResult);
7803
+ processed = _this.clientListRequestHandler(options, onResult);
7789
7804
  }
7790
7805
  if (!processed) {
7791
7806
  _this.loadValueList({
7792
7807
  params: requestParams,
7793
7808
  success: function (data) {
7794
7809
  if (data) {
7795
- _this.addListToCache(params, data);
7810
+ _this.addListToCache(options, data);
7796
7811
  }
7797
7812
  onResult(data);
7798
7813
  },