vxe-table 3.12.10-beta.9 → 3.12.11

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 +4 -3
  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 +105 -69
  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 +114 -87
  29. package/es/table/src/cell.js +43 -57
  30. package/es/table/src/column.js +43 -8
  31. package/es/table/src/columnInfo.js +3 -0
  32. package/es/table/src/footer.js +47 -6
  33. package/es/table/src/header.js +67 -165
  34. package/es/table/src/methods.js +962 -480
  35. package/es/table/src/props.js +14 -4
  36. package/es/table/src/table.js +114 -33
  37. package/es/table/src/util.js +74 -58
  38. package/es/table/style.css +246 -191
  39. package/es/table/style.min.css +1 -1
  40. package/es/ui/index.js +20 -6
  41. package/es/ui/src/log.js +1 -1
  42. package/es/vxe-table/style.css +246 -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 +1725 -1022
  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 +4 -3
  53. package/lib/locale/lang/en-US.min.js +1 -1
  54. package/lib/locale/lang/en-US.umd.js +4 -3
  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 +7 -2
  99. package/lib/table/module/edit/mixin.min.js +1 -1
  100. package/lib/table/module/export/mixin.js +105 -64
  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 +114 -80
  106. package/lib/table/src/body.min.js +1 -1
  107. package/lib/table/src/cell.js +32 -42
  108. package/lib/table/src/cell.min.js +1 -1
  109. package/lib/table/src/column.js +12 -0
  110. package/lib/table/src/column.min.js +1 -1
  111. package/lib/table/src/columnInfo.js +3 -0
  112. package/lib/table/src/columnInfo.min.js +1 -1
  113. package/lib/table/src/footer.js +43 -4
  114. package/lib/table/src/footer.min.js +1 -1
  115. package/lib/table/src/header.js +49 -172
  116. package/lib/table/src/header.min.js +1 -1
  117. package/lib/table/src/methods.js +1072 -538
  118. package/lib/table/src/methods.min.js +1 -1
  119. package/lib/table/src/props.js +14 -4
  120. package/lib/table/src/props.min.js +1 -1
  121. package/lib/table/src/table.js +113 -36
  122. package/lib/table/src/table.min.js +1 -1
  123. package/lib/table/src/util.js +88 -71
  124. package/lib/table/src/util.min.js +1 -1
  125. package/lib/table/style/style.css +246 -191
  126. package/lib/table/style/style.min.css +1 -1
  127. package/lib/ui/index.js +20 -6
  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 +246 -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 +4 -3
  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 +138 -80
  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 +126 -90
  158. package/packages/table/src/cell.ts +45 -67
  159. package/packages/table/src/column.ts +48 -10
  160. package/packages/table/src/columnInfo.ts +3 -0
  161. package/packages/table/src/footer.ts +50 -7
  162. package/packages/table/src/header.ts +67 -166
  163. package/packages/table/src/methods.ts +1007 -492
  164. package/packages/table/src/props.ts +16 -6
  165. package/packages/table/src/table.ts +124 -33
  166. package/packages/table/src/util.ts +83 -63
  167. package/packages/ui/index.ts +19 -5
  168. package/styles/components/table.scss +313 -274
  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.1736854649055.ttf → iconfont.1739008141486.ttf} +0 -0
  174. /package/es/{iconfont.1736854649055.woff → iconfont.1739008141486.woff} +0 -0
  175. /package/es/{iconfont.1736854649055.woff2 → iconfont.1739008141486.woff2} +0 -0
  176. /package/lib/{iconfont.1736854649055.ttf → iconfont.1739008141486.ttf} +0 -0
  177. /package/lib/{iconfont.1736854649055.woff → iconfont.1739008141486.woff} +0 -0
  178. /package/lib/{iconfont.1736854649055.woff2 → iconfont.1739008141486.woff2} +0 -0
@@ -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;
@@ -39,12 +39,14 @@ function renderLine(h, _vm, params) {
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,26 +64,28 @@ 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, resizable: allResizable, border, height, 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;
70
72
  const checkboxOpts = $xeTable.computeCheckboxOpts;
71
73
  const editOpts = $xeTable.computeEditOpts;
72
74
  const tooltipOpts = $xeTable.computeTooltipOpts;
75
+ const { isAllColumnDrag, isAllRowDrag } = $xeTable.resizableOpts;
73
76
  const rowOpts = $xeTable.computeRowOpts;
74
77
  const rowDragOpts = $xeTable.computeRowDragOpts;
75
78
  const defaultRowHeight = $xeTable.computeDefaultRowHeight;
79
+ const customCellHeight = cellOpts.height || rowOpts.height;
76
80
  const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = rowDragOpts;
77
81
  const columnOpts = $xeTable.computeColumnOpts;
78
82
  const mouseOpts = $xeTable.computeMouseOpts;
79
83
  const areaOpts = $xeTable.computeAreaOpts;
80
84
  const { selectCellToRow } = areaOpts;
81
- const { type, cellRender, editRender, align, showOverflow, className, treeNode, slots } = column;
82
- const { verticalAlign } = cellOpts;
85
+ const { type, cellRender, editRender, align, showOverflow, className, treeNode, rowResize, padding, verticalAlign, slots } = column;
86
+ const { verticalAlign: allVerticalAlign } = cellOpts;
83
87
  const { actived } = editStore;
84
- const { height: customRHeight } = rowOpts;
88
+ const rowRest = fullAllDataRowIdData[rowid];
85
89
  const colid = column.id;
86
90
  const renderOpts = editRender || cellRender;
87
91
  const compConf = renderOpts ? renderer.get(renderOpts.name) : null;
@@ -91,21 +95,25 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
91
95
  const columnIndex = $xeTable.getColumnIndex(column);
92
96
  const _columnIndex = $xeTable.getVTColumnIndex(column);
93
97
  const isEdit = isEnableConf(editRender);
98
+ const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0;
94
99
  let fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX;
95
- const cellOverflow = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? allColumnOverflow : showOverflow;
100
+ const isCellPadding = XEUtils.eqNull(padding) ? (allPadding === null ? cellOpts.padding : allPadding) : padding;
101
+ const cellOverflow = XEUtils.eqNull(showOverflow) ? isAllOverflow : showOverflow;
96
102
  const showEllipsis = cellOverflow === 'ellipsis';
97
103
  const showTitle = cellOverflow === 'title';
98
104
  const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
99
- // 如果表格加上 showOverflow 则不再支持列单独设置
100
- const hasEllipsis = allColumnOverflow || showTitle || showTooltip || showEllipsis;
105
+ const hasEllipsis = isAllOverflow || showTitle || showTooltip || showEllipsis;
106
+ const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable));
107
+ const isCsHeight = !!customCellHeight;
108
+ const isRsHeight = resizeHeight > 0;
101
109
  let isDirty;
102
110
  const tdOns = {};
103
- const rest = fullAllDataRowIdData[rowid];
104
111
  const cellAlign = align || (compConf ? compConf.tableCellAlign : '') || allAlign;
112
+ const cellVerticalAlign = XEUtils.eqNull(verticalAlign) ? allVerticalAlign : verticalAlign;
105
113
  const errorValidItem = validErrorMaps[`${rowid}:${colid}`];
106
114
  const showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? (height || tableData.length > 1) : validOpts.message === 'inline');
107
- const attrs = { colid };
108
- const params = {
115
+ const tdAttrs = { colid };
116
+ const cellParams = {
109
117
  $table: $xeTable,
110
118
  $grid: $xeTable.xegrid,
111
119
  isEdit: false,
@@ -133,7 +141,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
133
141
  isRowDragCell = rowDragOpts.trigger === 'row' || (column.dragSort && rowDragOpts.trigger === 'cell');
134
142
  }
135
143
  if (isRowDragCell) {
136
- isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(params));
144
+ isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
137
145
  }
138
146
  // hover 进入事件
139
147
  if (showTitle || showTooltip || showAllTip || tooltipConfig) {
@@ -146,9 +154,9 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
146
154
  }
147
155
  else if (showTooltip || showAllTip) {
148
156
  // 如果配置了显示 tooltip
149
- $xeTable.triggerBodyTooltipEvent(evnt, params);
157
+ $xeTable.triggerBodyTooltipEvent(evnt, cellParams);
150
158
  }
151
- $xeTable.dispatchEvent('cell-mouseenter', Object.assign({ cell: evnt.currentTarget }, params), evnt);
159
+ $xeTable.dispatchEvent('cell-mouseenter', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt);
152
160
  };
153
161
  }
154
162
  // hover 退出事件
@@ -160,13 +168,13 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
160
168
  if (showTooltip || showAllTip) {
161
169
  $xeTable.handleTargetLeaveEvent(evnt);
162
170
  }
163
- $xeTable.dispatchEvent('cell-mouseleave', Object.assign({ cell: evnt.currentTarget }, params), evnt);
171
+ $xeTable.dispatchEvent('cell-mouseleave', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt);
164
172
  };
165
173
  }
166
174
  // 按下事件处理
167
175
  if (isRowDragCell || checkboxOpts.range || mouseConfig) {
168
176
  tdOns.mousedown = (evnt) => {
169
- $xeTable.triggerCellMousedownEvent(evnt, params);
177
+ $xeTable.triggerCellMousedownEvent(evnt, cellParams);
170
178
  };
171
179
  }
172
180
  // 拖拽列事件
@@ -175,11 +183,11 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
175
183
  }
176
184
  // 点击事件处理
177
185
  tdOns.click = (evnt) => {
178
- $xeTable.triggerCellClickEvent(evnt, params);
186
+ $xeTable.triggerCellClickEvent(evnt, cellParams);
179
187
  };
180
188
  // 双击事件处理
181
189
  tdOns.dblclick = (evnt) => {
182
- $xeTable.triggerCellDblclickEvent(evnt, params);
190
+ $xeTable.triggerCellDblclickEvent(evnt, cellParams);
183
191
  };
184
192
  // 合并行或列
185
193
  if (mergeList.length) {
@@ -190,29 +198,29 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
190
198
  return null;
191
199
  }
192
200
  if (rowspan > 1) {
193
- attrs.rowspan = rowspan;
201
+ tdAttrs.rowspan = rowspan;
194
202
  }
195
203
  if (colspan > 1) {
196
- attrs.colspan = colspan;
204
+ tdAttrs.colspan = colspan;
197
205
  }
198
206
  }
199
207
  }
200
208
  else if (spanMethod) {
201
209
  // 自定义合并行或列的方法
202
- const { rowspan = 1, colspan = 1 } = spanMethod(params) || {};
210
+ const { rowspan = 1, colspan = 1 } = spanMethod(cellParams) || {};
203
211
  if (!rowspan || !colspan) {
204
212
  return null;
205
213
  }
206
214
  if (rowspan > 1) {
207
- attrs.rowspan = rowspan;
215
+ tdAttrs.rowspan = rowspan;
208
216
  }
209
217
  if (colspan > 1) {
210
- attrs.colspan = colspan;
218
+ tdAttrs.colspan = colspan;
211
219
  }
212
220
  }
213
221
  // 如果被合并不可隐藏
214
222
  if (fixedHiddenColumn && mergeList) {
215
- if (attrs.colspan > 1 || attrs.rowspan > 1) {
223
+ if (tdAttrs.colspan > 1 || tdAttrs.rowspan > 1) {
216
224
  fixedHiddenColumn = false;
217
225
  }
218
226
  }
@@ -221,31 +229,27 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
221
229
  isDirty = $xeTable.isUpdateByRow(row, column.field);
222
230
  }
223
231
  const isVNAutoHeight = scrollYLoad && !hasEllipsis;
224
- let cellHeight = 0;
225
- const vnHeight = isCalcCellHeight ? rest.height : 0;
226
- if (hasEllipsis) {
227
- if (customRHeight) {
228
- cellHeight = customRHeight;
229
- }
230
- else if (!isAllOverflow) {
231
- cellHeight = vnHeight || defaultRowHeight || 18;
232
- }
232
+ const cellHeight = calcCellHeightFlag ? (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight) : defaultRowHeight;
233
+ const isLastColumn = $columnIndex === columns.length - 1;
234
+ const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
235
+ let isVNPreEmptyStatus = false;
236
+ if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
237
+ isVNPreEmptyStatus = true;
233
238
  }
234
- else {
235
- cellHeight = vnHeight || defaultRowHeight || 18;
239
+ else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
240
+ isVNPreEmptyStatus = true;
236
241
  }
237
242
  const tcStyle = {};
238
- if (cellHeight) {
239
- if (hasEllipsis) {
240
- tcStyle.maxHeight = `${cellHeight}px`;
241
- }
242
- else if (isVNAutoHeight) {
243
- tcStyle.height = `${cellHeight}px`;
244
- }
243
+ if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
244
+ tcStyle.height = `${cellHeight}px`;
245
+ }
246
+ else {
247
+ tcStyle.minHeight = `${cellHeight}px`;
245
248
  }
246
249
  const tdVNs = [];
247
- if (fixedHiddenColumn && (allColumnOverflow ? isAllOverflow : allColumnOverflow)) {
250
+ if (fixedHiddenColumn && isAllOverflow) {
248
251
  tdVNs.push(h('div', {
252
+ key: 'tc',
249
253
  class: ['vxe-cell', {
250
254
  'c--title': showTitle,
251
255
  'c--tooltip': showTooltip,
@@ -256,7 +260,8 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
256
260
  }
257
261
  else {
258
262
  // 渲染单元格
259
- tdVNs.push(...renderLine(h, _vm, params), h('div', {
263
+ tdVNs.push(...renderLine(h, _vm, cellParams, cellHeight), h('div', {
264
+ key: 'tc',
260
265
  class: ['vxe-cell', {
261
266
  'c--title': showTitle,
262
267
  'c--tooltip': showTooltip,
@@ -266,18 +271,23 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
266
271
  attrs: {
267
272
  title: showTitle ? $xeTable.getCellLabel(row, column) : null
268
273
  }
269
- }, isVNAutoHeight
270
- ? [
274
+ }, isVNPreEmptyStatus
275
+ ? []
276
+ : [
271
277
  h('div', {
272
- class: 'vxe-cell--auto-wrapper'
273
- }, column.renderCell(h, params))
274
- ]
275
- : column.renderCell(h, params)));
278
+ attrs: {
279
+ colid,
280
+ rowid
281
+ },
282
+ class: 'vxe-cell--wrapper'
283
+ }, column.renderCell(h, cellParams))
284
+ ]));
276
285
  if (showValidTip && errorValidItem) {
277
286
  const errRule = errorValidItem.rule;
278
287
  const validSlot = slots ? slots.valid : null;
279
- const validParams = Object.assign(Object.assign(Object.assign({}, params), errorValidItem), { rule: errorValidItem });
288
+ const validParams = Object.assign(Object.assign(Object.assign({}, cellParams), errorValidItem), { rule: errorValidItem });
280
289
  tdVNs.push(h('div', {
290
+ key: 'tcv',
281
291
  class: ['vxe-cell--valid-error-tip', getClass(validOpts.className, errorValidItem)],
282
292
  style: errRule && errRule.maxWidth
283
293
  ? {
@@ -299,38 +309,54 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
299
309
  ]));
300
310
  }
301
311
  }
312
+ let showAreaRowStatus = false;
302
313
  if (mouseConfig && mouseOpts.area && selectCellToRow) {
303
- if ((!$columnIndex && selectCellToRow === true) ||
314
+ if ((!_columnIndex && selectCellToRow === true) ||
304
315
  (selectCellToRow === column.field)) {
305
- tdVNs.push(h('div', {
306
- class: 'vxe-cell--area-status'
307
- }));
316
+ showAreaRowStatus = true;
308
317
  }
309
318
  }
310
- const isLastColumn = $columnIndex === columns.length - 1;
311
- const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
312
- let isVNPreEmptyStatus = false;
313
- if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
314
- isVNPreEmptyStatus = true;
319
+ if (!fixedHiddenColumn && showResizable && isAllColumnDrag) {
320
+ tdVNs.push(h('div', {
321
+ key: 'tcc',
322
+ class: ['vxe-cell--col-resizable', {
323
+ 'is--line': !border || border === 'none'
324
+ }],
325
+ on: {
326
+ mousedown: (evnt) => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
327
+ dblclick: (evnt) => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
328
+ }
329
+ }));
315
330
  }
316
- else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
317
- isVNPreEmptyStatus = true;
331
+ if ((rowResize || isAllRowDrag) && rowOpts.resizable) {
332
+ tdVNs.push(h('div', {
333
+ key: 'tcr',
334
+ class: 'vxe-cell--row-resizable',
335
+ on: {
336
+ mousedown: (evnt) => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
337
+ dblclick: (evnt) => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
338
+ }
339
+ }));
318
340
  }
319
341
  return h('td', {
320
342
  class: [
321
343
  'vxe-body--column',
322
- column.id,
344
+ colid,
345
+ cellVerticalAlign ? `col--vertical-${cellVerticalAlign}` : '',
346
+ cellAlign ? `col--${cellAlign}` : '',
347
+ type ? `col--${type}` : '',
323
348
  {
324
- [`col--${cellAlign}`]: cellAlign,
325
- [`col--vertical-${verticalAlign}`]: verticalAlign,
326
- [`col--${type}`]: type,
327
349
  'col--last': isLastColumn,
328
350
  'col--tree-node': treeNode,
329
351
  'col--edit': isEdit,
330
352
  'col--ellipsis': hasEllipsis,
353
+ 'col--cs-height': isCsHeight,
354
+ 'col--rs-height': isRsHeight,
355
+ 'col--to-row': showAreaRowStatus,
331
356
  'col--auto-height': isVNAutoHeight,
332
357
  'fixed--width': !isAutoCellWidth,
333
358
  'fixed--hidden': fixedHiddenColumn,
359
+ 'is--padding': isCellPadding,
334
360
  'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
335
361
  'is--drag-disabled': isDisabledDrag,
336
362
  'col--dirty': isDirty,
@@ -338,25 +364,23 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
338
364
  'col--valid-error': !!errorValidItem,
339
365
  'col--current': currentColumn === column
340
366
  },
341
- getClass(compCellClassName, params),
342
- getClass(className, params),
343
- getClass(allCellClassName, params)
367
+ getClass(compCellClassName, cellParams),
368
+ getClass(className, cellParams),
369
+ getClass(allCellClassName, cellParams)
344
370
  ],
345
371
  key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? column.id : $columnIndex,
346
- attrs,
347
- style: Object.assign({
348
- height: cellHeight ? `${cellHeight}px` : ''
349
- }, XEUtils.isFunction(compCellStyle) ? compCellStyle(params) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(params) : cellStyle),
372
+ attrs: tdAttrs,
373
+ style: Object.assign({}, XEUtils.isFunction(compCellStyle) ? compCellStyle(cellParams) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(cellParams) : cellStyle),
350
374
  on: tdOns
351
- }, isVNPreEmptyStatus || (isOptimizeMode && fixedHiddenColumn) ? [] : tdVNs);
375
+ }, isOptimizeMode && fixedHiddenColumn ? [] : tdVNs);
352
376
  }
353
377
  function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
354
378
  const $xeTable = _vm.$parent;
355
379
  const tableProps = $xeTable;
356
380
  const tableReactData = $xeTable;
357
381
  const tableInternalData = $xeTable;
358
- const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, showOverflow: allColumnOverflow, editConfig, treeConfig } = tableProps;
359
- const { hasFixedColumn, treeExpandedMaps, scrollXLoad, scrollYLoad, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove } = tableReactData;
382
+ const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps;
383
+ const { hasFixedColumn, treeExpandedMaps, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove } = tableReactData;
360
384
  const { fullAllDataRowIdData } = tableInternalData;
361
385
  const checkboxOpts = $xeTable.computeCheckboxOpts;
362
386
  const radioOpts = $xeTable.computeRadioOpts;
@@ -442,7 +466,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
442
466
  const tdVNs = tableColumn.map((column, $columnIndex) => {
443
467
  return renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
444
468
  });
445
- rows.push(columnOpts.drag && columnDragOpts.animation
469
+ rows.push(!isColLoading && (columnOpts.drag && columnDragOpts.animation)
446
470
  ? h('transition-group', {
447
471
  props: {
448
472
  tag: 'tr',
@@ -477,7 +501,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
477
501
  cellStyle.paddingLeft = `${(rowLevel * treeOpts.indent) + 30}px`;
478
502
  }
479
503
  const { showOverflow } = expandColumn;
480
- const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? allColumnOverflow : showOverflow;
504
+ const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? isAllOverflow : showOverflow;
481
505
  const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex };
482
506
  rows.push(h('tr', {
483
507
  class: ['vxe-body--expanded-row', {
@@ -568,8 +592,8 @@ export default {
568
592
  const tableInternalData = $xeTable;
569
593
  const { xID, $scopedSlots } = $xeTable;
570
594
  const { fixedColumn, fixedType, tableColumn } = props;
571
- const { showOverflow: allColumnOverflow, spanMethod, footerSpanMethod, mouseConfig } = tableProps;
572
- const { isGroup, tableData, scrollXLoad, scrollYLoad, isAllOverflow, isDragRowMove, expandColumn, dragRow, dragCol } = tableReactData;
595
+ const { spanMethod, footerSpanMethod, mouseConfig } = tableProps;
596
+ const { isGroup, tableData, isRowLoading, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, isDragRowMove, expandColumn, dragRow, dragCol } = tableReactData;
573
597
  const { visibleColumn, fullAllDataRowIdData, fullColumnIdData } = tableInternalData;
574
598
  const rowOpts = $xeTable.computeRowOpts;
575
599
  const emptyOpts = $xeTable.computeEmptyOpts;
@@ -581,7 +605,7 @@ export default {
581
605
  let renderColumnList = tableColumn;
582
606
  let isOptimizeMode = false;
583
607
  // 如果是使用优化模式
584
- if (scrollXLoad || scrollYLoad || (allColumnOverflow && isAllOverflow)) {
608
+ if (scrollXLoad || scrollYLoad || isAllOverflow) {
585
609
  if (expandColumn || spanMethod || footerSpanMethod) {
586
610
  // 如果不支持优化模式
587
611
  }
@@ -711,9 +735,9 @@ export default {
711
735
  });
712
736
  })),
713
737
  /**
714
- * 内容
715
- */
716
- rowOpts.drag && rowDragOpts.animation
738
+ * 内容
739
+ */
740
+ !(isRowLoading || isColLoading) && (rowOpts.drag && rowDragOpts.animation)
717
741
  ? h('transition-group', {
718
742
  ref: 'refBodyTBody',
719
743
  props: {
@@ -759,6 +783,9 @@ export default {
759
783
  }),
760
784
  h('span', {
761
785
  class: 'vxe-table--cell-active-area'
786
+ }),
787
+ h('span', {
788
+ class: 'vxe-table--cell-row-status-area'
762
789
  })
763
790
  ])
764
791
  : renderEmptyElement($xeTable),
@@ -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) {
@@ -192,18 +192,6 @@ function renderTitleContent(h, params, content) {
192
192
  }, getSlotVNs(content))
193
193
  ];
194
194
  }
195
- function formatFooterLabel(footerFormatter, params) {
196
- if (XEUtils.isFunction(footerFormatter)) {
197
- return `${footerFormatter(params)}`;
198
- }
199
- const isArr = XEUtils.isArray(footerFormatter);
200
- const gFormatOpts = isArr ? formats.get(footerFormatter[0]) : formats.get(footerFormatter);
201
- const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null;
202
- if (footerFormatMethod) {
203
- return `${isArr ? footerFormatMethod(params, ...footerFormatter.slice(1)) : footerFormatMethod(params)}`;
204
- }
205
- return '';
206
- }
207
195
  function getFooterContent(h, params) {
208
196
  const { $table, column, _columnIndex, row, items } = params;
209
197
  const { slots, editRender, cellRender, footerFormatter } = column;
@@ -211,40 +199,38 @@ function getFooterContent(h, params) {
211
199
  if (slots && slots.footer) {
212
200
  return $table.callSlot(slots.footer, params, h);
213
201
  }
202
+ let itemValue = '';
203
+ // 兼容老模式
204
+ if (XEUtils.isArray(items)) {
205
+ itemValue = items[_columnIndex];
206
+ }
207
+ else {
208
+ itemValue = XEUtils.get(row, column.field);
209
+ }
210
+ const footParams = Object.assign(params, {
211
+ itemValue
212
+ });
213
+ if (footerFormatter) {
214
+ if (XEUtils.isFunction(footerFormatter)) {
215
+ return `${footerFormatter(footParams)}`;
216
+ }
217
+ const isArr = XEUtils.isArray(footerFormatter);
218
+ const gFormatOpts = isArr ? formats.get(footerFormatter[0]) : formats.get(footerFormatter);
219
+ const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null;
220
+ if (footerFormatMethod) {
221
+ return `${isArr ? footerFormatMethod(footParams, ...footerFormatter.slice(1)) : footerFormatMethod(footParams)}`;
222
+ }
223
+ return '';
224
+ }
214
225
  if (renderOpts) {
215
226
  const compConf = renderer.get(renderOpts.name);
216
227
  const rtFooter = compConf ? (compConf.renderTableFooter || compConf.renderFooter) : null;
217
228
  if (rtFooter) {
218
- return getSlotVNs(rtFooter.call($table, h, renderOpts, params));
229
+ return getSlotVNs(rtFooter.call($table, h, renderOpts, footParams));
219
230
  }
220
231
  }
221
- let itemValue = '';
222
- // 兼容老模式
223
- if (XEUtils.isArray(items)) {
224
- itemValue = items[_columnIndex];
225
- return [
226
- footerFormatter
227
- ? formatFooterLabel(footerFormatter, {
228
- itemValue,
229
- column,
230
- row,
231
- items,
232
- _columnIndex
233
- })
234
- : formatText(itemValue, 1)
235
- ];
236
- }
237
- itemValue = XEUtils.get(row, column.field);
238
232
  return [
239
- footerFormatter
240
- ? formatFooterLabel(footerFormatter, {
241
- itemValue,
242
- column,
243
- row,
244
- items,
245
- _columnIndex
246
- })
247
- : formatText(itemValue, 1)
233
+ formatText(itemValue, 1)
248
234
  ];
249
235
  }
250
236
  function getDefaultCellLabel(params) {
@@ -386,11 +372,7 @@ export const Cell = {
386
372
  return Cell.renderTreeIcon(h, params, Cell.renderDefaultCell.call(this, h, params));
387
373
  },
388
374
  renderDefaultFooter(h, params) {
389
- return [
390
- h('span', {
391
- class: 'vxe-cell--item'
392
- }, getFooterContent(h, params))
393
- ];
375
+ return getFooterContent(h, params);
394
376
  },
395
377
  /**
396
378
  * 树节点
@@ -834,7 +816,7 @@ export const Cell = {
834
816
  renderSortIcon(h, params) {
835
817
  const { $table, column } = params;
836
818
  const sortOpts = $table.computeSortOpts;
837
- const { showIcon, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts;
819
+ const { showIcon, allowBtn, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts;
838
820
  if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
839
821
  return [
840
822
  h('span', {
@@ -847,12 +829,14 @@ export const Cell = {
847
829
  attrs: {
848
830
  title: getI18n('vxe.table.sortAsc')
849
831
  },
850
- on: {
851
- click(evnt) {
852
- evnt.stopPropagation();
853
- $table.triggerSortEvent(evnt, column, 'asc');
832
+ on: allowBtn
833
+ ? {
834
+ click(evnt) {
835
+ evnt.stopPropagation();
836
+ $table.triggerSortEvent(evnt, column, 'asc');
837
+ }
854
838
  }
855
- }
839
+ : undefined
856
840
  }),
857
841
  h('i', {
858
842
  class: ['vxe-sort--desc-btn', iconDesc || getIcon().TABLE_SORT_DESC, {
@@ -861,12 +845,14 @@ export const Cell = {
861
845
  attrs: {
862
846
  title: getI18n('vxe.table.sortDesc')
863
847
  },
864
- on: {
865
- click(evnt) {
866
- evnt.stopPropagation();
867
- $table.triggerSortEvent(evnt, column, 'desc');
848
+ on: allowBtn
849
+ ? {
850
+ click(evnt) {
851
+ evnt.stopPropagation();
852
+ $table.triggerSortEvent(evnt, column, 'desc');
853
+ }
868
854
  }
869
- }
855
+ : undefined
870
856
  })
871
857
  ])
872
858
  ];