@laozei/element-ui 2.16.0 → 2.16.2

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.
@@ -13215,11 +13215,14 @@ var convertToRows = function convertToRows(originColumns) {
13215
13215
  }
13216
13216
  });
13217
13217
  // CONCATENATED MODULE: ./packages/table/src/table-footer.js
13218
+ var table_footer_typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
13219
+
13218
13220
  var table_footer_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
13219
13221
 
13220
13222
 
13221
13223
 
13222
13224
 
13225
+
13223
13226
  /* harmony default export */ var table_footer = ({
13224
13227
  name: 'ElTableFooter',
13225
13228
 
@@ -13228,13 +13231,14 @@ var table_footer_extends = Object.assign || function (target) { for (var i = 1;
13228
13231
  render: function render(h) {
13229
13232
  var _this = this;
13230
13233
 
13231
- var sums = [];
13234
+ var rows = [];
13235
+
13232
13236
  if (this.summaryMethod) {
13233
- sums = this.summaryMethod({ columns: this.columns, data: this.store.states.data });
13237
+ rows = this.summaryMethod({ columns: this.columns, data: this.store.states.data });
13234
13238
  } else {
13235
13239
  this.columns.forEach(function (column, index) {
13236
13240
  if (index === 0) {
13237
- sums[index] = _this.sumText;
13241
+ rows[index] = _this.sumText;
13238
13242
  return;
13239
13243
  }
13240
13244
  var values = _this.store.states.data.map(function (item) {
@@ -13251,7 +13255,7 @@ var table_footer_extends = Object.assign || function (target) { for (var i = 1;
13251
13255
  });
13252
13256
  var precision = Math.max.apply(null, precisions);
13253
13257
  if (!notNumber) {
13254
- sums[index] = values.reduce(function (prev, curr) {
13258
+ rows[index] = values.reduce(function (prev, curr) {
13255
13259
  var value = Number(curr);
13256
13260
  if (!isNaN(value)) {
13257
13261
  return parseFloat((prev + curr).toFixed(Math.min(precision, 20)));
@@ -13260,11 +13264,15 @@ var table_footer_extends = Object.assign || function (target) { for (var i = 1;
13260
13264
  }
13261
13265
  }, 0);
13262
13266
  } else {
13263
- sums[index] = '';
13267
+ rows[index] = '';
13264
13268
  }
13265
13269
  });
13266
13270
  }
13267
13271
 
13272
+ if (Object(util_["isUnidimensionalArray"])(rows)) {
13273
+ rows = [rows];
13274
+ }
13275
+
13268
13276
  return h(
13269
13277
  'table',
13270
13278
  {
@@ -13282,22 +13290,28 @@ var table_footer_extends = Object.assign || function (target) { for (var i = 1;
13282
13290
  }) : '']), h(
13283
13291
  'tbody',
13284
13292
  { 'class': [{ 'has-gutter': this.hasGutter }] },
13285
- [h('tr', [this.columns.map(function (column, cellIndex) {
13286
- return h(
13287
- 'td',
13288
- {
13289
- key: cellIndex,
13290
- attrs: { colspan: column.colSpan,
13291
- rowspan: column.rowSpan
13292
- },
13293
- 'class': [].concat(_this.getRowClasses(column, cellIndex), ['el-table__cell']) },
13294
- [h(
13295
- 'div',
13296
- { 'class': ['cell', column.labelClassName] },
13297
- [sums[cellIndex]]
13298
- )]
13299
- );
13300
- }), this.hasGutter ? h('th', { 'class': 'el-table__cell gutter' }) : ''])]
13293
+ [rows.map(function (row, $index) {
13294
+ return h('tr', [_this.columns.map(function (column, cellIndex) {
13295
+ var _getSpan = _this.getSpan(row, column, $index, cellIndex),
13296
+ rowspan = _getSpan.rowspan,
13297
+ colspan = _getSpan.colspan;
13298
+
13299
+ return h(
13300
+ 'td',
13301
+ {
13302
+ key: cellIndex,
13303
+ attrs: { rowspan: rowspan,
13304
+ colspan: colspan
13305
+ },
13306
+ 'class': [].concat(_this.getRowClasses(column, cellIndex), ['el-table__cell']) },
13307
+ [h(
13308
+ 'div',
13309
+ { 'class': ['cell', column.labelClassName] },
13310
+ [row[cellIndex]]
13311
+ )]
13312
+ );
13313
+ }), _this.hasGutter ? h('th', { 'class': 'el-table__cell gutter' }) : '']);
13314
+ })]
13301
13315
  )]
13302
13316
  );
13303
13317
  },
@@ -13374,6 +13388,22 @@ var table_footer_extends = Object.assign || function (target) { for (var i = 1;
13374
13388
  classes.push('is-leaf');
13375
13389
  }
13376
13390
  return classes;
13391
+ },
13392
+ getSpan: function getSpan(row, column, rowIndex, columnIndex) {
13393
+ var rowspan = 1;
13394
+ var colspan = 1;
13395
+ var fn = this.table.spanMethod;
13396
+ if (typeof fn === 'function') {
13397
+ var result = fn({ row: row, column: column, rowIndex: rowIndex, columnIndex: columnIndex });
13398
+ if (Array.isArray(result)) {
13399
+ rowspan = result[0];
13400
+ colspan = result[1];
13401
+ } else if ((typeof result === 'undefined' ? 'undefined' : table_footer_typeof(result)) === 'object') {
13402
+ rowspan = result.rowspan;
13403
+ colspan = result.colspan;
13404
+ }
13405
+ }
13406
+ return { rowspan: rowspan, colspan: colspan };
13377
13407
  }
13378
13408
  }
13379
13409
  });
@@ -43804,7 +43834,7 @@ if (typeof window !== 'undefined' && window.Vue) {
43804
43834
  }
43805
43835
 
43806
43836
  /* harmony default export */ var src_0 = __webpack_exports__["default"] = ({
43807
- version: '2.16.0',
43837
+ version: '2.16.2',
43808
43838
  locale: lib_locale_default.a.use,
43809
43839
  i18n: lib_locale_default.a.i18n,
43810
43840
  install: src_install,