@liuzengwei/element-ui 2.15.5-xn.56 → 2.15.5-xn.57

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.
@@ -370,10 +370,10 @@ var columnIdSeed = 1;
370
370
  return parent;
371
371
  },
372
372
  realWidth: function realWidth() {
373
- return Object(util["m" /* parseWidth */])(this.width);
373
+ return Object(util["parseWidth"])(this.width);
374
374
  },
375
375
  realMinWidth: function realMinWidth() {
376
- return Object(util["l" /* parseMinWidth */])(this.minWidth);
376
+ return Object(util["parseMinWidth"])(this.minWidth);
377
377
  },
378
378
  realAlign: function realAlign() {
379
379
  return this.align ? 'is-' + this.align : null;
@@ -576,10 +576,10 @@ var columnIdSeed = 1;
576
576
  var filterProps = ['filterMethod', 'filters', 'filterMultiple', 'filterOpened', 'filteredValue', 'filterPlacement'];
577
577
 
578
578
  var column = this.getPropsData(basicProps, sortProps, selectProps, filterProps);
579
- column = Object(util["h" /* mergeOptions */])(defaults, column);
579
+ column = Object(util["mergeOptions"])(defaults, column);
580
580
 
581
581
  // 注意 compose 中函数执行的顺序是从右到左
582
- var chains = Object(util["a" /* compose */])(this.setColumnRenders, this.setColumnWidth, this.setColumnForcedProps);
582
+ var chains = Object(util["compose"])(this.setColumnRenders, this.setColumnWidth, this.setColumnForcedProps);
583
583
  column = chains(column);
584
584
 
585
585
  this.columnConfig = column;
@@ -636,21 +636,22 @@ module.exports = require("@liuzengwei/element-ui/lib/utils/util");
636
636
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
637
637
 
638
638
  "use strict";
639
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getCell; });
640
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return orderBy; });
641
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return getColumnById; });
642
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return getColumnByKey; });
643
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getColumnByCell; });
644
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return getRowIdentity; });
645
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return getKeysMap; });
646
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return mergeOptions; });
647
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return parseWidth; });
648
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return parseMinWidth; });
649
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return parseHeight; });
650
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return compose; });
651
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return toggleRowStatus; });
652
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return walkTreeNode; });
653
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return objectEquals; });
639
+ __webpack_require__.r(__webpack_exports__);
640
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCell", function() { return getCell; });
641
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "orderBy", function() { return orderBy; });
642
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getColumnById", function() { return getColumnById; });
643
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getColumnByKey", function() { return getColumnByKey; });
644
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getColumnByCell", function() { return getColumnByCell; });
645
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRowIdentity", function() { return getRowIdentity; });
646
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getKeysMap", function() { return getKeysMap; });
647
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeOptions", function() { return mergeOptions; });
648
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseWidth", function() { return parseWidth; });
649
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseMinWidth", function() { return parseMinWidth; });
650
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseHeight", function() { return parseHeight; });
651
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return compose; });
652
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toggleRowStatus", function() { return toggleRowStatus; });
653
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "walkTreeNode", function() { return walkTreeNode; });
654
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "objectEquals", function() { return objectEquals; });
654
655
  /* harmony import */ var element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
655
656
  /* harmony import */ var element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_0__);
656
657
  var _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; };
package/lib/table.js CHANGED
@@ -223,21 +223,22 @@ module.exports = require("@liuzengwei/element-ui/lib/mixins/locale");
223
223
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
224
224
 
225
225
  "use strict";
226
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getCell; });
227
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return orderBy; });
228
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return getColumnById; });
229
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return getColumnByKey; });
230
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getColumnByCell; });
231
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return getRowIdentity; });
232
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return getKeysMap; });
233
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return mergeOptions; });
234
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return parseWidth; });
235
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return parseMinWidth; });
236
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return parseHeight; });
237
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return compose; });
238
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return toggleRowStatus; });
239
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return walkTreeNode; });
240
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return objectEquals; });
226
+ __webpack_require__.r(__webpack_exports__);
227
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCell", function() { return getCell; });
228
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "orderBy", function() { return orderBy; });
229
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getColumnById", function() { return getColumnById; });
230
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getColumnByKey", function() { return getColumnByKey; });
231
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getColumnByCell", function() { return getColumnByCell; });
232
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRowIdentity", function() { return getRowIdentity; });
233
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getKeysMap", function() { return getKeysMap; });
234
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeOptions", function() { return mergeOptions; });
235
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseWidth", function() { return parseWidth; });
236
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseMinWidth", function() { return parseMinWidth; });
237
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseHeight", function() { return parseHeight; });
238
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return compose; });
239
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toggleRowStatus", function() { return toggleRowStatus; });
240
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "walkTreeNode", function() { return walkTreeNode; });
241
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "objectEquals", function() { return objectEquals; });
241
242
  /* harmony import */ var element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
242
243
  /* harmony import */ var element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_0__);
243
244
  var _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; };
@@ -1321,9 +1322,9 @@ var util = __webpack_require__(8);
1321
1322
  this.states.expandRows = data.slice();
1322
1323
  } else if (rowKey) {
1323
1324
  // TODO:这里的代码可以优化
1324
- var expandRowsMap = Object(util["f" /* getKeysMap */])(expandRows, rowKey);
1325
+ var expandRowsMap = Object(util["getKeysMap"])(expandRows, rowKey);
1325
1326
  this.states.expandRows = data.reduce(function (prev, row) {
1326
- var rowId = Object(util["g" /* getRowIdentity */])(row, rowKey);
1327
+ var rowId = Object(util["getRowIdentity"])(row, rowKey);
1327
1328
  var rowInfo = expandRowsMap[rowId];
1328
1329
  if (rowInfo) {
1329
1330
  prev.push(row);
@@ -1335,7 +1336,7 @@ var util = __webpack_require__(8);
1335
1336
  }
1336
1337
  },
1337
1338
  toggleRowExpansion: function toggleRowExpansion(row, expanded) {
1338
- var changed = Object(util["n" /* toggleRowStatus */])(this.states.expandRows, row, expanded);
1339
+ var changed = Object(util["toggleRowStatus"])(this.states.expandRows, row, expanded);
1339
1340
  if (changed) {
1340
1341
  this.table.$emit('expand-change', row, this.states.expandRows.slice());
1341
1342
  this.scheduleLayout();
@@ -1348,7 +1349,7 @@ var util = __webpack_require__(8);
1348
1349
  data = _states2.data,
1349
1350
  rowKey = _states2.rowKey;
1350
1351
 
1351
- var keysMap = Object(util["f" /* getKeysMap */])(data, rowKey);
1352
+ var keysMap = Object(util["getKeysMap"])(data, rowKey);
1352
1353
  this.states.expandRows = rowKeys.reduce(function (prev, cur) {
1353
1354
  var info = keysMap[cur];
1354
1355
  if (info) {
@@ -1364,8 +1365,8 @@ var util = __webpack_require__(8);
1364
1365
  rowKey = _states3.rowKey;
1365
1366
 
1366
1367
  if (rowKey) {
1367
- var expandMap = Object(util["f" /* getKeysMap */])(expandRows, rowKey);
1368
- return !!expandMap[Object(util["g" /* getRowIdentity */])(row, rowKey)];
1368
+ var expandMap = Object(util["getKeysMap"])(expandRows, rowKey);
1369
+ return !!expandMap[Object(util["getRowIdentity"])(row, rowKey)];
1369
1370
  }
1370
1371
  return expandRows.indexOf(row) !== -1;
1371
1372
  }
@@ -1409,7 +1410,7 @@ var util_ = __webpack_require__(3);
1409
1410
  var currentRow = null;
1410
1411
  if (rowKey) {
1411
1412
  currentRow = Object(util_["arrayFind"])(data, function (item) {
1412
- return Object(util["g" /* getRowIdentity */])(item, rowKey) === key;
1413
+ return Object(util["getRowIdentity"])(item, rowKey) === key;
1413
1414
  });
1414
1415
  }
1415
1416
  states.currentRow = currentRow;
@@ -1442,7 +1443,7 @@ var util_ = __webpack_require__(3);
1442
1443
  // 当 currentRow 不在 data 中时尝试更新数据
1443
1444
  if (data.indexOf(oldCurrentRow) === -1 && oldCurrentRow) {
1444
1445
  if (rowKey) {
1445
- var currentRowKey = Object(util["g" /* getRowIdentity */])(oldCurrentRow, rowKey);
1446
+ var currentRowKey = Object(util["getRowIdentity"])(oldCurrentRow, rowKey);
1446
1447
  this.setCurrentRowByKey(currentRowKey);
1447
1448
  } else {
1448
1449
  states.currentRow = null;
@@ -1507,7 +1508,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
1507
1508
  if (lazyTreeNodeMap[key].length) {
1508
1509
  var item = { children: [] };
1509
1510
  lazyTreeNodeMap[key].forEach(function (row) {
1510
- var currentRowKey = Object(util["g" /* getRowIdentity */])(row, rowKey);
1511
+ var currentRowKey = Object(util["getRowIdentity"])(row, rowKey);
1511
1512
  item.children.push(currentRowKey);
1512
1513
  if (row[lazyColumnIdentifier] && !res[currentRowKey]) {
1513
1514
  res[currentRowKey] = { children: [] };
@@ -1534,12 +1535,12 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
1534
1535
  lazy = _states2.lazy;
1535
1536
 
1536
1537
  var res = {};
1537
- Object(util["o" /* walkTreeNode */])(data, function (parent, children, level) {
1538
- var parentId = Object(util["g" /* getRowIdentity */])(parent, rowKey);
1538
+ Object(util["walkTreeNode"])(data, function (parent, children, level) {
1539
+ var parentId = Object(util["getRowIdentity"])(parent, rowKey);
1539
1540
  if (Array.isArray(children)) {
1540
1541
  res[parentId] = {
1541
1542
  children: children.map(function (row) {
1542
- return Object(util["g" /* getRowIdentity */])(row, rowKey);
1543
+ return Object(util["getRowIdentity"])(row, rowKey);
1543
1544
  }),
1544
1545
  level: level
1545
1546
  };
@@ -1634,7 +1635,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
1634
1635
  rowKey = _states4.rowKey,
1635
1636
  treeData = _states4.treeData;
1636
1637
 
1637
- var id = Object(util["g" /* getRowIdentity */])(row, rowKey);
1638
+ var id = Object(util["getRowIdentity"])(row, rowKey);
1638
1639
  var data = id && treeData[id];
1639
1640
  if (id && data && 'expanded' in data) {
1640
1641
  var oldExpanded = data.expanded;
@@ -1653,7 +1654,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
1653
1654
  treeData = _states5.treeData,
1654
1655
  rowKey = _states5.rowKey;
1655
1656
 
1656
- var id = Object(util["g" /* getRowIdentity */])(row, rowKey);
1657
+ var id = Object(util["getRowIdentity"])(row, rowKey);
1657
1658
  var data = treeData[id];
1658
1659
  if (lazy && data && 'loaded' in data && !data.loaded) {
1659
1660
  this.loadData(row, id, data);
@@ -1702,7 +1703,7 @@ var watcher_sortData = function sortData(data, states) {
1702
1703
  if (!sortingColumn || typeof sortingColumn.sortable === 'string') {
1703
1704
  return data;
1704
1705
  }
1705
- return Object(util["j" /* orderBy */])(data, states.sortProp, states.sortOrder, sortingColumn.sortMethod, sortingColumn.sortBy);
1706
+ return Object(util["orderBy"])(data, states.sortProp, states.sortOrder, sortingColumn.sortMethod, sortingColumn.sortBy);
1706
1707
  };
1707
1708
 
1708
1709
  var doFlattenColumns = function doFlattenColumns(columns) {
@@ -1843,8 +1844,8 @@ var doFlattenColumns = function doFlattenColumns(columns) {
1843
1844
  var deleted = void 0;
1844
1845
  if (rowKey) {
1845
1846
  deleted = [];
1846
- var selectedMap = Object(util["f" /* getKeysMap */])(selection, rowKey);
1847
- var dataMap = Object(util["f" /* getKeysMap */])(data, rowKey);
1847
+ var selectedMap = Object(util["getKeysMap"])(selection, rowKey);
1848
+ var dataMap = Object(util["getKeysMap"])(data, rowKey);
1848
1849
  for (var key in selectedMap) {
1849
1850
  if (selectedMap.hasOwnProperty(key) && !dataMap[key]) {
1850
1851
  deleted.push(selectedMap[key].row);
@@ -1866,7 +1867,7 @@ var doFlattenColumns = function doFlattenColumns(columns) {
1866
1867
  toggleRowSelection: function toggleRowSelection(row, selected) {
1867
1868
  var emitChange = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
1868
1869
 
1869
- var changed = Object(util["n" /* toggleRowStatus */])(this.states.selection, row, selected);
1870
+ var changed = Object(util["toggleRowStatus"])(this.states.selection, row, selected);
1870
1871
  if (changed) {
1871
1872
  var newSelection = (this.states.selection || []).slice();
1872
1873
  // 调用 API 修改选中值,不触发 select 事件
@@ -1890,11 +1891,11 @@ var doFlattenColumns = function doFlattenColumns(columns) {
1890
1891
  var selectionChanged = false;
1891
1892
  data.forEach(function (row, index) {
1892
1893
  if (states.selectable) {
1893
- if (states.selectable.call(null, row, index) && Object(util["n" /* toggleRowStatus */])(selection, row, value)) {
1894
+ if (states.selectable.call(null, row, index) && Object(util["toggleRowStatus"])(selection, row, value)) {
1894
1895
  selectionChanged = true;
1895
1896
  }
1896
1897
  } else {
1897
- if (Object(util["n" /* toggleRowStatus */])(selection, row, value)) {
1898
+ if (Object(util["toggleRowStatus"])(selection, row, value)) {
1898
1899
  selectionChanged = true;
1899
1900
  }
1900
1901
  }
@@ -1911,9 +1912,9 @@ var doFlattenColumns = function doFlattenColumns(columns) {
1911
1912
  rowKey = states.rowKey,
1912
1913
  data = states.data;
1913
1914
 
1914
- var selectedMap = Object(util["f" /* getKeysMap */])(selection, rowKey);
1915
+ var selectedMap = Object(util["getKeysMap"])(selection, rowKey);
1915
1916
  data.forEach(function (row) {
1916
- var rowId = Object(util["g" /* getRowIdentity */])(row, rowKey);
1917
+ var rowId = Object(util["getRowIdentity"])(row, rowKey);
1917
1918
  var rowInfo = selectedMap[rowId];
1918
1919
  if (rowInfo) {
1919
1920
  selection[rowInfo.index] = row;
@@ -1935,11 +1936,11 @@ var doFlattenColumns = function doFlattenColumns(columns) {
1935
1936
 
1936
1937
  var selectedMap = void 0;
1937
1938
  if (rowKey) {
1938
- selectedMap = Object(util["f" /* getKeysMap */])(selection, rowKey);
1939
+ selectedMap = Object(util["getKeysMap"])(selection, rowKey);
1939
1940
  }
1940
1941
  var isSelected = function isSelected(row) {
1941
1942
  if (selectedMap) {
1942
- return !!selectedMap[Object(util["g" /* getRowIdentity */])(row, rowKey)];
1943
+ return !!selectedMap[Object(util["getRowIdentity"])(row, rowKey)];
1943
1944
  } else {
1944
1945
  return selection.indexOf(row) !== -1;
1945
1946
  }
@@ -1998,7 +1999,7 @@ var doFlattenColumns = function doFlattenColumns(columns) {
1998
1999
  Object.keys(filters).forEach(function (columnId) {
1999
2000
  var values = states.filters[columnId];
2000
2001
  if (!values || values.length === 0) return;
2001
- var column = Object(util["d" /* getColumnById */])(_this.states, columnId);
2002
+ var column = Object(util["getColumnById"])(_this.states, columnId);
2002
2003
  if (column && column.filterMethod) {
2003
2004
  data = data.filter(function (row) {
2004
2005
  return values.some(function (value) {
@@ -2045,7 +2046,7 @@ var doFlattenColumns = function doFlattenColumns(columns) {
2045
2046
 
2046
2047
  if (Array.isArray(columnKeys)) {
2047
2048
  var columns = columnKeys.map(function (key) {
2048
- return Object(util["e" /* getColumnByKey */])(states, key);
2049
+ return Object(util["getColumnByKey"])(states, key);
2049
2050
  });
2050
2051
  keys.forEach(function (key) {
2051
2052
  var column = columns.find(function (col) {
@@ -2383,7 +2384,7 @@ var table_layout_TableLayout = function () {
2383
2384
 
2384
2385
  if (external_vue_default.a.prototype.$isServer) return;
2385
2386
  var el = this.table.$el;
2386
- value = Object(util["k" /* parseHeight */])(value);
2387
+ value = Object(util["parseHeight"])(value);
2387
2388
  this.height = value;
2388
2389
 
2389
2390
  if (!el && (value || value === 0)) return external_vue_default.a.nextTick(function () {
@@ -2901,7 +2902,7 @@ var table_body_extends = Object.assign || function (target) { for (var i = 1; i
2901
2902
  getKeyOfRow: function getKeyOfRow(row, index) {
2902
2903
  var rowKey = this.table.rowKey;
2903
2904
  if (rowKey) {
2904
- return Object(util["g" /* getRowIdentity */])(row, rowKey);
2905
+ return Object(util["getRowIdentity"])(row, rowKey);
2905
2906
  }
2906
2907
  return index;
2907
2908
  },
@@ -2954,7 +2955,7 @@ var table_body_extends = Object.assign || function (target) { for (var i = 1; i
2954
2955
 
2955
2956
  if (this.table.highlightSelectionRow) {
2956
2957
  for (var i = 0; i < selection.length; i++) {
2957
- if (Object(util["i" /* objectEquals */])(row, selection[i])) {
2958
+ if (Object(util["objectEquals"])(row, selection[i])) {
2958
2959
  classes.push('selection-row');
2959
2960
  }
2960
2961
  };
@@ -3028,10 +3029,10 @@ var table_body_extends = Object.assign || function (target) { for (var i = 1; i
3028
3029
  },
3029
3030
  handleCellMouseEnter: function handleCellMouseEnter(event, row) {
3030
3031
  var table = this.table;
3031
- var cell = Object(util["b" /* getCell */])(event);
3032
+ var cell = Object(util["getCell"])(event);
3032
3033
 
3033
3034
  if (cell) {
3034
- var column = Object(util["c" /* getColumnByCell */])(table, cell);
3035
+ var column = Object(util["getColumnByCell"])(table, cell);
3035
3036
  var hoverState = table.hoverState = { cell: cell, column: column, row: row };
3036
3037
  table.$emit('cell-mouse-enter', hoverState.row, hoverState.column, hoverState.cell, event);
3037
3038
  }
@@ -3065,7 +3066,7 @@ var table_body_extends = Object.assign || function (target) { for (var i = 1; i
3065
3066
  tooltip.setExpectedState(false);
3066
3067
  tooltip.handleClosePopper();
3067
3068
  }
3068
- var cell = Object(util["b" /* getCell */])(event);
3069
+ var cell = Object(util["getCell"])(event);
3069
3070
  if (!cell) return;
3070
3071
 
3071
3072
  var oldHoverState = this.table.hoverState || {};
@@ -3093,10 +3094,10 @@ var table_body_extends = Object.assign || function (target) { for (var i = 1; i
3093
3094
  },
3094
3095
  handleEvent: function handleEvent(event, row, name) {
3095
3096
  var table = this.table;
3096
- var cell = Object(util["b" /* getCell */])(event);
3097
+ var cell = Object(util["getCell"])(event);
3097
3098
  var column = void 0;
3098
3099
  if (cell) {
3099
- column = Object(util["c" /* getColumnByCell */])(table, cell);
3100
+ column = Object(util["getColumnByCell"])(table, cell);
3100
3101
  if (column) {
3101
3102
  table.$emit('cell-' + name, row, column, cell, event);
3102
3103
  }
@@ -3200,7 +3201,7 @@ var table_body_extends = Object.assign || function (target) { for (var i = 1; i
3200
3201
  assertRowKey();
3201
3202
  // TreeTable 时,rowKey 必须由用户设定,不使用 getKeyOfRow 计算
3202
3203
  // 在调用 rowRender 函数时,仍然会计算 rowKey,不太好的操作
3203
- var key = Object(util["g" /* getRowIdentity */])(row, rowKey);
3204
+ var key = Object(util["getRowIdentity"])(row, rowKey);
3204
3205
  var cur = treeData[key];
3205
3206
  var treeRowData = null;
3206
3207
  if (cur) {
@@ -3229,7 +3230,7 @@ var table_body_extends = Object.assign || function (target) { for (var i = 1; i
3229
3230
  display: parent.display && parent.expanded,
3230
3231
  level: parent.level + 1
3231
3232
  };
3232
- var childKey = Object(util["g" /* getRowIdentity */])(node, rowKey);
3233
+ var childKey = Object(util["getRowIdentity"])(node, rowKey);
3233
3234
  if (childKey === undefined || childKey === null) {
3234
3235
  throw new Error('for nested data item, row-key is required.');
3235
3236
  }
@@ -4998,53 +4999,33 @@ var tableIdSeed = 1;
4998
4999
  this.store.commit('toggleAllSelection');
4999
5000
  },
5000
5001
  getSelectionRows: function getSelectionRows() {
5001
- var _this = this;
5002
+ return this.store.states.selection;
5003
+ },
5004
+ getSelectionNodes: function getSelectionNodes() {
5005
+ var _store$states = this.store.states,
5006
+ selection = _store$states.selection,
5007
+ treeData = _store$states.treeData,
5008
+ rowKey = _store$states.rowKey;
5002
5009
 
5003
- var selection = this.store.states.selection || [];
5004
- var result = [];
5010
+ // 如果不是树形表格,返回简单的行数据
5005
5011
 
5006
- // 获取表格主体元素
5007
- var bodyWrapper = this.bodyWrapper;
5008
- if (!bodyWrapper) return result;
5009
-
5010
- // 获取所有行元素
5011
- var rows = bodyWrapper.querySelectorAll('.el-table__row');
5012
+ if (!rowKey || !Object.keys(treeData).length) {
5013
+ return selection.map(function (row) {
5014
+ return { row: row };
5015
+ });
5016
+ }
5012
5017
 
5013
- // 遍历选中行数据,找到对应的DOM节点
5014
- selection.forEach(function (rowData) {
5015
- // 通过row-key或者数据索引找到对应的行元素
5016
- var targetRow = null;
5017
- var rowKey = _this.rowKey;
5018
+ // 树形表格,返回完整节点信息
5019
+ var getRowIdentity = __webpack_require__(8).getRowIdentity;
5018
5020
 
5019
- if (rowKey) {
5020
- // 如果有row-key,通过row-key查找
5021
- var rowId = _this.getRowKey ? _this.getRowKey(rowData) : rowData[rowKey];
5022
- rows.forEach(function (row) {
5023
- var rowKeyAttr = row.getAttribute('row-key');
5024
- if (rowKeyAttr === String(rowId)) {
5025
- targetRow = row;
5026
- }
5027
- });
5028
- } else {
5029
- // 如果没有row-key,通过数据索引查找
5030
- var dataIndex = _this.store.states.data.indexOf(rowData);
5031
- if (dataIndex >= 0 && rows[dataIndex]) {
5032
- targetRow = rows[dataIndex];
5033
- }
5034
- }
5021
+ return selection.map(function (row) {
5022
+ var rowId = getRowIdentity(row, rowKey);
5023
+ var nodeData = treeData[rowId] || {};
5035
5024
 
5036
- // 如果找到了对应的行元素,添加到结果中
5037
- if (targetRow) {
5038
- result.push({
5039
- row: rowData,
5040
- index: _this.store.states.data.indexOf(rowData),
5041
- $el: targetRow,
5042
- selected: true
5043
- });
5044
- }
5025
+ return tablevue_type_script_lang_js_extends({
5026
+ row: row
5027
+ }, nodeData);
5045
5028
  });
5046
-
5047
- return result;
5048
5029
  },
5049
5030
  updateAffixHeader: function updateAffixHeader() {
5050
5031
  if (!this.isHeaderAffixed || !this.$el) return;
@@ -5127,7 +5108,7 @@ var tableIdSeed = 1;
5127
5108
  height: bodyHeight ? bodyHeight + 'px' : ''
5128
5109
  };
5129
5110
  } else if (this.maxHeight) {
5130
- var maxHeight = Object(util["k" /* parseHeight */])(this.maxHeight);
5111
+ var maxHeight = Object(util["parseHeight"])(this.maxHeight);
5131
5112
  if (typeof maxHeight === 'number') {
5132
5113
  return {
5133
5114
  'max-height': maxHeight - footerHeight - (this.showHeader ? headerHeight : 0) + 'px'
@@ -5142,7 +5123,7 @@ var tableIdSeed = 1;
5142
5123
  height: this.layout.fixedBodyHeight ? this.layout.fixedBodyHeight + 'px' : ''
5143
5124
  };
5144
5125
  } else if (this.maxHeight) {
5145
- var maxHeight = Object(util["k" /* parseHeight */])(this.maxHeight);
5126
+ var maxHeight = Object(util["parseHeight"])(this.maxHeight);
5146
5127
  if (typeof maxHeight === 'number') {
5147
5128
  maxHeight = this.layout.scrollX ? maxHeight - this.layout.gutterWidth : maxHeight;
5148
5129
  if (this.showHeader) {
@@ -5246,15 +5227,15 @@ var tableIdSeed = 1;
5246
5227
  },
5247
5228
 
5248
5229
  created: function created() {
5249
- var _this2 = this;
5230
+ var _this = this;
5250
5231
 
5251
5232
  this.tableId = 'el-table_' + tableIdSeed++;
5252
5233
  this.debouncedUpdateLayout = Object(external_throttle_debounce_["debounce"])(50, function () {
5253
- return _this2.doLayout();
5234
+ return _this.doLayout();
5254
5235
  });
5255
5236
  },
5256
5237
  mounted: function mounted() {
5257
- var _this3 = this;
5238
+ var _this2 = this;
5258
5239
 
5259
5240
  this.bindEvents();
5260
5241
  this.store.updateColumns();
@@ -5268,7 +5249,7 @@ var tableIdSeed = 1;
5268
5249
  // init filters
5269
5250
  this.store.states.columns.forEach(function (column) {
5270
5251
  if (column.filteredValue && column.filteredValue.length) {
5271
- _this3.store.commit('filterChange', {
5252
+ _this2.store.commit('filterChange', {
5272
5253
  column: column,
5273
5254
  values: column.filteredValue,
5274
5255
  silent: true
@@ -5281,7 +5262,7 @@ var tableIdSeed = 1;
5281
5262
  // 初始化吸顶表头位置
5282
5263
  if (this.isHeaderAffixed) {
5283
5264
  this.$nextTick(function () {
5284
- _this3.updateAffixHeader();
5265
+ _this2.updateAffixHeader();
5285
5266
  });
5286
5267
  }
5287
5268
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liuzengwei/element-ui",
3
- "version": "2.15.5-xn.56",
3
+ "version": "2.15.5-xn.57",
4
4
  "description": "A Component Library for Vue.js (Fork of Element UI).",
5
5
  "main": "lib/element-ui.common.js",
6
6
  "files": [
@@ -596,51 +596,29 @@
596
596
  },
597
597
 
598
598
  getSelectionRows() {
599
- const selection = this.store.states.selection || [];
600
- const result = [];
601
-
602
- // 获取表格主体元素
603
- const bodyWrapper = this.bodyWrapper;
604
- if (!bodyWrapper) return result;
605
-
606
- // 获取所有行元素
607
- const rows = bodyWrapper.querySelectorAll('.el-table__row');
608
-
609
- // 遍历选中行数据,找到对应的DOM节点
610
- selection.forEach(rowData => {
611
- // 通过row-key或者数据索引找到对应的行元素
612
- let targetRow = null;
613
- const rowKey = this.rowKey;
614
-
615
- if (rowKey) {
616
- // 如果有row-key,通过row-key查找
617
- const rowId = this.getRowKey ? this.getRowKey(rowData) : rowData[rowKey];
618
- rows.forEach(row => {
619
- const rowKeyAttr = row.getAttribute('row-key');
620
- if (rowKeyAttr === String(rowId)) {
621
- targetRow = row;
622
- }
623
- });
624
- } else {
625
- // 如果没有row-key,通过数据索引查找
626
- const dataIndex = this.store.states.data.indexOf(rowData);
627
- if (dataIndex >= 0 && rows[dataIndex]) {
628
- targetRow = rows[dataIndex];
629
- }
630
- }
599
+ return this.store.states.selection;
600
+ },
631
601
 
632
- // 如果找到了对应的行元素,添加到结果中
633
- if (targetRow) {
634
- result.push({
635
- row: rowData,
636
- index: this.store.states.data.indexOf(rowData),
637
- $el: targetRow,
638
- selected: true
639
- });
640
- }
602
+ getSelectionNodes() {
603
+ const { selection, treeData, rowKey } = this.store.states;
604
+
605
+ // 如果不是树形表格,返回简单的行数据
606
+ if (!rowKey || !Object.keys(treeData).length) {
607
+ return selection.map(row => ({ row }));
608
+ }
609
+
610
+ // 树形表格,返回完整节点信息
611
+ const getRowIdentity = require('./util').getRowIdentity;
612
+
613
+ return selection.map(row => {
614
+ const rowId = getRowIdentity(row, rowKey);
615
+ const nodeData = treeData[rowId] || {};
616
+
617
+ return {
618
+ row,
619
+ ...nodeData
620
+ };
641
621
  });
642
-
643
- return result;
644
622
  },
645
623
 
646
624
  updateAffixHeader() {
package/src/index.js CHANGED
@@ -232,7 +232,7 @@ if (typeof window !== 'undefined' && window.Vue) {
232
232
  }
233
233
 
234
234
  export default {
235
- version: '2.15.5-xn.56',
235
+ version: '2.15.5-xn.57',
236
236
  locale: locale.use,
237
237
  i18n: locale.i18n,
238
238
  install,