@easyquery/enterprise 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.
@@ -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
@@ -5126,7 +5141,9 @@ var easy_grid_spreadArrays = (undefined && undefined.__spreadArrays) || function
5126
5141
 
5127
5142
  var DEFAULT_ROW_HEIGHT = 36;
5128
5143
  var DEFAULT_ROW_COUNT = 15;
5144
+ /** Represents a grid widget with columns rows, paging, custom rendering and more */
5129
5145
  var easy_grid_EasyGrid = /** @class */ (function () {
5146
+ /** Creates and initializes all internal properties of the grid object */
5130
5147
  function EasyGrid(options) {
5131
5148
  this.cssPrefix = "keg";
5132
5149
  this.pagination = { page: 1, pageSize: 30, total: 0 };
@@ -5245,6 +5262,7 @@ var easy_grid_EasyGrid = /** @class */ (function () {
5245
5262
  widthOptions[dataType] = easy_grid_assign(easy_grid_assign({}, widthOptions.otherColumns), widthOptions[dataType]);
5246
5263
  }
5247
5264
  });
5265
+ widthOptions[DataType.Unknown] = widthOptions.otherColumns;
5248
5266
  };
5249
5267
  EasyGrid.prototype.setSlot = function (slot) {
5250
5268
  if (typeof slot === 'string') {
@@ -5267,6 +5285,7 @@ var easy_grid_EasyGrid = /** @class */ (function () {
5267
5285
  this.slot = slot;
5268
5286
  }
5269
5287
  };
5288
+ /** Initializes grid widget according to the options passed in the parameter */
5270
5289
  EasyGrid.prototype.init = function (options) {
5271
5290
  var _this = this;
5272
5291
  if (options.onInit) {
@@ -5330,6 +5349,10 @@ var easy_grid_EasyGrid = /** @class */ (function () {
5330
5349
  this.refresh();
5331
5350
  this.fireEvent('init');
5332
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
+ * */
5333
5356
  EasyGrid.prototype.fireEvent = function (event) {
5334
5357
  if (typeof event === "string") {
5335
5358
  this.eventEmitter.fire(event);
@@ -5338,20 +5361,26 @@ var easy_grid_EasyGrid = /** @class */ (function () {
5338
5361
  this.eventEmitter.fire(event.type, event);
5339
5362
  }
5340
5363
  };
5364
+ /** Allows to set the data (represented by a EasyDataTable object)
5365
+ * or to replace the existing one associated with the grid */
5341
5366
  EasyGrid.prototype.setData = function (data) {
5342
5367
  this.dataTable = data;
5343
5368
  this.clear();
5344
5369
  this.refresh();
5345
5370
  };
5371
+ /** Returns the EasyDataTable object associated with the grid via `setData()` call */
5346
5372
  EasyGrid.prototype.getData = function () {
5347
5373
  return this.dataTable;
5348
5374
  };
5375
+ /** Gets the list of grid columns */
5349
5376
  EasyGrid.prototype.getColumns = function () {
5350
5377
  return this.columns;
5351
5378
  };
5379
+ /** This function is called when the grid is destroyed */
5352
5380
  EasyGrid.prototype.destroy = function () {
5353
5381
  this.slot.innerHTML = "";
5354
5382
  };
5383
+ /** Clears the current DOM object and re-renders everything from the scratch */
5355
5384
  EasyGrid.prototype.refresh = function () {
5356
5385
  this.clearDOM();
5357
5386
  this.render();
@@ -5359,10 +5388,12 @@ var easy_grid_EasyGrid = /** @class */ (function () {
5359
5388
  EasyGrid.prototype.clearDOM = function () {
5360
5389
  this.slot.innerHTML = '';
5361
5390
  };
5391
+ /** Clears all DOM object in the grid and return it to its initial state */
5362
5392
  EasyGrid.prototype.clear = function () {
5363
5393
  this.pagination.page = 1;
5364
5394
  this.clearDOM();
5365
5395
  };
5396
+ /** Renders the grid */
5366
5397
  EasyGrid.prototype.render = function () {
5367
5398
  var _this = this;
5368
5399
  if (!this.hasData() && !this.options.showPlusButton)
@@ -5917,6 +5948,7 @@ var easy_grid_EasyGrid = /** @class */ (function () {
5917
5948
  }
5918
5949
  return cellElement;
5919
5950
  };
5951
+ /** Sets current grid pages (if paging is used) */
5920
5952
  EasyGrid.prototype.setPage = function (page) {
5921
5953
  this.pagination.page = page;
5922
5954
  this.fireEvent({ type: "pageChanged", page: page });
@@ -6163,9 +6195,11 @@ var easy_grid_EasyGrid = /** @class */ (function () {
6163
6195
  return rows[index];
6164
6196
  return null;
6165
6197
  };
6198
+ /** Makes the grid focused for keyboard events */
6166
6199
  EasyGrid.prototype.focus = function () {
6167
6200
  this.bodyViewportDiv.focus();
6168
6201
  };
6202
+ /** Resizes columns according to the data they represent */
6169
6203
  EasyGrid.prototype.resizeColumns = function () {
6170
6204
  if (this.options.columnWidths.autoResize === AutoResizeColumns.Never)
6171
6205
  return;