vxe-table 3.12.10-beta.8 → 3.12.10

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 +135 -83
  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 +50 -9
  33. package/es/table/src/header.js +70 -168
  34. package/es/table/src/methods.js +985 -502
  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 +73 -57
  38. package/es/table/style.css +253 -189
  39. package/es/table/style.min.css +1 -1
  40. package/es/ui/index.js +26 -10
  41. package/es/ui/src/log.js +1 -1
  42. package/es/vxe-table/style.css +253 -189
  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 +1782 -1056
  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 +132 -79
  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 +46 -7
  114. package/lib/table/src/footer.min.js +1 -1
  115. package/lib/table/src/header.js +52 -175
  116. package/lib/table/src/header.min.js +1 -1
  117. package/lib/table/src/methods.js +1096 -560
  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 +87 -70
  124. package/lib/table/src/util.min.js +1 -1
  125. package/lib/table/style/style.css +253 -189
  126. package/lib/table/style/style.min.css +1 -1
  127. package/lib/ui/index.js +26 -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 +253 -189
  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 +148 -86
  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 +53 -10
  162. package/packages/table/src/header.ts +70 -169
  163. package/packages/table/src/methods.ts +1031 -515
  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 +82 -62
  167. package/packages/ui/index.ts +25 -9
  168. package/styles/components/table.scss +319 -271
  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.1736840896964.ttf → iconfont.1738985837413.ttf} +0 -0
  174. /package/es/{iconfont.1736840896964.woff → iconfont.1738985837413.woff} +0 -0
  175. /package/es/{iconfont.1736840896964.woff2 → iconfont.1738985837413.woff2} +0 -0
  176. /package/lib/{iconfont.1736840896964.ttf → iconfont.1738985837413.ttf} +0 -0
  177. /package/lib/{iconfont.1736840896964.woff → iconfont.1738985837413.woff} +0 -0
  178. /package/lib/{iconfont.1736840896964.woff2 → iconfont.1738985837413.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,29 @@ 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;
80
+ const currCellHeight = customCellHeight || defaultRowHeight;
76
81
  const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = rowDragOpts;
77
82
  const columnOpts = $xeTable.computeColumnOpts;
78
83
  const mouseOpts = $xeTable.computeMouseOpts;
79
84
  const areaOpts = $xeTable.computeAreaOpts;
80
85
  const { selectCellToRow } = areaOpts;
81
- const { type, cellRender, editRender, align, showOverflow, className, treeNode, slots } = column;
82
- const { verticalAlign } = cellOpts;
86
+ const { type, cellRender, editRender, align, showOverflow, className, treeNode, rowResize, padding, verticalAlign, slots } = column;
87
+ const { verticalAlign: allVerticalAlign } = cellOpts;
83
88
  const { actived } = editStore;
84
- const { height: customRHeight } = rowOpts;
89
+ const rowRest = fullAllDataRowIdData[rowid];
85
90
  const colid = column.id;
86
91
  const renderOpts = editRender || cellRender;
87
92
  const compConf = renderOpts ? renderer.get(renderOpts.name) : null;
@@ -91,21 +96,25 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
91
96
  const columnIndex = $xeTable.getColumnIndex(column);
92
97
  const _columnIndex = $xeTable.getVTColumnIndex(column);
93
98
  const isEdit = isEnableConf(editRender);
99
+ const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0;
94
100
  let fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX;
95
- const cellOverflow = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? allColumnOverflow : showOverflow;
101
+ const isCellPadding = XEUtils.eqNull(padding) ? (allPadding === null ? cellOpts.padding : allPadding) : padding;
102
+ const cellOverflow = XEUtils.eqNull(showOverflow) ? isAllOverflow : showOverflow;
96
103
  const showEllipsis = cellOverflow === 'ellipsis';
97
104
  const showTitle = cellOverflow === 'title';
98
105
  const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
99
- // 如果表格加上 showOverflow 则不再支持列单独设置
100
- const hasEllipsis = allColumnOverflow || showTitle || showTooltip || showEllipsis;
106
+ const hasEllipsis = isAllOverflow || showTitle || showTooltip || showEllipsis;
107
+ const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable));
108
+ const isCsHeight = !!customCellHeight;
109
+ const isRsHeight = resizeHeight > 0;
101
110
  let isDirty;
102
111
  const tdOns = {};
103
- const rest = fullAllDataRowIdData[rowid];
104
112
  const cellAlign = align || (compConf ? compConf.tableCellAlign : '') || allAlign;
113
+ const cellVerticalAlign = XEUtils.eqNull(verticalAlign) ? allVerticalAlign : verticalAlign;
105
114
  const errorValidItem = validErrorMaps[`${rowid}:${colid}`];
106
115
  const showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? (height || tableData.length > 1) : validOpts.message === 'inline');
107
- const attrs = { colid };
108
- const params = {
116
+ const tdAttrs = { colid };
117
+ const cellParams = {
109
118
  $table: $xeTable,
110
119
  $grid: $xeTable.xegrid,
111
120
  isEdit: false,
@@ -133,7 +142,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
133
142
  isRowDragCell = rowDragOpts.trigger === 'row' || (column.dragSort && rowDragOpts.trigger === 'cell');
134
143
  }
135
144
  if (isRowDragCell) {
136
- isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(params));
145
+ isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
137
146
  }
138
147
  // hover 进入事件
139
148
  if (showTitle || showTooltip || showAllTip || tooltipConfig) {
@@ -146,9 +155,9 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
146
155
  }
147
156
  else if (showTooltip || showAllTip) {
148
157
  // 如果配置了显示 tooltip
149
- $xeTable.triggerBodyTooltipEvent(evnt, params);
158
+ $xeTable.triggerBodyTooltipEvent(evnt, cellParams);
150
159
  }
151
- $xeTable.dispatchEvent('cell-mouseenter', Object.assign({ cell: evnt.currentTarget }, params), evnt);
160
+ $xeTable.dispatchEvent('cell-mouseenter', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt);
152
161
  };
153
162
  }
154
163
  // hover 退出事件
@@ -160,13 +169,13 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
160
169
  if (showTooltip || showAllTip) {
161
170
  $xeTable.handleTargetLeaveEvent(evnt);
162
171
  }
163
- $xeTable.dispatchEvent('cell-mouseleave', Object.assign({ cell: evnt.currentTarget }, params), evnt);
172
+ $xeTable.dispatchEvent('cell-mouseleave', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt);
164
173
  };
165
174
  }
166
175
  // 按下事件处理
167
176
  if (isRowDragCell || checkboxOpts.range || mouseConfig) {
168
177
  tdOns.mousedown = (evnt) => {
169
- $xeTable.triggerCellMousedownEvent(evnt, params);
178
+ $xeTable.triggerCellMousedownEvent(evnt, cellParams);
170
179
  };
171
180
  }
172
181
  // 拖拽列事件
@@ -175,11 +184,11 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
175
184
  }
176
185
  // 点击事件处理
177
186
  tdOns.click = (evnt) => {
178
- $xeTable.triggerCellClickEvent(evnt, params);
187
+ $xeTable.triggerCellClickEvent(evnt, cellParams);
179
188
  };
180
189
  // 双击事件处理
181
190
  tdOns.dblclick = (evnt) => {
182
- $xeTable.triggerCellDblclickEvent(evnt, params);
191
+ $xeTable.triggerCellDblclickEvent(evnt, cellParams);
183
192
  };
184
193
  // 合并行或列
185
194
  if (mergeList.length) {
@@ -190,29 +199,29 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
190
199
  return null;
191
200
  }
192
201
  if (rowspan > 1) {
193
- attrs.rowspan = rowspan;
202
+ tdAttrs.rowspan = rowspan;
194
203
  }
195
204
  if (colspan > 1) {
196
- attrs.colspan = colspan;
205
+ tdAttrs.colspan = colspan;
197
206
  }
198
207
  }
199
208
  }
200
209
  else if (spanMethod) {
201
210
  // 自定义合并行或列的方法
202
- const { rowspan = 1, colspan = 1 } = spanMethod(params) || {};
211
+ const { rowspan = 1, colspan = 1 } = spanMethod(cellParams) || {};
203
212
  if (!rowspan || !colspan) {
204
213
  return null;
205
214
  }
206
215
  if (rowspan > 1) {
207
- attrs.rowspan = rowspan;
216
+ tdAttrs.rowspan = rowspan;
208
217
  }
209
218
  if (colspan > 1) {
210
- attrs.colspan = colspan;
219
+ tdAttrs.colspan = colspan;
211
220
  }
212
221
  }
213
222
  // 如果被合并不可隐藏
214
223
  if (fixedHiddenColumn && mergeList) {
215
- if (attrs.colspan > 1 || attrs.rowspan > 1) {
224
+ if (tdAttrs.colspan > 1 || tdAttrs.rowspan > 1) {
216
225
  fixedHiddenColumn = false;
217
226
  }
218
227
  }
@@ -220,39 +229,77 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
220
229
  if (!fixedHiddenColumn && editConfig && (editRender || cellRender) && (editOpts.showStatus || editOpts.showUpdateStatus)) {
221
230
  isDirty = $xeTable.isUpdateByRow(row, column.field);
222
231
  }
232
+ const isVNAutoHeight = scrollYLoad && !hasEllipsis;
233
+ let cellHeight = currCellHeight;
234
+ const vnHeight = calcCellHeightFlag ? rowRest.height : 0;
235
+ if (resizeHeight) {
236
+ cellHeight = resizeHeight;
237
+ }
238
+ else {
239
+ if (scrollYLoad) {
240
+ if (!hasEllipsis) {
241
+ cellHeight = vnHeight || currCellHeight;
242
+ }
243
+ }
244
+ }
245
+ const isLastColumn = $columnIndex === columns.length - 1;
246
+ const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
247
+ let isVNPreEmptyStatus = false;
248
+ if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
249
+ isVNPreEmptyStatus = true;
250
+ }
251
+ else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
252
+ isVNPreEmptyStatus = true;
253
+ }
254
+ const tcStyle = {};
255
+ if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
256
+ tcStyle.height = `${cellHeight}px`;
257
+ }
258
+ else {
259
+ tcStyle.minHeight = `${cellHeight}px`;
260
+ }
223
261
  const tdVNs = [];
224
- if (fixedHiddenColumn && (allColumnOverflow ? isAllOverflow : allColumnOverflow)) {
262
+ if (fixedHiddenColumn && isAllOverflow) {
225
263
  tdVNs.push(h('div', {
264
+ key: 'tc',
226
265
  class: ['vxe-cell', {
227
266
  'c--title': showTitle,
228
267
  'c--tooltip': showTooltip,
229
268
  'c--ellipsis': showEllipsis
230
269
  }],
231
- style: {
232
- maxHeight: hasEllipsis && (customRHeight || defaultRowHeight) ? `${customRHeight || defaultRowHeight}px` : ''
233
- }
270
+ style: tcStyle
234
271
  }));
235
272
  }
236
273
  else {
237
274
  // 渲染单元格
238
- tdVNs.push(...renderLine(h, _vm, params), h('div', {
275
+ tdVNs.push(...renderLine(h, _vm, cellParams, cellHeight), h('div', {
276
+ key: 'tc',
239
277
  class: ['vxe-cell', {
240
278
  'c--title': showTitle,
241
279
  'c--tooltip': showTooltip,
242
280
  'c--ellipsis': showEllipsis
243
281
  }],
244
- style: {
245
- maxHeight: hasEllipsis && (customRHeight || defaultRowHeight) ? `${customRHeight || defaultRowHeight}px` : ''
246
- },
282
+ style: tcStyle,
247
283
  attrs: {
248
284
  title: showTitle ? $xeTable.getCellLabel(row, column) : null
249
285
  }
250
- }, column.renderCell(h, params)));
286
+ }, isVNPreEmptyStatus
287
+ ? []
288
+ : [
289
+ h('div', {
290
+ attrs: {
291
+ colid,
292
+ rowid
293
+ },
294
+ class: 'vxe-cell--wrapper'
295
+ }, column.renderCell(h, cellParams))
296
+ ]));
251
297
  if (showValidTip && errorValidItem) {
252
298
  const errRule = errorValidItem.rule;
253
299
  const validSlot = slots ? slots.valid : null;
254
- const validParams = Object.assign(Object.assign(Object.assign({}, params), errorValidItem), { rule: errorValidItem });
300
+ const validParams = Object.assign(Object.assign(Object.assign({}, cellParams), errorValidItem), { rule: errorValidItem });
255
301
  tdVNs.push(h('div', {
302
+ key: 'tcv',
256
303
  class: ['vxe-cell--valid-error-tip', getClass(validOpts.className, errorValidItem)],
257
304
  style: errRule && errRule.maxWidth
258
305
  ? {
@@ -274,50 +321,54 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
274
321
  ]));
275
322
  }
276
323
  }
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
- }
324
+ let showAreaRowStatus = false;
290
325
  if (mouseConfig && mouseOpts.area && selectCellToRow) {
291
- if ((!$columnIndex && selectCellToRow === true) ||
326
+ if ((!_columnIndex && selectCellToRow === true) ||
292
327
  (selectCellToRow === column.field)) {
293
- tdVNs.push(h('div', {
294
- class: 'vxe-cell--area-status'
295
- }));
328
+ showAreaRowStatus = true;
296
329
  }
297
330
  }
298
- const isLastColumn = $columnIndex === columns.length - 1;
299
- const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
300
- let isPreLoadStatus = false;
301
- if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex || _rowIndex > scrollYStore.visibleEndIndex)) {
302
- isPreLoadStatus = true;
331
+ if (!fixedHiddenColumn && showResizable && isAllColumnDrag) {
332
+ tdVNs.push(h('div', {
333
+ key: 'tcc',
334
+ class: ['vxe-cell--col-resizable', {
335
+ 'is--line': !border || border === 'none'
336
+ }],
337
+ on: {
338
+ mousedown: (evnt) => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
339
+ dblclick: (evnt) => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
340
+ }
341
+ }));
303
342
  }
304
- else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex || _columnIndex > scrollXStore.visibleEndIndex)) {
305
- isPreLoadStatus = true;
343
+ if ((rowResize || isAllRowDrag) && rowOpts.resizable) {
344
+ tdVNs.push(h('div', {
345
+ key: 'tcr',
346
+ class: 'vxe-cell--row-resizable',
347
+ on: {
348
+ mousedown: (evnt) => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
349
+ dblclick: (evnt) => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
350
+ }
351
+ }));
306
352
  }
307
353
  return h('td', {
308
354
  class: [
309
355
  'vxe-body--column',
310
- column.id,
356
+ colid,
357
+ cellVerticalAlign ? `col--vertical-${cellVerticalAlign}` : '',
358
+ cellAlign ? `col--${cellAlign}` : '',
359
+ type ? `col--${type}` : '',
311
360
  {
312
- [`col--${cellAlign}`]: cellAlign,
313
- [`col--vertical-${verticalAlign}`]: verticalAlign,
314
- [`col--${type}`]: type,
315
361
  'col--last': isLastColumn,
316
362
  'col--tree-node': treeNode,
317
363
  'col--edit': isEdit,
318
364
  'col--ellipsis': hasEllipsis,
365
+ 'col--cs-height': isCsHeight,
366
+ 'col--rs-height': isRsHeight,
367
+ 'col--to-row': showAreaRowStatus,
368
+ 'col--auto-height': isVNAutoHeight,
319
369
  'fixed--width': !isAutoCellWidth,
320
370
  'fixed--hidden': fixedHiddenColumn,
371
+ 'is--padding': isCellPadding,
321
372
  'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
322
373
  'is--drag-disabled': isDisabledDrag,
323
374
  'col--dirty': isDirty,
@@ -325,25 +376,23 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
325
376
  'col--valid-error': !!errorValidItem,
326
377
  'col--current': currentColumn === column
327
378
  },
328
- getClass(compCellClassName, params),
329
- getClass(className, params),
330
- getClass(allCellClassName, params)
379
+ getClass(compCellClassName, cellParams),
380
+ getClass(className, cellParams),
381
+ getClass(allCellClassName, cellParams)
331
382
  ],
332
383
  key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? column.id : $columnIndex,
333
- attrs,
334
- style: Object.assign({
335
- height: cellHeight
336
- }, XEUtils.isFunction(compCellStyle) ? compCellStyle(params) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(params) : cellStyle),
384
+ attrs: tdAttrs,
385
+ style: Object.assign({}, XEUtils.isFunction(compCellStyle) ? compCellStyle(cellParams) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(cellParams) : cellStyle),
337
386
  on: tdOns
338
- }, isPreLoadStatus || (isOptimizeMode && fixedHiddenColumn) ? [] : tdVNs);
387
+ }, isOptimizeMode && fixedHiddenColumn ? [] : tdVNs);
339
388
  }
340
389
  function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
341
390
  const $xeTable = _vm.$parent;
342
391
  const tableProps = $xeTable;
343
392
  const tableReactData = $xeTable;
344
393
  const tableInternalData = $xeTable;
345
- const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, showOverflow: allColumnOverflow, editConfig, treeConfig } = tableProps;
346
- const { hasFixedColumn, treeExpandedMaps, scrollXLoad, scrollYLoad, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove } = tableReactData;
394
+ const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps;
395
+ const { hasFixedColumn, treeExpandedMaps, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove } = tableReactData;
347
396
  const { fullAllDataRowIdData } = tableInternalData;
348
397
  const checkboxOpts = $xeTable.computeCheckboxOpts;
349
398
  const radioOpts = $xeTable.computeRadioOpts;
@@ -429,7 +478,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
429
478
  const tdVNs = tableColumn.map((column, $columnIndex) => {
430
479
  return renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
431
480
  });
432
- rows.push(columnOpts.drag && columnDragOpts.animation
481
+ rows.push(!isColLoading && (columnOpts.drag && columnDragOpts.animation)
433
482
  ? h('transition-group', {
434
483
  props: {
435
484
  tag: 'tr',
@@ -464,7 +513,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
464
513
  cellStyle.paddingLeft = `${(rowLevel * treeOpts.indent) + 30}px`;
465
514
  }
466
515
  const { showOverflow } = expandColumn;
467
- const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? allColumnOverflow : showOverflow;
516
+ const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? isAllOverflow : showOverflow;
468
517
  const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex };
469
518
  rows.push(h('tr', {
470
519
  class: ['vxe-body--expanded-row', {
@@ -555,8 +604,8 @@ export default {
555
604
  const tableInternalData = $xeTable;
556
605
  const { xID, $scopedSlots } = $xeTable;
557
606
  const { fixedColumn, fixedType, tableColumn } = props;
558
- const { showOverflow: allColumnOverflow, spanMethod, footerSpanMethod, mouseConfig } = tableProps;
559
- const { isGroup, tableData, scrollXLoad, scrollYLoad, isAllOverflow, isDragRowMove, expandColumn, dragRow, dragCol } = tableReactData;
607
+ const { spanMethod, footerSpanMethod, mouseConfig } = tableProps;
608
+ const { isGroup, tableData, isRowLoading, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, isDragRowMove, expandColumn, dragRow, dragCol } = tableReactData;
560
609
  const { visibleColumn, fullAllDataRowIdData, fullColumnIdData } = tableInternalData;
561
610
  const rowOpts = $xeTable.computeRowOpts;
562
611
  const emptyOpts = $xeTable.computeEmptyOpts;
@@ -568,7 +617,7 @@ export default {
568
617
  let renderColumnList = tableColumn;
569
618
  let isOptimizeMode = false;
570
619
  // 如果是使用优化模式
571
- if (scrollXLoad || scrollYLoad || (allColumnOverflow && isAllOverflow)) {
620
+ if (scrollXLoad || scrollYLoad || isAllOverflow) {
572
621
  if (expandColumn || spanMethod || footerSpanMethod) {
573
622
  // 如果不支持优化模式
574
623
  }
@@ -698,9 +747,9 @@ export default {
698
747
  });
699
748
  })),
700
749
  /**
701
- * 内容
702
- */
703
- rowOpts.drag && rowDragOpts.animation
750
+ * 内容
751
+ */
752
+ !(isRowLoading || isColLoading) && (rowOpts.drag && rowDragOpts.animation)
704
753
  ? h('transition-group', {
705
754
  ref: 'refBodyTBody',
706
755
  props: {
@@ -746,6 +795,9 @@ export default {
746
795
  }),
747
796
  h('span', {
748
797
  class: 'vxe-table--cell-active-area'
798
+ }),
799
+ h('span', {
800
+ class: 'vxe-table--cell-row-status-area'
749
801
  })
750
802
  ])
751
803
  : 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
  ];