vxe-table 3.12.10-beta.2 → 3.12.10-beta.21

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.
Files changed (178) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/locale/lang/ar-EG.js +2 -1
  4. package/es/locale/lang/de-DE.js +2 -1
  5. package/es/locale/lang/en-US.js +2 -1
  6. package/es/locale/lang/es-ES.js +2 -1
  7. package/es/locale/lang/fr-FR.js +2 -1
  8. package/es/locale/lang/hu-HU.js +2 -1
  9. package/es/locale/lang/hy-AM.js +2 -1
  10. package/es/locale/lang/it-IT.js +2 -1
  11. package/es/locale/lang/ja-JP.js +2 -1
  12. package/es/locale/lang/ko-KR.js +2 -1
  13. package/es/locale/lang/nb-NO.js +2 -1
  14. package/es/locale/lang/pt-BR.js +2 -1
  15. package/es/locale/lang/ru-RU.js +4 -3
  16. package/es/locale/lang/th-TH.js +2 -1
  17. package/es/locale/lang/ug-CN.js +2 -1
  18. package/es/locale/lang/uk-UA.js +518 -517
  19. package/es/locale/lang/vi-VN.js +2 -1
  20. package/es/locale/lang/zh-CHT.js +2 -1
  21. package/es/locale/lang/zh-CN.js +2 -1
  22. package/es/style.css +1 -1
  23. package/es/style.min.css +1 -1
  24. package/es/table/module/edit/mixin.js +7 -7
  25. package/es/table/module/export/mixin.js +55 -32
  26. package/es/table/module/keyboard/mixin.js +68 -25
  27. package/es/table/module/menu/mixin.js +3 -1
  28. package/es/table/src/body.js +96 -64
  29. package/es/table/src/cell.js +3 -7
  30. package/es/table/src/column.js +2 -0
  31. package/es/table/src/columnInfo.js +1 -0
  32. package/es/table/src/footer.js +31 -6
  33. package/es/table/src/header.js +45 -141
  34. package/es/table/src/methods.js +918 -456
  35. package/es/table/src/props.js +6 -2
  36. package/es/table/src/table.js +299 -149
  37. package/es/table/src/util.js +67 -57
  38. package/es/table/style.css +299 -191
  39. package/es/table/style.min.css +1 -1
  40. package/es/ui/index.js +20 -10
  41. package/es/ui/src/log.js +1 -1
  42. package/es/vxe-table/style.css +299 -191
  43. package/es/vxe-table/style.min.css +1 -1
  44. package/lib/index.css +1 -1
  45. package/lib/index.min.css +1 -1
  46. package/lib/index.umd.js +1735 -1025
  47. package/lib/index.umd.min.js +1 -1
  48. package/lib/locale/lang/ar-EG.js +2 -1
  49. package/lib/locale/lang/ar-EG.min.js +1 -1
  50. package/lib/locale/lang/de-DE.js +2 -1
  51. package/lib/locale/lang/de-DE.min.js +1 -1
  52. package/lib/locale/lang/en-US.js +2 -1
  53. package/lib/locale/lang/en-US.min.js +1 -1
  54. package/lib/locale/lang/en-US.umd.js +2 -1
  55. package/lib/locale/lang/es-ES.js +2 -1
  56. package/lib/locale/lang/es-ES.min.js +1 -1
  57. package/lib/locale/lang/es-ES.umd.js +2 -1
  58. package/lib/locale/lang/fr-FR.js +2 -1
  59. package/lib/locale/lang/fr-FR.min.js +1 -1
  60. package/lib/locale/lang/hu-HU.js +2 -1
  61. package/lib/locale/lang/hu-HU.min.js +1 -1
  62. package/lib/locale/lang/hu-HU.umd.js +2 -1
  63. package/lib/locale/lang/hy-AM.js +2 -1
  64. package/lib/locale/lang/hy-AM.min.js +1 -1
  65. package/lib/locale/lang/it-IT.js +2 -1
  66. package/lib/locale/lang/it-IT.min.js +1 -1
  67. package/lib/locale/lang/ja-JP.js +2 -1
  68. package/lib/locale/lang/ja-JP.min.js +1 -1
  69. package/lib/locale/lang/ja-JP.umd.js +2 -1
  70. package/lib/locale/lang/ko-KR.js +2 -1
  71. package/lib/locale/lang/ko-KR.min.js +1 -1
  72. package/lib/locale/lang/ko-KR.umd.js +2 -1
  73. package/lib/locale/lang/nb-NO.js +2 -1
  74. package/lib/locale/lang/nb-NO.min.js +1 -1
  75. package/lib/locale/lang/pt-BR.js +2 -1
  76. package/lib/locale/lang/pt-BR.min.js +1 -1
  77. package/lib/locale/lang/pt-BR.umd.js +2 -1
  78. package/lib/locale/lang/ru-RU.js +4 -3
  79. package/lib/locale/lang/ru-RU.min.js +1 -1
  80. package/lib/locale/lang/ru-RU.umd.js +4 -3
  81. package/lib/locale/lang/th-TH.js +2 -1
  82. package/lib/locale/lang/th-TH.min.js +1 -1
  83. package/lib/locale/lang/ug-CN.js +2 -1
  84. package/lib/locale/lang/ug-CN.min.js +1 -1
  85. package/lib/locale/lang/uk-UA.js +518 -517
  86. package/lib/locale/lang/uk-UA.min.js +1 -1
  87. package/lib/locale/lang/uk-UA.umd.js +518 -517
  88. package/lib/locale/lang/vi-VN.js +2 -1
  89. package/lib/locale/lang/vi-VN.min.js +1 -1
  90. package/lib/locale/lang/zh-CHT.js +2 -1
  91. package/lib/locale/lang/zh-CHT.min.js +1 -1
  92. package/lib/locale/lang/zh-CHT.umd.js +2 -1
  93. package/lib/locale/lang/zh-CN.js +2 -1
  94. package/lib/locale/lang/zh-CN.min.js +1 -1
  95. package/lib/locale/lang/zh-CN.umd.js +2 -1
  96. package/lib/style.css +1 -1
  97. package/lib/style.min.css +1 -1
  98. package/lib/table/module/edit/mixin.js +12 -2
  99. package/lib/table/module/edit/mixin.min.js +1 -1
  100. package/lib/table/module/export/mixin.js +52 -27
  101. package/lib/table/module/export/mixin.min.js +1 -1
  102. package/lib/table/module/keyboard/mixin.js +73 -27
  103. package/lib/table/module/keyboard/mixin.min.js +1 -1
  104. package/lib/table/module/menu/mixin.js +3 -1
  105. package/lib/table/src/body.js +89 -60
  106. package/lib/table/src/body.min.js +1 -1
  107. package/lib/table/src/cell.js +3 -5
  108. package/lib/table/src/cell.min.js +1 -1
  109. package/lib/table/src/column.js +2 -0
  110. package/lib/table/src/column.min.js +1 -1
  111. package/lib/table/src/columnInfo.js +1 -0
  112. package/lib/table/src/columnInfo.min.js +1 -1
  113. package/lib/table/src/footer.js +26 -6
  114. package/lib/table/src/footer.min.js +1 -1
  115. package/lib/table/src/header.js +38 -153
  116. package/lib/table/src/header.min.js +1 -1
  117. package/lib/table/src/methods.js +1076 -551
  118. package/lib/table/src/methods.min.js +1 -1
  119. package/lib/table/src/props.js +6 -2
  120. package/lib/table/src/props.min.js +1 -1
  121. package/lib/table/src/table.js +269 -129
  122. package/lib/table/src/table.min.js +1 -1
  123. package/lib/table/src/util.js +80 -70
  124. package/lib/table/src/util.min.js +1 -1
  125. package/lib/table/style/style.css +299 -191
  126. package/lib/table/style/style.min.css +1 -1
  127. package/lib/ui/index.js +20 -10
  128. package/lib/ui/index.min.js +1 -1
  129. package/lib/ui/src/log.js +1 -1
  130. package/lib/ui/src/log.min.js +1 -1
  131. package/lib/vxe-table/style/style.css +299 -191
  132. package/lib/vxe-table/style/style.min.css +1 -1
  133. package/package.json +2 -2
  134. package/packages/locale/lang/ar-EG.ts +2 -1
  135. package/packages/locale/lang/de-DE.ts +2 -1
  136. package/packages/locale/lang/en-US.ts +2 -1
  137. package/packages/locale/lang/es-ES.ts +2 -1
  138. package/packages/locale/lang/fr-FR.ts +2 -1
  139. package/packages/locale/lang/hu-HU.ts +2 -1
  140. package/packages/locale/lang/hy-AM.ts +2 -1
  141. package/packages/locale/lang/it-IT.ts +2 -1
  142. package/packages/locale/lang/ja-JP.ts +2 -1
  143. package/packages/locale/lang/ko-KR.ts +2 -1
  144. package/packages/locale/lang/nb-NO.ts +2 -1
  145. package/packages/locale/lang/pt-BR.ts +2 -1
  146. package/packages/locale/lang/ru-RU.ts +4 -3
  147. package/packages/locale/lang/th-TH.ts +2 -1
  148. package/packages/locale/lang/ug-CN.ts +2 -1
  149. package/packages/locale/lang/uk-UA.ts +518 -517
  150. package/packages/locale/lang/vi-VN.ts +2 -1
  151. package/packages/locale/lang/zh-CHT.ts +2 -1
  152. package/packages/locale/lang/zh-CN.ts +2 -1
  153. package/packages/table/module/edit/mixin.ts +7 -7
  154. package/packages/table/module/export/mixin.ts +50 -27
  155. package/packages/table/module/keyboard/mixin.ts +65 -24
  156. package/packages/table/module/menu/mixin.ts +4 -1
  157. package/packages/table/src/body.ts +102 -61
  158. package/packages/table/src/cell.ts +3 -7
  159. package/packages/table/src/column.ts +7 -2
  160. package/packages/table/src/columnInfo.ts +1 -0
  161. package/packages/table/src/footer.ts +31 -6
  162. package/packages/table/src/header.ts +45 -141
  163. package/packages/table/src/methods.ts +957 -461
  164. package/packages/table/src/props.ts +6 -2
  165. package/packages/table/src/table.ts +325 -149
  166. package/packages/table/src/util.ts +75 -62
  167. package/packages/ui/index.ts +21 -9
  168. package/styles/components/table.scss +352 -260
  169. package/styles/theme/base.scss +4 -6
  170. package/styles/theme/dark.scss +1 -0
  171. package/styles/theme/light.scss +1 -0
  172. package/styles/variable.scss +1 -0
  173. /package/es/{iconfont.1736736807414.ttf → iconfont.1737182271148.ttf} +0 -0
  174. /package/es/{iconfont.1736736807414.woff → iconfont.1737182271148.woff} +0 -0
  175. /package/es/{iconfont.1736736807414.woff2 → iconfont.1737182271148.woff2} +0 -0
  176. /package/lib/{iconfont.1736736807414.ttf → iconfont.1737182271148.ttf} +0 -0
  177. /package/lib/{iconfont.1736736807414.woff → iconfont.1737182271148.woff} +0 -0
  178. /package/lib/{iconfont.1736736807414.woff2 → iconfont.1737182271148.woff2} +0 -0
@@ -943,6 +943,48 @@ export function readLocalFile(options = {}) {
943
943
  fileInput.click();
944
944
  });
945
945
  }
946
+ function handleFilterColumns(exportOpts, column, columns) {
947
+ return columns.some((item) => {
948
+ if (isColumnInfo(item)) {
949
+ return column.id === item.id;
950
+ }
951
+ else if (XEUtils.isString(item)) {
952
+ return column.field === item;
953
+ }
954
+ else {
955
+ const colid = item.id || item.colId;
956
+ const type = item.type;
957
+ const field = item.field;
958
+ if (colid) {
959
+ return column.id === colid;
960
+ }
961
+ else if (field && type) {
962
+ return column.field === field && column.type === type;
963
+ }
964
+ else if (field) {
965
+ return column.field === field;
966
+ }
967
+ else if (type) {
968
+ return column.type === type;
969
+ }
970
+ }
971
+ return false;
972
+ });
973
+ }
974
+ function handleFilterFields(exportOpts, column, includeFields, excludeFields) {
975
+ if (excludeFields) {
976
+ if (XEUtils.includes(excludeFields, column.field)) {
977
+ return false;
978
+ }
979
+ }
980
+ if (includeFields) {
981
+ if (XEUtils.includes(includeFields, column.field)) {
982
+ return true;
983
+ }
984
+ return false;
985
+ }
986
+ return exportOpts.original ? column.field : defaultFilterExportColumn(column);
987
+ }
946
988
  function handleExportAndPrint($xeTable, options, isPrint) {
947
989
  const props = $xeTable;
948
990
  const reactData = $xeTable;
@@ -972,7 +1014,7 @@ function handleExportAndPrint($xeTable, options, isPrint) {
972
1014
  const modes = defOpts.modes || [];
973
1015
  const checkMethod = customOpts.checkMethod;
974
1016
  const exportColumns = collectColumn.slice(0);
975
- const { columns } = defOpts;
1017
+ const { columns, excludeFields, includeFields } = defOpts;
976
1018
  // 处理类型
977
1019
  const typeList = types.map((value) => {
978
1020
  return {
@@ -995,38 +1037,19 @@ function handleExportAndPrint($xeTable, options, isPrint) {
995
1037
  // 默认选中
996
1038
  XEUtils.eachTree(exportColumns, (column, index, items, path, parent) => {
997
1039
  const isColGroup = column.children && column.children.length;
998
- if (isColGroup || defaultFilterExportColumn(column)) {
999
- column.checked = columns
1000
- ? columns.some((item) => {
1001
- if (isColumnInfo(item)) {
1002
- return column.id === item.id;
1003
- }
1004
- else if (XEUtils.isString(item)) {
1005
- return column.field === item;
1006
- }
1007
- else {
1008
- const colid = item.id || item.colId;
1009
- const type = item.type;
1010
- const field = item.field;
1011
- if (colid) {
1012
- return column.id === colid;
1013
- }
1014
- else if (field && type) {
1015
- return column.field === field && column.type === type;
1016
- }
1017
- else if (field) {
1018
- return column.field === field;
1019
- }
1020
- else if (type) {
1021
- return column.type === type;
1022
- }
1023
- }
1024
- return false;
1025
- })
1026
- : column.visible;
1027
- column.halfChecked = false;
1028
- column.disabled = (parent && parent.disabled) || (checkMethod ? !checkMethod({ column }) : false);
1040
+ let isChecked = false;
1041
+ if (columns && columns.length) {
1042
+ isChecked = handleFilterColumns(defOpts, column, columns);
1043
+ }
1044
+ else if (excludeFields || includeFields) {
1045
+ isChecked = handleFilterFields(defOpts, column, includeFields, excludeFields);
1046
+ }
1047
+ else {
1048
+ isChecked = column.visible && (isColGroup || defaultFilterExportColumn(column));
1029
1049
  }
1050
+ column.checked = isChecked;
1051
+ column.halfChecked = false;
1052
+ column.disabled = (parent && parent.disabled) || (checkMethod ? !checkMethod({ column }) : false);
1030
1053
  });
1031
1054
  // 更新条件
1032
1055
  Object.assign(exportStore, {
@@ -1,4 +1,5 @@
1
1
  import XEUtils from 'xe-utils';
2
+ import { getRefElem } from '../../src/util';
2
3
  import { browse, hasClass, getAbsolutePos, addClass, removeClass } from '../../../ui/src/dom';
3
4
  function getTargetOffset(target, container) {
4
5
  let offsetTop = 0;
@@ -22,36 +23,66 @@ function getTargetOffset(target, container) {
22
23
  return { offsetTop, offsetLeft };
23
24
  }
24
25
  function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offsetClientTop, moveRange) {
26
+ const props = $xeTable;
25
27
  const reactData = $xeTable;
26
28
  const internalData = $xeTable;
29
+ const { showOverflow } = props;
30
+ const { fullAllDataRowIdData, isResizeCellHeight } = internalData;
31
+ const rowOpts = $xeTable.computeRowOpts;
32
+ const cellOpts = $xeTable.computeCellOpts;
33
+ const defaultRowHeight = $xeTable.computeDefaultRowHeight;
34
+ const { row } = params;
27
35
  let countHeight = 0;
28
36
  let rangeRows = [];
29
37
  let moveSize = 0;
30
38
  const isDown = moveRange > 0;
31
- const { scrollYLoad, rowHeight } = reactData;
39
+ const { scrollYLoad } = reactData;
32
40
  const { afterFullData } = internalData;
41
+ if (isDown) {
42
+ moveSize = offsetClientTop + moveRange;
43
+ }
44
+ else {
45
+ moveSize = (trRect.height - offsetClientTop) + Math.abs(moveRange);
46
+ }
33
47
  if (scrollYLoad) {
34
- if (isDown) {
35
- moveSize = offsetClientTop + moveRange;
36
- }
37
- else {
38
- moveSize = (trRect.height - offsetClientTop) + Math.abs(moveRange);
39
- }
40
- const _rowIndex = $xeTable.getVTRowIndex(params.row);
41
- if (isDown) {
42
- rangeRows = afterFullData.slice(_rowIndex, _rowIndex + Math.ceil(moveSize / rowHeight));
48
+ const _rowIndex = $xeTable.getVTRowIndex(row);
49
+ const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
50
+ if (!isCustomCellHeight && showOverflow) {
51
+ if (isDown) {
52
+ rangeRows = afterFullData.slice(_rowIndex, _rowIndex + Math.ceil(moveSize / defaultRowHeight));
53
+ }
54
+ else {
55
+ rangeRows = afterFullData.slice(_rowIndex - Math.floor(moveSize / defaultRowHeight), _rowIndex + 1);
56
+ }
43
57
  }
44
58
  else {
45
- rangeRows = afterFullData.slice(_rowIndex - Math.floor(moveSize / rowHeight), _rowIndex + 1);
59
+ if (isDown) {
60
+ for (let i = _rowIndex; i < afterFullData.length; i++) {
61
+ const item = afterFullData[i];
62
+ const rowid = $xeTable.getRowid(item);
63
+ const rowRest = fullAllDataRowIdData[rowid] || {};
64
+ countHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight;
65
+ rangeRows.push(item);
66
+ if (countHeight > moveSize) {
67
+ return rangeRows;
68
+ }
69
+ }
70
+ }
71
+ else {
72
+ for (let len = _rowIndex; len >= 0; len--) {
73
+ const item = afterFullData[len];
74
+ const rowid = $xeTable.getRowid(item);
75
+ const rowRest = fullAllDataRowIdData[rowid] || {};
76
+ countHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight;
77
+ rangeRows.push(item);
78
+ if (countHeight > moveSize) {
79
+ return rangeRows;
80
+ }
81
+ }
82
+ }
46
83
  }
47
84
  }
48
85
  else {
49
- if (isDown) {
50
- moveSize = evnt.clientY - trRect.y;
51
- }
52
- else {
53
- moveSize = trRect.y - evnt.clientY + trRect.height;
54
- }
55
86
  const siblingProp = isDown ? 'next' : 'previous';
56
87
  while (targetTrElem && countHeight < moveSize) {
57
88
  const rowNodeRest = $xeTable.getRowNode(targetTrElem);
@@ -217,15 +248,27 @@ export default {
217
248
  },
218
249
  handleCheckboxRangeEvent(evnt, params) {
219
250
  const $xeTable = this;
251
+ const internalData = $xeTable;
252
+ const { elemStore } = internalData;
253
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
254
+ const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
255
+ const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
220
256
  const { column, cell } = params;
221
257
  if (column.type === 'checkbox') {
222
- const { $el, elemStore } = this;
258
+ let bodyWrapperElem = bodyScrollElem;
259
+ if (leftScrollElem && column.fixed === 'left') {
260
+ bodyWrapperElem = leftScrollElem;
261
+ }
262
+ else if (rightScrollElem && column.fixed === 'right') {
263
+ bodyWrapperElem = rightScrollElem;
264
+ }
265
+ if (!bodyWrapperElem) {
266
+ return;
267
+ }
268
+ const el = $xeTable.$refs.refElem;
223
269
  const disX = evnt.clientX;
224
270
  const disY = evnt.clientY;
225
- const bodyWrapperElem = elemStore[`${column.fixed || 'main'}-body-wrapper`] || elemStore['main-body-wrapper'];
226
271
  const checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range');
227
- const domMousemove = document.onmousemove;
228
- const domMouseup = document.onmouseup;
229
272
  const trElem = cell.parentNode;
230
273
  const selectRecords = this.getCheckboxRecords();
231
274
  let lastRangeRows = [];
@@ -331,7 +374,7 @@ export default {
331
374
  }
332
375
  }, 50);
333
376
  };
334
- addClass($el, 'drag--range');
377
+ addClass(el, 'drag--range');
335
378
  document.onmousemove = evnt => {
336
379
  evnt.preventDefault();
337
380
  evnt.stopPropagation();
@@ -359,10 +402,10 @@ export default {
359
402
  };
360
403
  document.onmouseup = (evnt) => {
361
404
  stopMouseScroll();
362
- removeClass($el, 'drag--range');
405
+ removeClass(el, 'drag--range');
363
406
  checkboxRangeElem.removeAttribute('style');
364
- document.onmousemove = domMousemove;
365
- document.onmouseup = domMouseup;
407
+ document.onmousemove = null;
408
+ document.onmouseup = null;
366
409
  triggerEvent('end', evnt);
367
410
  };
368
411
  triggerEvent('start', evnt);
@@ -57,6 +57,8 @@ export default {
57
57
  * 快捷菜单事件处理
58
58
  */
59
59
  handleGlobalContextmenuEvent(evnt) {
60
+ const $xeTable = this;
61
+ const internalData = $xeTable;
60
62
  const { $refs, tId, editStore, menuConfig, contextMenu, ctxMenuStore, ctxMenuOpts, mouseConfig, mouseOpts } = this;
61
63
  const { selected } = editStore;
62
64
  const layoutList = ['header', 'body', 'footer'];
@@ -65,7 +67,7 @@ export default {
65
67
  evnt.preventDefault();
66
68
  return;
67
69
  }
68
- if (this._keyCtx) {
70
+ if (internalData._keyCtx) {
69
71
  const type = 'body';
70
72
  const params = { type, $grid: this.$xegrid, $table: this, keyboard: true, columns: this.visibleColumn.slice(0), $event: evnt };
71
73
  // 如果开启单元格区域
@@ -11,10 +11,10 @@ const isVMScrollProcess = ($xeTable) => {
11
11
  const tableProps = $xeTable;
12
12
  const tableReactData = $xeTable;
13
13
  const { delayHover } = tableProps;
14
- const { lastScrollTime, _isResize } = tableReactData;
15
- return !!(_isResize || (lastScrollTime && Date.now() < lastScrollTime + delayHover));
14
+ const { lastScrollTime, isDragResize } = tableReactData;
15
+ return !!(isDragResize || (lastScrollTime && Date.now() < lastScrollTime + delayHover));
16
16
  };
17
- function renderLine(h, _vm, params) {
17
+ function renderLine(h, _vm, params, cellHeight) {
18
18
  const $xeTable = _vm.$parent;
19
19
  const tableProps = $xeTable;
20
20
  const tableInternalData = $xeTable;
@@ -33,18 +33,20 @@ function renderLine(h, _vm, params) {
33
33
  let prevRow = null;
34
34
  if (rest) {
35
35
  rLevel = rest.level;
36
- prevRow = rest.items[rest._index - 1];
36
+ prevRow = rest.items[rest.treeIndex - 1];
37
37
  }
38
38
  const isFirstRow = $xeTable.eqRow(afterFullData[0], row);
39
39
  if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
40
40
  return [
41
41
  h('div', {
42
+ key: 'tl',
42
43
  class: 'vxe-tree--line-wrapper'
43
44
  }, [
44
45
  h('div', {
45
46
  class: 'vxe-tree--line',
46
47
  style: {
47
48
  height: `${isFirstRow ? 1 : calcTreeLine(params, prevRow)}px`,
49
+ bottom: `-${Math.floor(cellHeight / 2)}px`,
48
50
  left: `${(rLevel * treeOpts.indent) + (rLevel ? 2 - getOffsetSize($xeTable) : 0) + 16}px`
49
51
  }
50
52
  })
@@ -62,8 +64,8 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
62
64
  const tableReactData = $xeTable;
63
65
  const tableInternalData = $xeTable;
64
66
  const { fullAllDataRowIdData } = tableInternalData;
65
- const { columnKey, height, showOverflow: allColumnOverflow, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig } = tableProps;
66
- const { tableData, overflowX, currentColumn, scrollXLoad, scrollYLoad, isCalcCellHeight, mergeList, editStore, isAllOverflow, validErrorMaps } = tableReactData;
67
+ const { columnKey, height, showOverflow: allColumnOverflow, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps;
68
+ const { tableData, overflowX, currentColumn, scrollXLoad, scrollYLoad, calcCellHeightFlag, resizeHeightFlag, mergeList, editStore, isAllOverflow, validErrorMaps } = tableReactData;
67
69
  const { afterFullData, scrollXStore, scrollYStore } = tableInternalData;
68
70
  const cellOpts = $xeTable.computeCellOpts;
69
71
  const validOpts = $xeTable.computeValidOpts;
@@ -73,15 +75,16 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
73
75
  const rowOpts = $xeTable.computeRowOpts;
74
76
  const rowDragOpts = $xeTable.computeRowDragOpts;
75
77
  const defaultRowHeight = $xeTable.computeDefaultRowHeight;
78
+ const currCellHeight = cellOpts.height || rowOpts.height || defaultRowHeight;
76
79
  const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = rowDragOpts;
77
80
  const columnOpts = $xeTable.computeColumnOpts;
78
81
  const mouseOpts = $xeTable.computeMouseOpts;
79
82
  const areaOpts = $xeTable.computeAreaOpts;
80
83
  const { selectCellToRow } = areaOpts;
81
- const { type, cellRender, editRender, align, showOverflow, className, treeNode, slots } = column;
84
+ const { type, cellRender, editRender, align, showOverflow, className, treeNode, rowResize, slots } = column;
82
85
  const { verticalAlign } = cellOpts;
83
86
  const { actived } = editStore;
84
- const { height: customRHeight } = rowOpts;
87
+ const rowRest = fullAllDataRowIdData[rowid];
85
88
  const colid = column.id;
86
89
  const renderOpts = editRender || cellRender;
87
90
  const compConf = renderOpts ? renderer.get(renderOpts.name) : null;
@@ -91,21 +94,22 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
91
94
  const columnIndex = $xeTable.getColumnIndex(column);
92
95
  const _columnIndex = $xeTable.getVTColumnIndex(column);
93
96
  const isEdit = isEnableConf(editRender);
97
+ const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0;
94
98
  let fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX;
99
+ const isPadding = allPadding === null ? cellOpts.padding : allPadding;
95
100
  const cellOverflow = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? allColumnOverflow : showOverflow;
96
101
  const showEllipsis = cellOverflow === 'ellipsis';
97
102
  const showTitle = cellOverflow === 'title';
98
103
  const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
99
104
  // 如果表格加上 showOverflow 则不再支持列单独设置
100
- const hasEllipsis = allColumnOverflow || showTitle || showTooltip || showEllipsis;
105
+ const hasEllipsis = allColumnOverflow || showTitle || showTooltip || showEllipsis || resizeHeight > 0;
101
106
  let isDirty;
102
107
  const tdOns = {};
103
- const rest = fullAllDataRowIdData[rowid];
104
108
  const cellAlign = align || (compConf ? compConf.tableCellAlign : '') || allAlign;
105
109
  const errorValidItem = validErrorMaps[`${rowid}:${colid}`];
106
110
  const showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? (height || tableData.length > 1) : validOpts.message === 'inline');
107
- const attrs = { colid };
108
- const params = {
111
+ const tdAttrs = { colid };
112
+ const cellParams = {
109
113
  $table: $xeTable,
110
114
  $grid: $xeTable.xegrid,
111
115
  isEdit: false,
@@ -133,7 +137,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
133
137
  isRowDragCell = rowDragOpts.trigger === 'row' || (column.dragSort && rowDragOpts.trigger === 'cell');
134
138
  }
135
139
  if (isRowDragCell) {
136
- isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(params));
140
+ isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
137
141
  }
138
142
  // hover 进入事件
139
143
  if (showTitle || showTooltip || showAllTip || tooltipConfig) {
@@ -146,9 +150,9 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
146
150
  }
147
151
  else if (showTooltip || showAllTip) {
148
152
  // 如果配置了显示 tooltip
149
- $xeTable.triggerBodyTooltipEvent(evnt, params);
153
+ $xeTable.triggerBodyTooltipEvent(evnt, cellParams);
150
154
  }
151
- $xeTable.dispatchEvent('cell-mouseenter', Object.assign({ cell: evnt.currentTarget }, params), evnt);
155
+ $xeTable.dispatchEvent('cell-mouseenter', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt);
152
156
  };
153
157
  }
154
158
  // hover 退出事件
@@ -160,13 +164,13 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
160
164
  if (showTooltip || showAllTip) {
161
165
  $xeTable.handleTargetLeaveEvent(evnt);
162
166
  }
163
- $xeTable.dispatchEvent('cell-mouseleave', Object.assign({ cell: evnt.currentTarget }, params), evnt);
167
+ $xeTable.dispatchEvent('cell-mouseleave', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt);
164
168
  };
165
169
  }
166
170
  // 按下事件处理
167
171
  if (isRowDragCell || checkboxOpts.range || mouseConfig) {
168
172
  tdOns.mousedown = (evnt) => {
169
- $xeTable.triggerCellMousedownEvent(evnt, params);
173
+ $xeTable.triggerCellMousedownEvent(evnt, cellParams);
170
174
  };
171
175
  }
172
176
  // 拖拽列事件
@@ -175,11 +179,11 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
175
179
  }
176
180
  // 点击事件处理
177
181
  tdOns.click = (evnt) => {
178
- $xeTable.triggerCellClickEvent(evnt, params);
182
+ $xeTable.triggerCellClickEvent(evnt, cellParams);
179
183
  };
180
184
  // 双击事件处理
181
185
  tdOns.dblclick = (evnt) => {
182
- $xeTable.triggerCellDblclickEvent(evnt, params);
186
+ $xeTable.triggerCellDblclickEvent(evnt, cellParams);
183
187
  };
184
188
  // 合并行或列
185
189
  if (mergeList.length) {
@@ -190,29 +194,29 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
190
194
  return null;
191
195
  }
192
196
  if (rowspan > 1) {
193
- attrs.rowspan = rowspan;
197
+ tdAttrs.rowspan = rowspan;
194
198
  }
195
199
  if (colspan > 1) {
196
- attrs.colspan = colspan;
200
+ tdAttrs.colspan = colspan;
197
201
  }
198
202
  }
199
203
  }
200
204
  else if (spanMethod) {
201
205
  // 自定义合并行或列的方法
202
- const { rowspan = 1, colspan = 1 } = spanMethod(params) || {};
206
+ const { rowspan = 1, colspan = 1 } = spanMethod(cellParams) || {};
203
207
  if (!rowspan || !colspan) {
204
208
  return null;
205
209
  }
206
210
  if (rowspan > 1) {
207
- attrs.rowspan = rowspan;
211
+ tdAttrs.rowspan = rowspan;
208
212
  }
209
213
  if (colspan > 1) {
210
- attrs.colspan = colspan;
214
+ tdAttrs.colspan = colspan;
211
215
  }
212
216
  }
213
217
  // 如果被合并不可隐藏
214
218
  if (fixedHiddenColumn && mergeList) {
215
- if (attrs.colspan > 1 || attrs.rowspan > 1) {
219
+ if (tdAttrs.colspan > 1 || tdAttrs.rowspan > 1) {
216
220
  fixedHiddenColumn = false;
217
221
  }
218
222
  }
@@ -220,39 +224,77 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
220
224
  if (!fixedHiddenColumn && editConfig && (editRender || cellRender) && (editOpts.showStatus || editOpts.showUpdateStatus)) {
221
225
  isDirty = $xeTable.isUpdateByRow(row, column.field);
222
226
  }
227
+ const isVNAutoHeight = scrollYLoad && !hasEllipsis;
228
+ let cellHeight = currCellHeight;
229
+ const vnHeight = calcCellHeightFlag ? rowRest.height : 0;
230
+ if (resizeHeight) {
231
+ cellHeight = resizeHeight;
232
+ }
233
+ else {
234
+ if (scrollYLoad) {
235
+ if (!hasEllipsis) {
236
+ cellHeight = vnHeight || currCellHeight;
237
+ }
238
+ }
239
+ }
240
+ const isLastColumn = $columnIndex === columns.length - 1;
241
+ const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
242
+ let isVNPreEmptyStatus = false;
243
+ if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
244
+ isVNPreEmptyStatus = true;
245
+ }
246
+ else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
247
+ isVNPreEmptyStatus = true;
248
+ }
249
+ const tcStyle = {};
250
+ if (hasEllipsis) {
251
+ tcStyle.height = `${cellHeight}px`;
252
+ }
253
+ else {
254
+ tcStyle.minHeight = `${cellHeight}px`;
255
+ }
223
256
  const tdVNs = [];
224
257
  if (fixedHiddenColumn && (allColumnOverflow ? isAllOverflow : allColumnOverflow)) {
225
258
  tdVNs.push(h('div', {
259
+ key: 'tc',
226
260
  class: ['vxe-cell', {
227
261
  'c--title': showTitle,
228
262
  'c--tooltip': showTooltip,
229
263
  'c--ellipsis': showEllipsis
230
264
  }],
231
- style: {
232
- maxHeight: hasEllipsis && (customRHeight || defaultRowHeight) ? `${customRHeight || defaultRowHeight}px` : ''
233
- }
265
+ style: tcStyle
234
266
  }));
235
267
  }
236
268
  else {
237
269
  // 渲染单元格
238
- tdVNs.push(...renderLine(h, _vm, params), h('div', {
270
+ tdVNs.push(...renderLine(h, _vm, cellParams, cellHeight), h('div', {
271
+ key: 'tc',
239
272
  class: ['vxe-cell', {
240
273
  'c--title': showTitle,
241
274
  'c--tooltip': showTooltip,
242
275
  'c--ellipsis': showEllipsis
243
276
  }],
244
- style: {
245
- maxHeight: hasEllipsis && (customRHeight || defaultRowHeight) ? `${customRHeight || defaultRowHeight}px` : ''
246
- },
277
+ style: tcStyle,
247
278
  attrs: {
248
279
  title: showTitle ? $xeTable.getCellLabel(row, column) : null
249
280
  }
250
- }, column.renderCell(h, params)));
281
+ }, isVNPreEmptyStatus
282
+ ? []
283
+ : [
284
+ h('div', {
285
+ attrs: {
286
+ colid,
287
+ rowid
288
+ },
289
+ class: 'vxe-cell--wrapper'
290
+ }, column.renderCell(h, cellParams))
291
+ ]));
251
292
  if (showValidTip && errorValidItem) {
252
293
  const errRule = errorValidItem.rule;
253
294
  const validSlot = slots ? slots.valid : null;
254
- const validParams = Object.assign(Object.assign(Object.assign({}, params), errorValidItem), { rule: errorValidItem });
295
+ const validParams = Object.assign(Object.assign(Object.assign({}, cellParams), errorValidItem), { rule: errorValidItem });
255
296
  tdVNs.push(h('div', {
297
+ key: 'tcv',
256
298
  class: ['vxe-cell--valid-error-tip', getClass(validOpts.className, errorValidItem)],
257
299
  style: errRule && errRule.maxWidth
258
300
  ? {
@@ -274,34 +316,24 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
274
316
  ]));
275
317
  }
276
318
  }
277
- let cellHeight = '';
278
- const vnHeight = isCalcCellHeight ? rest.height : 0;
279
- if (hasEllipsis) {
280
- if (customRHeight) {
281
- cellHeight = `${customRHeight}px`;
282
- }
283
- else if (!isAllOverflow) {
284
- cellHeight = `${vnHeight || defaultRowHeight || 18}px`;
285
- }
286
- }
287
- else {
288
- cellHeight = `${vnHeight || defaultRowHeight || 18}px`;
289
- }
290
319
  if (mouseConfig && mouseOpts.area && selectCellToRow) {
291
320
  if ((!$columnIndex && selectCellToRow === true) ||
292
321
  (selectCellToRow === column.field)) {
293
322
  tdVNs.push(h('div', {
323
+ key: 'tca',
294
324
  class: 'vxe-cell--area-status'
295
325
  }));
296
326
  }
297
327
  }
298
- const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
299
- let isPreLoadStatus = false;
300
- if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex || _rowIndex > scrollYStore.visibleEndIndex)) {
301
- isPreLoadStatus = true;
302
- }
303
- else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex || _columnIndex > scrollXStore.visibleEndIndex)) {
304
- isPreLoadStatus = true;
328
+ if (rowResize && rowOpts.resizable) {
329
+ tdVNs.push(h('div', {
330
+ key: 'tcr',
331
+ class: 'vxe-cell--row-resizable',
332
+ on: {
333
+ mousedown: (evnt) => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
334
+ dblclick: (evnt) => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
335
+ }
336
+ }));
305
337
  }
306
338
  return h('td', {
307
339
  class: [
@@ -311,12 +343,14 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
311
343
  [`col--${cellAlign}`]: cellAlign,
312
344
  [`col--vertical-${verticalAlign}`]: verticalAlign,
313
345
  [`col--${type}`]: type,
314
- 'col--last': $columnIndex === columns.length - 1,
346
+ 'col--last': isLastColumn,
315
347
  'col--tree-node': treeNode,
316
348
  'col--edit': isEdit,
317
349
  'col--ellipsis': hasEllipsis,
350
+ 'col--auto-height': isVNAutoHeight,
318
351
  'fixed--width': !isAutoCellWidth,
319
352
  'fixed--hidden': fixedHiddenColumn,
353
+ 'is--padding': isPadding,
320
354
  'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
321
355
  'is--drag-disabled': isDisabledDrag,
322
356
  'col--dirty': isDirty,
@@ -324,17 +358,15 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
324
358
  'col--valid-error': !!errorValidItem,
325
359
  'col--current': currentColumn === column
326
360
  },
327
- getClass(compCellClassName, params),
328
- getClass(className, params),
329
- getClass(allCellClassName, params)
361
+ getClass(compCellClassName, cellParams),
362
+ getClass(className, cellParams),
363
+ getClass(allCellClassName, cellParams)
330
364
  ],
331
365
  key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? column.id : $columnIndex,
332
- attrs,
333
- style: Object.assign({
334
- height: cellHeight
335
- }, XEUtils.isFunction(compCellStyle) ? compCellStyle(params) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(params) : cellStyle),
366
+ attrs: tdAttrs,
367
+ style: Object.assign({}, XEUtils.isFunction(compCellStyle) ? compCellStyle(cellParams) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(cellParams) : cellStyle),
336
368
  on: tdOns
337
- }, isPreLoadStatus || (isOptimizeMode && fixedHiddenColumn) ? [] : tdVNs);
369
+ }, isOptimizeMode && fixedHiddenColumn ? [] : tdVNs);
338
370
  }
339
371
  function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
340
372
  const $xeTable = _vm.$parent;
@@ -648,7 +680,7 @@ export default {
648
680
  $xeTable.triggerBodyScrollEvent(evnt, fixedType);
649
681
  }
650
682
  };
651
- if (scrollYLoad || leftFixedWidth || rightFixedWidth) {
683
+ if (leftFixedWidth || rightFixedWidth) {
652
684
  ons.wheel = $xeTable.triggerBodyWheelEvent;
653
685
  }
654
686
  return h('div', {
@@ -156,7 +156,7 @@ function renderTitleContent(h, params, content) {
156
156
  const ons = {};
157
157
  if (showTitle || showTooltip || showAllTip) {
158
158
  ons.mouseenter = (evnt) => {
159
- if (tableReactData._isResize) {
159
+ if (tableReactData.isDragResize) {
160
160
  return;
161
161
  }
162
162
  if (showTitle) {
@@ -169,7 +169,7 @@ function renderTitleContent(h, params, content) {
169
169
  }
170
170
  if (showTooltip || showAllTip) {
171
171
  ons.mouseleave = (evnt) => {
172
- if (tableReactData._isResize) {
172
+ if (tableReactData.isDragResize) {
173
173
  return;
174
174
  }
175
175
  if (showTooltip || showAllTip) {
@@ -386,11 +386,7 @@ export const Cell = {
386
386
  return Cell.renderTreeIcon(h, params, Cell.renderDefaultCell.call(this, h, params));
387
387
  },
388
388
  renderDefaultFooter(h, params) {
389
- return [
390
- h('span', {
391
- class: 'vxe-cell--item'
392
- }, getFooterContent(h, params))
393
- ];
389
+ return getFooterContent(h, params);
394
390
  },
395
391
  /**
396
392
  * 树节点
@@ -68,6 +68,8 @@ export const columnProps = {
68
68
  treeNode: Boolean,
69
69
  // 设置为拖拽排序
70
70
  dragSort: Boolean,
71
+ // 设置为行高拖拽
72
+ rowResize: Boolean,
71
73
  // 是否可视
72
74
  visible: { type: Boolean, default: null },
73
75
  // 表头单元格数据导出方法