fantasy-ngzorro 1.5.28 → 1.5.29

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.
@@ -5611,6 +5611,7 @@
5611
5611
  }
5612
5612
  var TableCacheOption = /** @class */ (function () {
5613
5613
  function TableCacheOption() {
5614
+ this.colWidths = new Map(); // name -> width
5614
5615
  }
5615
5616
  return TableCacheOption;
5616
5617
  }());
@@ -5915,14 +5916,12 @@
5915
5916
  function (value) {
5916
5917
  if (value) {
5917
5918
  _this.tableCacheOption = value;
5919
+ _this.normalizeTableCacheOption();
5918
5920
  if (_this.tableCacheOption.pageSize &&
5919
5921
  _this.tableCacheOption.pageSize > 10) {
5920
5922
  _this.tablePageSize = _this.tableCacheOption.pageSize;
5921
5923
  _this.tablePageSizeChange.emit(_this.tablePageSize);
5922
5924
  }
5923
- if (!_this.tableCacheOption.colWidths) {
5924
- _this.tableCacheOption.colWidths = new Map();
5925
- }
5926
5925
  }
5927
5926
  else {
5928
5927
  _this.tableCacheOption = new TableCacheOption();
@@ -6031,7 +6030,7 @@
6031
6030
  this.showListNodes = false;
6032
6031
  this.nowListNodes = [];
6033
6032
  this.hideListNodes = [];
6034
- if (this.tableCacheOption && this.tableCacheOption.cols) {
6033
+ if (this.hasColsCache()) {
6035
6034
  var _a = this.tableColsCache.reduce((/**
6036
6035
  * @param {?} acc
6037
6036
  * @param {?} item
@@ -6063,7 +6062,7 @@
6063
6062
  * @return {?}
6064
6063
  */
6065
6064
  function (element, index) {
6066
- if (_this.tableCacheOption && _this.tableCacheOption.cols) {
6065
+ if (_this.hasColsCache()) {
6067
6066
  element.isShow = _this.tableCacheOption.cols.includes(element.title)
6068
6067
  ? true
6069
6068
  : false;
@@ -6332,6 +6331,41 @@
6332
6331
  this.tableColsCache = __spread(this.tableCols);
6333
6332
  }
6334
6333
  };
6334
+ /**
6335
+ * @return {?}
6336
+ */
6337
+ HdTableComponent.prototype.normalizeTableCacheOption = /**
6338
+ * @return {?}
6339
+ */
6340
+ function () {
6341
+ var _this = this;
6342
+ if (!this.tableCacheOption.colWidths) {
6343
+ this.tableCacheOption.colWidths = new Map();
6344
+ }
6345
+ else if (!(this.tableCacheOption.colWidths instanceof Map)) {
6346
+ /** @type {?} */
6347
+ var colWidths_1 = new Map();
6348
+ Object.keys(this.tableCacheOption.colWidths).forEach((/**
6349
+ * @param {?} key
6350
+ * @return {?}
6351
+ */
6352
+ function (key) {
6353
+ colWidths_1.set(key, ((/** @type {?} */ (_this.tableCacheOption.colWidths)))[key]);
6354
+ }));
6355
+ this.tableCacheOption.colWidths = colWidths_1;
6356
+ }
6357
+ };
6358
+ /**
6359
+ * @private
6360
+ * @return {?}
6361
+ */
6362
+ HdTableComponent.prototype.hasColsCache = /**
6363
+ * @private
6364
+ * @return {?}
6365
+ */
6366
+ function () {
6367
+ return !!(this.tableCacheOption && this.tableCacheOption.cols && this.tableCacheOption.cols.length > 0);
6368
+ };
6335
6369
  /**
6336
6370
  * @return {?}
6337
6371
  */
@@ -6374,6 +6408,7 @@
6374
6408
  */
6375
6409
  function (_a, col) {
6376
6410
  var width = _a.width;
6411
+ this.normalizeTableCacheOption();
6377
6412
  /** @type {?} */
6378
6413
  var tempWidth = 0;
6379
6414
  if (width > col.minWidth) {