@easydata/crud 1.4.6 → 1.4.7

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.
@@ -4492,7 +4492,9 @@ var easy_grid_spreadArrays = (undefined && undefined.__spreadArrays) || function
4492
4492
 
4493
4493
  var DEFAULT_ROW_HEIGHT = 36;
4494
4494
  var DEFAULT_ROW_COUNT = 15;
4495
+ /** Represents a grid widget with columns rows, paging, custom rendering and more */
4495
4496
  var easy_grid_EasyGrid = /** @class */ (function () {
4497
+ /** Creates and initializes all internal properties of the grid object */
4496
4498
  function EasyGrid(options) {
4497
4499
  this.cssPrefix = "keg";
4498
4500
  this.pagination = { page: 1, pageSize: 30, total: 0 };
@@ -4634,6 +4636,7 @@ var easy_grid_EasyGrid = /** @class */ (function () {
4634
4636
  this.slot = slot;
4635
4637
  }
4636
4638
  };
4639
+ /** Initializes grid widget according to the options passed in the parameter */
4637
4640
  EasyGrid.prototype.init = function (options) {
4638
4641
  var _this = this;
4639
4642
  if (options.onInit) {
@@ -4697,6 +4700,10 @@ var easy_grid_EasyGrid = /** @class */ (function () {
4697
4700
  this.refresh();
4698
4701
  this.fireEvent('init');
4699
4702
  };
4703
+ /** Fires a grid event. You can pass either an event type
4704
+ * (like 'init', 'rowClick', 'pageChanged', etc )
4705
+ * or a ready-to-use grid event object
4706
+ * */
4700
4707
  EasyGrid.prototype.fireEvent = function (event) {
4701
4708
  if (typeof event === "string") {
4702
4709
  this.eventEmitter.fire(event);
@@ -4705,20 +4712,26 @@ var easy_grid_EasyGrid = /** @class */ (function () {
4705
4712
  this.eventEmitter.fire(event.type, event);
4706
4713
  }
4707
4714
  };
4715
+ /** Allows to set the data (represented by a EasyDataTable object)
4716
+ * or to replace the existing one associated with the grid */
4708
4717
  EasyGrid.prototype.setData = function (data) {
4709
4718
  this.dataTable = data;
4710
4719
  this.clear();
4711
4720
  this.refresh();
4712
4721
  };
4722
+ /** Returns the EasyDataTable object associated with the grid via `setData()` call */
4713
4723
  EasyGrid.prototype.getData = function () {
4714
4724
  return this.dataTable;
4715
4725
  };
4726
+ /** Gets the list of grid columns */
4716
4727
  EasyGrid.prototype.getColumns = function () {
4717
4728
  return this.columns;
4718
4729
  };
4730
+ /** This function is called when the grid is destroyed */
4719
4731
  EasyGrid.prototype.destroy = function () {
4720
4732
  this.slot.innerHTML = "";
4721
4733
  };
4734
+ /** Clears the current DOM object and re-renders everything from the scratch */
4722
4735
  EasyGrid.prototype.refresh = function () {
4723
4736
  this.clearDOM();
4724
4737
  this.render();
@@ -4726,10 +4739,12 @@ var easy_grid_EasyGrid = /** @class */ (function () {
4726
4739
  EasyGrid.prototype.clearDOM = function () {
4727
4740
  this.slot.innerHTML = '';
4728
4741
  };
4742
+ /** Clears all DOM object in the grid and return it to its initial state */
4729
4743
  EasyGrid.prototype.clear = function () {
4730
4744
  this.pagination.page = 1;
4731
4745
  this.clearDOM();
4732
4746
  };
4747
+ /** Renders the grid */
4733
4748
  EasyGrid.prototype.render = function () {
4734
4749
  var _this = this;
4735
4750
  if (!this.hasData() && !this.options.showPlusButton)
@@ -5284,6 +5299,7 @@ var easy_grid_EasyGrid = /** @class */ (function () {
5284
5299
  }
5285
5300
  return cellElement;
5286
5301
  };
5302
+ /** Sets current grid pages (if paging is used) */
5287
5303
  EasyGrid.prototype.setPage = function (page) {
5288
5304
  this.pagination.page = page;
5289
5305
  this.fireEvent({ type: "pageChanged", page: page });
@@ -5530,9 +5546,11 @@ var easy_grid_EasyGrid = /** @class */ (function () {
5530
5546
  return rows[index];
5531
5547
  return null;
5532
5548
  };
5549
+ /** Makes the grid focused for keyboard events */
5533
5550
  EasyGrid.prototype.focus = function () {
5534
5551
  this.bodyViewportDiv.focus();
5535
5552
  };
5553
+ /** Resizes columns according to the data they represent */
5536
5554
  EasyGrid.prototype.resizeColumns = function () {
5537
5555
  if (this.options.columnWidths.autoResize === AutoResizeColumns.Never)
5538
5556
  return;