@easyquery/enterprise 7.2.0-rc01 → 7.2.0-rc05

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.
@@ -1648,6 +1648,7 @@ var meta_entity_MetaEntityAttr = /** @class */ (function () {
1648
1648
  this.lookupEntity = dto.lent;
1649
1649
  this.dataAttr = dto.dattr;
1650
1650
  this.lookupDataAttr = dto.ldattr;
1651
+ this.defaultValue = dto.defVal;
1651
1652
  this.isNullable = utils_utils.getIfDefined(dto.nul, this.isNullable);
1652
1653
  this.isEditable = utils_utils.getIfDefined(dto.ied, this.isEditable);
1653
1654
  this.showOnView = utils_utils.getIfDefined(dto.ivis || dto.sov, this.showOnView);
@@ -2740,6 +2741,7 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
2740
2741
  this.cachedRows = [];
2741
2742
  this.total = 0;
2742
2743
  this.needTotal = !this._elasticChunks;
2744
+ this.fireUpdated();
2743
2745
  };
2744
2746
  EasyDataTable.prototype.createRow = function (dataOrRow) {
2745
2747
  var _this = this;
@@ -4389,7 +4391,7 @@ var easy_grid_EasyGrid = /** @class */ (function () {
4389
4391
  pageSizeItems: [20, 30, 50, 100, 200]
4390
4392
  },
4391
4393
  columnWidths: {
4392
- autoResize: AutoResizeColumns.Once,
4394
+ autoResize: AutoResizeColumns.Always,
4393
4395
  stringColumns: {
4394
4396
  min: 100,
4395
4397
  max: 500,
@@ -4417,7 +4419,7 @@ var easy_grid_EasyGrid = /** @class */ (function () {
4417
4419
  default: 60
4418
4420
  }
4419
4421
  },
4420
- addColumns: false,
4422
+ showPlusButton: false,
4421
4423
  viewportRowsCount: null,
4422
4424
  showActiveRow: true
4423
4425
  };
@@ -4516,8 +4518,8 @@ var easy_grid_EasyGrid = /** @class */ (function () {
4516
4518
  if (options.onRowDbClick) {
4517
4519
  this.addEventListener('rowDbClick', options.onRowDbClick);
4518
4520
  }
4519
- if (options.onAddColumnClick) {
4520
- this.addEventListener('addColumnClick', options.onAddColumnClick);
4521
+ if (options.onPlusButtonClick) {
4522
+ this.addEventListener('plusButtonClick', options.onPlusButtonClick);
4521
4523
  }
4522
4524
  if (options.onColumnChanged) {
4523
4525
  this.addEventListener('columnChanged', options.onColumnChanged);
@@ -4603,7 +4605,7 @@ var easy_grid_EasyGrid = /** @class */ (function () {
4603
4605
  };
4604
4606
  EasyGrid.prototype.render = function () {
4605
4607
  var _this = this;
4606
- if (!this.hasData() && !this.options.addColumns)
4608
+ if (!this.hasData() && !this.options.showPlusButton)
4607
4609
  return;
4608
4610
  this.containerInitialHeight = this.slot.clientHeight;
4609
4611
  this.rootDiv = document.createElement('div');
@@ -4627,9 +4629,6 @@ var easy_grid_EasyGrid = /** @class */ (function () {
4627
4629
  .then(function () {
4628
4630
  _this.firstRender = false;
4629
4631
  _this.rowsOnPagePromise = null;
4630
- if (needAutoResize) {
4631
- _this.resizeColumns();
4632
- }
4633
4632
  });
4634
4633
  }
4635
4634
  else {
@@ -4651,14 +4650,14 @@ var easy_grid_EasyGrid = /** @class */ (function () {
4651
4650
  var firstRow = _this.bodyCellContainerDiv.firstElementChild;
4652
4651
  var rowHeight = firstRow ? firstRow.offsetHeight : DEFAULT_ROW_HEIGHT;
4653
4652
  var rowCount = _this.options.viewportRowsCount; // || DEFAULT_ROW_COUNT;
4654
- var bodyHeight_1 = rowHeight * rowCount;
4655
- domel(_this.bodyDiv)
4656
- .setStyle('height', bodyHeight_1 + "px");
4653
+ var viewportHeight_1 = rowHeight * rowCount;
4654
+ domel(_this.bodyViewportDiv)
4655
+ .setStyle('height', viewportHeight_1 + "px");
4657
4656
  setTimeout(function () {
4658
4657
  var sbHeight = _this.bodyViewportDiv.offsetHeight - _this.bodyViewportDiv.clientHeight;
4659
- bodyHeight_1 = bodyHeight_1 + sbHeight;
4660
- domel(_this.bodyDiv)
4661
- .setStyle('height', bodyHeight_1 + "px");
4658
+ viewportHeight_1 = viewportHeight_1 + sbHeight;
4659
+ domel(_this.bodyViewportDiv)
4660
+ .setStyle('height', viewportHeight_1 + "px");
4662
4661
  resolve();
4663
4662
  }, 100);
4664
4663
  return;
@@ -4705,7 +4704,7 @@ var easy_grid_EasyGrid = /** @class */ (function () {
4705
4704
  _this.headerRowDiv.appendChild(hd);
4706
4705
  if (column.isRowNum) {
4707
4706
  domel(hd)
4708
- .addChildElement(_this.renderAddColumnButton());
4707
+ .addChildElement(_this.renderHeaderButtons());
4709
4708
  }
4710
4709
  });
4711
4710
  var containerWidth = this.getContainerWidth();
@@ -4802,9 +4801,15 @@ var easy_grid_EasyGrid = /** @class */ (function () {
4802
4801
  _this.updateTotalsState(groups_1, row, true);
4803
4802
  }
4804
4803
  }
4805
- var containerWidth = _this.getContainerWidth();
4806
- domel(_this.bodyCellContainerDiv)
4807
- .setStyle('width', containerWidth + "px");
4804
+ var needAutoResize = _this.options.columnWidths.autoResize !== AutoResizeColumns.Never;
4805
+ if (needAutoResize) {
4806
+ _this.resizeColumns();
4807
+ }
4808
+ else {
4809
+ var containerWidth = _this.getContainerWidth();
4810
+ domel(_this.bodyCellContainerDiv)
4811
+ .setStyle('width', containerWidth + "px");
4812
+ }
4808
4813
  return rowsToRender;
4809
4814
  })
4810
4815
  .catch(function (error) { console.error(error); return 0; });
@@ -5044,23 +5049,26 @@ var easy_grid_EasyGrid = /** @class */ (function () {
5044
5049
  var pageInfoDiv = domel('div')
5045
5050
  .addClass(this.cssPrefix + "-page-info")
5046
5051
  .toDOM();
5047
- var fistPageRecordNum = count
5048
- ? (this.pagination.page - 1) * this.pagination.pageSize + 1
5049
- : 0;
5050
- var lastPageRecordNum = count
5051
- ? fistPageRecordNum + count - 1
5052
- : 0;
5053
- var totalStr = this.dataTable.getTotal().toString();
5054
- if (this.dataTable.elasticChunks) {
5055
- var count_1 = this.dataTable.getCachedCount();
5056
- var total = this.dataTable.getTotal();
5057
- if (count_1 !== total)
5058
- totalStr = '?';
5059
- }
5060
- pageInfoDiv.innerHTML = i18n_i18n.getText('GridPageInfo')
5061
- .replace('{FirstPageRecordNum}', "<span>" + fistPageRecordNum.toString() + "</span>")
5062
- .replace('{LastPageRecordNum}', "<span>" + lastPageRecordNum.toString() + "</span>")
5063
- .replace('{Total}', "<span>" + totalStr + "</span>");
5052
+ var rowCount = this.dataTable.getTotal();
5053
+ if (rowCount > 0) {
5054
+ var fistPageRecordNum = count
5055
+ ? (this.pagination.page - 1) * this.pagination.pageSize + 1
5056
+ : 0;
5057
+ var lastPageRecordNum = count
5058
+ ? fistPageRecordNum + count - 1
5059
+ : 0;
5060
+ var totalStr = this.dataTable.getTotal().toString();
5061
+ if (this.dataTable.elasticChunks) {
5062
+ var count_1 = this.dataTable.getCachedCount();
5063
+ var total = this.dataTable.getTotal();
5064
+ if (count_1 !== total)
5065
+ totalStr = '?';
5066
+ }
5067
+ pageInfoDiv.innerHTML = i18n_i18n.getText('GridPageInfo')
5068
+ .replace('{FirstPageRecordNum}', "<span>" + fistPageRecordNum.toString() + "</span>")
5069
+ .replace('{LastPageRecordNum}', "<span>" + lastPageRecordNum.toString() + "</span>")
5070
+ .replace('{Total}', "<span>" + totalStr + "</span>");
5071
+ }
5064
5072
  return pageInfoDiv;
5065
5073
  };
5066
5074
  EasyGrid.prototype.showProgress = function () {
@@ -5155,7 +5163,8 @@ var easy_grid_EasyGrid = /** @class */ (function () {
5155
5163
  var _this = this;
5156
5164
  var paginateDiv = document.createElement('div');
5157
5165
  paginateDiv.className = this.cssPrefix + "-pagination-wrapper";
5158
- if (this.options.paging && this.options.paging.enabled) {
5166
+ var rowCount = this.dataTable.getTotal();
5167
+ if (this.options.paging && this.options.paging.enabled && rowCount > 0) {
5159
5168
  var prefix_1 = this.paginationOptions.useBootstrap ? '' : this.cssPrefix + "-";
5160
5169
  var buttonClickHandler_1 = function (ev) {
5161
5170
  var element = ev.target;
@@ -5281,18 +5290,18 @@ var easy_grid_EasyGrid = /** @class */ (function () {
5281
5290
  EasyGrid.prototype.removeEventListener = function (eventType, handlerId) {
5282
5291
  this.eventEmitter.unsubscribe(eventType, handlerId);
5283
5292
  };
5284
- EasyGrid.prototype.renderAddColumnButton = function () {
5293
+ EasyGrid.prototype.renderHeaderButtons = function () {
5285
5294
  var _this = this;
5286
- if (this.options.addColumns) {
5295
+ if (this.options.showPlusButton) {
5287
5296
  return domel('div')
5288
- .addClass(this.cssPrefix + "-addrow")
5289
- .title(this.options.addColumnsTitle || 'Add column')
5297
+ .addClass(this.cssPrefix + "-header-btn-plus")
5298
+ .title(this.options.plusButtonTitle || 'Add')
5290
5299
  .addChild('a', function (builder) { return builder
5291
5300
  .attr('href', 'javascript:void(0)')
5292
5301
  .on('click', function (e) {
5293
5302
  e.preventDefault();
5294
5303
  _this.fireEvent({
5295
- type: 'addColumnClick',
5304
+ type: 'plusButtonClick',
5296
5305
  sourceEvent: e
5297
5306
  });
5298
5307
  }); })
@@ -6695,7 +6704,7 @@ var dialogs = new DefaultDialogService();
6695
6704
  //# sourceMappingURL=public_api.js.map
6696
6705
  // CONCATENATED MODULE: ./src/utils/lcv.ts
6697
6706
  var majVer = 7;
6698
- var minVer = 1;
6707
+ var minVer = 2;
6699
6708
  var magics = [45, 128, 231];
6700
6709
  Math.trunc = Math.trunc || function (x) {
6701
6710
  if (isNaN(x)) {
@@ -7327,17 +7336,19 @@ var data_table_aggr_calculator_DataTableAggregatesCalculator = /** @class */ (fu
7327
7336
  this.levelsTotals.push(levelTotals);
7328
7337
  }
7329
7338
  var allRows = this.context.resultTable.getCachedRows();
7330
- for (var _i = 0, allRows_1 = allRows; _i < allRows_1.length; _i++) {
7331
- var row = allRows_1[_i];
7332
- this.processDataRow(row);
7333
- }
7334
- //flusing the totals for all group levels
7335
- for (var levelIndex = 1; levelIndex < levelNumber; levelIndex++) {
7336
- this.flushLevelTotals(levelIndex);
7337
- }
7338
- //flusing the grand totals (if they are turned on)
7339
- if (this.aggrSettings.hasGrandTotals()) {
7340
- this.flushLevelTotals(0);
7339
+ if (allRows.length > 0) {
7340
+ for (var _i = 0, allRows_1 = allRows; _i < allRows_1.length; _i++) {
7341
+ var row = allRows_1[_i];
7342
+ this.processDataRow(row);
7343
+ }
7344
+ //flusing the totals for all group levels
7345
+ for (var levelIndex = 1; levelIndex < levelNumber; levelIndex++) {
7346
+ this.flushLevelTotals(levelIndex);
7347
+ }
7348
+ //flusing the grand totals (if they are turned on)
7349
+ if (this.aggrSettings.hasGrandTotals()) {
7350
+ this.flushLevelTotals(0);
7351
+ }
7341
7352
  }
7342
7353
  return Promise.resolve();
7343
7354
  };
@@ -7520,7 +7531,7 @@ function showLCDialog() {
7520
7531
  break;
7521
7532
  default:
7522
7533
  title = "Invalid key for EasyQuery!";
7523
- body = "The EasyQuery product key is either invalid or was issued for a different version of the library.\n The version you are using now is 7.1,\n\tso please <a href=\"https://korzh.com/account\">login to your account</a> to get a proper key for version 7.1.";
7534
+ body = "The EasyQuery product key is either invalid or was issued for a different version of the library.\n The version you are using now is 7.2,\n\tso please <a href=\"https://korzh.com/account\">login to your account</a> to get a proper key for version 7.2.";
7524
7535
  buttonTitle = 'Get key';
7525
7536
  buttonUrl = 'https://korzh.com/account';
7526
7537
  break;
@@ -7718,7 +7729,6 @@ var eqs_aggr_calculator_EqServerAggregatesCalculator = /** @class */ (function (
7718
7729
  dataTable.addRow(row);
7719
7730
  }
7720
7731
  var levelData = _this.buildLevelData(options.level, dataTable);
7721
- console.log('Level', options.level, levelData);
7722
7732
  _this.aggrContainer.setAggregateData(options.level, levelData);
7723
7733
  if (options.resultObtainedCallback) {
7724
7734
  options.resultObtainedCallback(result, options.level);