@easyquery/enterprise 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.
@@ -1490,7 +1490,7 @@ var i18n_i18n;
1490
1490
  }
1491
1491
  else if (['D', 'F', 'C'].indexOf(type) >= 0) {
1492
1492
  var locale = getCurrentLocale();
1493
- return number.toLocaleString(locale, getNumberFromatOptions(format));
1493
+ return number.toLocaleString(locale, getNumberFormatOptions(format));
1494
1494
  }
1495
1495
  else {
1496
1496
  return convertWithMask(Math.trunc(number), format);
@@ -1566,7 +1566,7 @@ var i18n_i18n;
1566
1566
  }
1567
1567
  return result.split('').reverse().join('');
1568
1568
  }
1569
- function getNumberFromatOptions(format) {
1569
+ function getNumberFormatOptions(format) {
1570
1570
  var localeSettings = getLocaleSettings();
1571
1571
  var type = format[0].toUpperCase();
1572
1572
  var digits = (format.length > 1)
@@ -1588,7 +1588,8 @@ var i18n_i18n;
1588
1588
  default:
1589
1589
  return {
1590
1590
  style: 'decimal',
1591
- minimumFractionDigits: digits
1591
+ minimumFractionDigits: digits,
1592
+ maximumFractionDigits: digits
1592
1593
  };
1593
1594
  }
1594
1595
  }
@@ -2184,6 +2185,14 @@ var http_client_HttpClient = /** @class */ (function () {
2184
2185
  this.defaultHeaders = {};
2185
2186
  this.customPayload = undefined;
2186
2187
  }
2188
+ Object.defineProperty(HttpClient.prototype, "responseBody", {
2189
+ /** Gets the response body for the latest request */
2190
+ get: function () {
2191
+ return this._responseBody;
2192
+ },
2193
+ enumerable: true,
2194
+ configurable: true
2195
+ });
2187
2196
  HttpClient.prototype.get = function (url, options) {
2188
2197
  return this.send(HttpMethod.Get, url, null, options);
2189
2198
  };
@@ -2197,6 +2206,7 @@ var http_client_HttpClient = /** @class */ (function () {
2197
2206
  return this.send(HttpMethod.Delete, url, data, options);
2198
2207
  };
2199
2208
  HttpClient.prototype.send = function (method, url, data, options) {
2209
+ var _this = this;
2200
2210
  options = options || {};
2201
2211
  var dataType = options.dataType || 'json';
2202
2212
  var contentType = options.contentType || (dataType !== 'form-data')
@@ -2252,6 +2262,10 @@ var http_client_HttpClient = /** @class */ (function () {
2252
2262
  : (responseContentType.indexOf('application/json') == 0
2253
2263
  ? JSON.parse(xhr.responseText)
2254
2264
  : xhr.responseText);
2265
+ _this._responseBody = responseObj;
2266
+ if (_this.onResponse) {
2267
+ _this.onResponse(xhr);
2268
+ }
2255
2269
  resolve(responseObj);
2256
2270
  }
2257
2271
  else {
@@ -2263,6 +2277,7 @@ var http_client_HttpClient = /** @class */ (function () {
2263
2277
  var responseObj = (responseContentType.indexOf('application/json') == 0)
2264
2278
  ? JSON.parse(responseText)
2265
2279
  : responseText;
2280
+ _this._responseBody = responseObj;
2266
2281
  var message = responseObj.message ||
2267
2282
  (status == 404
2268
2283
  ? "No such endpoint: " + url
@@ -2412,7 +2427,8 @@ var meta_entity_MetaEntityAttr = /** @class */ (function () {
2412
2427
  this.lookupEntity = dto.lent;
2413
2428
  this.dataAttr = dto.dattr;
2414
2429
  this.lookupDataAttr = dto.ldattr;
2415
- this.defaultValue = dto.defVal;
2430
+ var isDataType = utils_utils.getDateDataTypes().indexOf(this.dataType);
2431
+ this.defaultValue = dto.defVal && isDataType ? new Date(dto.defVal) : dto.defVal;
2416
2432
  this.isNullable = utils_utils.getIfDefined(dto.nul, this.isNullable);
2417
2433
  this.isEditable = utils_utils.getIfDefined(dto.ied, this.isEditable);
2418
2434
  this.showOnView = utils_utils.getIfDefined(dto.ivis || dto.sov, this.showOnView);
@@ -4815,7 +4831,7 @@ var CellRendererType;
4815
4831
  })(CellRendererType || (CellRendererType = {}));
4816
4832
  var StringCellRendererDefault = function (value, column, cellValueElement, rowElement) {
4817
4833
  var text = value ? value.toString().replace(/\n/g, '\u21B5 ') : '';
4818
- cellValueElement.innerHTML = text;
4834
+ cellValueElement.innerText = text;
4819
4835
  cellValueElement.title = text;
4820
4836
  if (column.align == GridColumnAlign.NONE) {
4821
4837
  cellValueElement.classList.add(cssPrefix + "-cell-value-align-left");
@@ -4834,7 +4850,7 @@ var NumberCellRendererDefault = function (value, column, cellValueElement, rowEl
4834
4850
  strValue = value.toLocaleString();
4835
4851
  }
4836
4852
  }
4837
- cellValueElement.innerHTML = strValue;
4853
+ cellValueElement.innerText = strValue;
4838
4854
  cellValueElement.title = strValue;
4839
4855
  if (column.align == GridColumnAlign.NONE) {
4840
4856
  cellValueElement.classList.add(cssPrefix + "-cell-value-align-right");
@@ -4866,7 +4882,7 @@ var DateTimeCellRendererDefault = function (value, column, cellValueElement, row
4866
4882
  }
4867
4883
  }
4868
4884
  }
4869
- cellValueElement.innerHTML = strValue;
4885
+ cellValueElement.innerText = strValue;
4870
4886
  cellValueElement.title = strValue;
4871
4887
  if (column.align == GridColumnAlign.NONE) {
4872
4888
  cellValueElement.classList.add(cssPrefix + "-cell-value-align-right");
@@ -5125,7 +5141,9 @@ var easy_grid_spreadArrays = (undefined && undefined.__spreadArrays) || function
5125
5141
 
5126
5142
  var DEFAULT_ROW_HEIGHT = 36;
5127
5143
  var DEFAULT_ROW_COUNT = 15;
5144
+ /** Represents a grid widget with columns rows, paging, custom rendering and more */
5128
5145
  var easy_grid_EasyGrid = /** @class */ (function () {
5146
+ /** Creates and initializes all internal properties of the grid object */
5129
5147
  function EasyGrid(options) {
5130
5148
  this.cssPrefix = "keg";
5131
5149
  this.pagination = { page: 1, pageSize: 30, total: 0 };
@@ -5244,6 +5262,7 @@ var easy_grid_EasyGrid = /** @class */ (function () {
5244
5262
  widthOptions[dataType] = easy_grid_assign(easy_grid_assign({}, widthOptions.otherColumns), widthOptions[dataType]);
5245
5263
  }
5246
5264
  });
5265
+ widthOptions[DataType.Unknown] = widthOptions.otherColumns;
5247
5266
  };
5248
5267
  EasyGrid.prototype.setSlot = function (slot) {
5249
5268
  if (typeof slot === 'string') {
@@ -5266,6 +5285,7 @@ var easy_grid_EasyGrid = /** @class */ (function () {
5266
5285
  this.slot = slot;
5267
5286
  }
5268
5287
  };
5288
+ /** Initializes grid widget according to the options passed in the parameter */
5269
5289
  EasyGrid.prototype.init = function (options) {
5270
5290
  var _this = this;
5271
5291
  if (options.onInit) {
@@ -5329,6 +5349,10 @@ var easy_grid_EasyGrid = /** @class */ (function () {
5329
5349
  this.refresh();
5330
5350
  this.fireEvent('init');
5331
5351
  };
5352
+ /** Fires a grid event. You can pass either an event type
5353
+ * (like 'init', 'rowClick', 'pageChanged', etc )
5354
+ * or a ready-to-use grid event object
5355
+ * */
5332
5356
  EasyGrid.prototype.fireEvent = function (event) {
5333
5357
  if (typeof event === "string") {
5334
5358
  this.eventEmitter.fire(event);
@@ -5337,20 +5361,26 @@ var easy_grid_EasyGrid = /** @class */ (function () {
5337
5361
  this.eventEmitter.fire(event.type, event);
5338
5362
  }
5339
5363
  };
5364
+ /** Allows to set the data (represented by a EasyDataTable object)
5365
+ * or to replace the existing one associated with the grid */
5340
5366
  EasyGrid.prototype.setData = function (data) {
5341
5367
  this.dataTable = data;
5342
5368
  this.clear();
5343
5369
  this.refresh();
5344
5370
  };
5371
+ /** Returns the EasyDataTable object associated with the grid via `setData()` call */
5345
5372
  EasyGrid.prototype.getData = function () {
5346
5373
  return this.dataTable;
5347
5374
  };
5375
+ /** Gets the list of grid columns */
5348
5376
  EasyGrid.prototype.getColumns = function () {
5349
5377
  return this.columns;
5350
5378
  };
5379
+ /** This function is called when the grid is destroyed */
5351
5380
  EasyGrid.prototype.destroy = function () {
5352
5381
  this.slot.innerHTML = "";
5353
5382
  };
5383
+ /** Clears the current DOM object and re-renders everything from the scratch */
5354
5384
  EasyGrid.prototype.refresh = function () {
5355
5385
  this.clearDOM();
5356
5386
  this.render();
@@ -5358,10 +5388,12 @@ var easy_grid_EasyGrid = /** @class */ (function () {
5358
5388
  EasyGrid.prototype.clearDOM = function () {
5359
5389
  this.slot.innerHTML = '';
5360
5390
  };
5391
+ /** Clears all DOM object in the grid and return it to its initial state */
5361
5392
  EasyGrid.prototype.clear = function () {
5362
5393
  this.pagination.page = 1;
5363
5394
  this.clearDOM();
5364
5395
  };
5396
+ /** Renders the grid */
5365
5397
  EasyGrid.prototype.render = function () {
5366
5398
  var _this = this;
5367
5399
  if (!this.hasData() && !this.options.showPlusButton)
@@ -5916,6 +5948,7 @@ var easy_grid_EasyGrid = /** @class */ (function () {
5916
5948
  }
5917
5949
  return cellElement;
5918
5950
  };
5951
+ /** Sets current grid pages (if paging is used) */
5919
5952
  EasyGrid.prototype.setPage = function (page) {
5920
5953
  this.pagination.page = page;
5921
5954
  this.fireEvent({ type: "pageChanged", page: page });
@@ -6162,9 +6195,11 @@ var easy_grid_EasyGrid = /** @class */ (function () {
6162
6195
  return rows[index];
6163
6196
  return null;
6164
6197
  };
6198
+ /** Makes the grid focused for keyboard events */
6165
6199
  EasyGrid.prototype.focus = function () {
6166
6200
  this.bodyViewportDiv.focus();
6167
6201
  };
6202
+ /** Resizes columns according to the data they represent */
6168
6203
  EasyGrid.prototype.resizeColumns = function () {
6169
6204
  if (this.options.columnWidths.autoResize === AutoResizeColumns.Never)
6170
6205
  return;