vxe-table 3.7.0-beta.0 → 3.7.0-beta.3

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.
package/lib/index.umd.js CHANGED
@@ -11042,7 +11042,7 @@ var es_array_concat = __webpack_require__(2222);
11042
11042
 
11043
11043
 
11044
11044
  function getLog(message, params) {
11045
- return "[vxe-table v".concat("3.7.0-beta.0", "] ").concat(conf.i18n(message, params));
11045
+ return "[vxe-table v".concat("3.7.0-beta.2", "] ").concat(conf.i18n(message, params));
11046
11046
  }
11047
11047
  function outLog(type) {
11048
11048
  return function (message, params) {
@@ -12229,7 +12229,7 @@ function _t(key, args) {
12229
12229
  var v = 'v3';
12230
12230
  var VXETable = {
12231
12231
  v: v,
12232
- version: "3.7.0-beta.0",
12232
+ version: "3.7.0-beta.2",
12233
12233
  reg: reg,
12234
12234
  use: use,
12235
12235
  setup: setup,
@@ -16069,9 +16069,11 @@ var Methods = {
16069
16069
  tableFullData = this.tableFullData,
16070
16070
  fullDataRowMap = this.fullDataRowMap,
16071
16071
  fullAllDataRowMap = this.fullAllDataRowMap,
16072
- tableFullTreeData = this.tableFullTreeData;
16072
+ tableFullTreeData = this.tableFullTreeData,
16073
+ tableSourceData = this.tableSourceData;
16073
16074
  var fullDataRowIdData = this.fullDataRowIdData,
16074
- fullAllDataRowIdData = this.fullAllDataRowIdData;
16075
+ fullAllDataRowIdData = this.fullAllDataRowIdData,
16076
+ sourceDataRowIdData = this.sourceDataRowIdData;
16075
16077
  var rowkey = getRowkey(this);
16076
16078
  var isLazy = treeConfig && treeOpts.lazy;
16077
16079
  var handleCache = function handleCache(row, index, items, path, parent, nodes) {
@@ -16108,12 +16110,30 @@ var Methods = {
16108
16110
  fullDataRowMap.clear();
16109
16111
  }
16110
16112
  fullAllDataRowIdData = this.fullAllDataRowIdData = {};
16113
+ sourceDataRowIdData = this.sourceDataRowIdData = {};
16111
16114
  fullAllDataRowMap.clear();
16112
16115
  if (treeConfig) {
16113
16116
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData, handleCache, treeOpts);
16114
16117
  } else {
16115
16118
  tableFullData.forEach(handleCache);
16116
16119
  }
16120
+ var handleSourceRow = function handleSourceRow(row) {
16121
+ var rowid = getRowid(_this10, row);
16122
+ if (eqEmptyValue(rowid)) {
16123
+ rowid = getRowUniqueId();
16124
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, rowkey, rowid);
16125
+ }
16126
+ sourceDataRowIdData[rowid] = {
16127
+ row: row,
16128
+ rowid: rowid
16129
+ };
16130
+ };
16131
+ // 源数据缓存
16132
+ if (treeConfig && !treeOpts.transform) {
16133
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableSourceData, handleSourceRow, treeOpts);
16134
+ } else {
16135
+ tableSourceData.forEach(handleSourceRow);
16136
+ }
16117
16137
  },
16118
16138
  loadTreeChildren: function loadTreeChildren(row, childRecords) {
16119
16139
  var _this11 = this;
@@ -17115,7 +17135,7 @@ var Methods = {
17115
17135
  */
17116
17136
  showColumn: function showColumn(fieldOrColumn) {
17117
17137
  var column = handleFieldOrColumn(this, fieldOrColumn);
17118
- if (column & !column.visible) {
17138
+ if (column && column.visible) {
17119
17139
  column.visible = true;
17120
17140
  return this.handleCustom();
17121
17141
  }
@@ -30120,7 +30140,8 @@ function getLabelData($xetable, opts, columns, datas) {
30120
30140
  var treeConfig = $xetable.treeConfig,
30121
30141
  treeOpts = $xetable.treeOpts,
30122
30142
  radioOpts = $xetable.radioOpts,
30123
- checkboxOpts = $xetable.checkboxOpts;
30143
+ checkboxOpts = $xetable.checkboxOpts,
30144
+ columnOpts = $xetable.columnOpts;
30124
30145
  if (!htmlCellElem) {
30125
30146
  htmlCellElem = document.createElement('div');
30126
30147
  }
@@ -30142,15 +30163,18 @@ function getLabelData($xetable, opts, columns, datas) {
30142
30163
  columns.forEach(function (column, $columnIndex) {
30143
30164
  var cellValue = '';
30144
30165
  var renderOpts = column.editRender || column.cellRender;
30145
- var exportLabelMethod = column.exportMethod;
30146
- if (!exportLabelMethod && renderOpts && renderOpts.name) {
30166
+ var bodyExportMethod = column.exportMethod;
30167
+ if (!bodyExportMethod && renderOpts && renderOpts.name) {
30147
30168
  var compConf = v_x_e_table.renderer.get(renderOpts.name);
30148
30169
  if (compConf) {
30149
- exportLabelMethod = compConf.exportMethod || compConf.cellExportMethod;
30170
+ bodyExportMethod = compConf.exportMethod || compConf.cellExportMethod;
30150
30171
  }
30151
30172
  }
30152
- if (exportLabelMethod) {
30153
- cellValue = exportLabelMethod({
30173
+ if (!bodyExportMethod) {
30174
+ bodyExportMethod = columnOpts.exportMethod;
30175
+ }
30176
+ if (bodyExportMethod) {
30177
+ cellValue = bodyExportMethod({
30154
30178
  $table: $xetable,
30155
30179
  row: row,
30156
30180
  column: column,
@@ -30282,23 +30306,29 @@ function getBooleanValue(cellValue) {
30282
30306
  return cellValue === 'TRUE' || cellValue === 'true' || cellValue === true;
30283
30307
  }
30284
30308
  function getHeaderTitle($xetable, opts, column) {
30285
- var headerExportMethod = column.headerExportMethod;
30286
- return headerExportMethod ? headerExportMethod({
30309
+ var columnOpts = $xetable.columnOpts;
30310
+ var headExportMethod = column.headerExportMethod || columnOpts.headerExportMethod;
30311
+ return headExportMethod ? headExportMethod({
30287
30312
  column: column,
30313
+ options: opts,
30288
30314
  $table: $xetable
30289
30315
  }) : (opts.original ? column.property : column.getTitle()) || '';
30290
30316
  }
30291
30317
  function getFooterCellValue($xetable, opts, items, column) {
30318
+ var columnOpts = $xetable.columnOpts;
30292
30319
  var renderOpts = column.editRender || column.cellRender;
30293
- var exportLabelMethod = column.footerExportMethod;
30294
- if (!exportLabelMethod && renderOpts && renderOpts.name) {
30320
+ var footLabelMethod = column.footerExportMethod;
30321
+ if (!footLabelMethod && renderOpts && renderOpts.name) {
30295
30322
  var compConf = v_x_e_table.renderer.get(renderOpts.name);
30296
30323
  if (compConf) {
30297
- exportLabelMethod = compConf.footerExportMethod || compConf.footerCellExportMethod;
30324
+ footLabelMethod = compConf.footerExportMethod || compConf.footerCellExportMethod;
30298
30325
  }
30299
30326
  }
30327
+ if (!footLabelMethod) {
30328
+ footLabelMethod = columnOpts.footerExportMethod;
30329
+ }
30300
30330
  var _columnIndex = $xetable.getVTColumnIndex(column);
30301
- var cellValue = exportLabelMethod ? exportLabelMethod({
30331
+ var cellValue = footLabelMethod ? footLabelMethod({
30302
30332
  $table: $xetable,
30303
30333
  items: items,
30304
30334
  itemIndex: _columnIndex,