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
@@ -18,11 +18,11 @@ const isVMScrollProcess = ($xeTable: VxeTableConstructor & VxeTablePrivateMethod
18
18
  const tableReactData = $xeTable as unknown as TableReactData
19
19
 
20
20
  const { delayHover } = tableProps
21
- const { lastScrollTime, _isResize } = tableReactData
22
- return !!(_isResize || (lastScrollTime && Date.now() < lastScrollTime + (delayHover as number)))
21
+ const { lastScrollTime, isDragResize } = tableReactData
22
+ return !!(isDragResize || (lastScrollTime && Date.now() < lastScrollTime + (delayHover as number)))
23
23
  }
24
24
 
25
- function renderLine (h: CreateElement, _vm: any, params: VxeTableDefines.CellRenderBodyParams) {
25
+ function renderLine (h: CreateElement, _vm: any, params: VxeTableDefines.CellRenderBodyParams, cellHeight: number) {
26
26
  const $xeTable = _vm.$parent as VxeTableConstructor & VxeTablePrivateMethods
27
27
  const tableProps = $xeTable
28
28
  const tableInternalData = $xeTable as unknown as TableInternalData
@@ -42,18 +42,20 @@ function renderLine (h: CreateElement, _vm: any, params: VxeTableDefines.CellRen
42
42
  let prevRow = null
43
43
  if (rest) {
44
44
  rLevel = rest.level
45
- prevRow = rest.items[rest._index - 1]
45
+ prevRow = rest.items[rest.treeIndex - 1]
46
46
  }
47
47
  const isFirstRow = $xeTable.eqRow(afterFullData[0], row)
48
48
  if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
49
49
  return [
50
50
  h('div', {
51
+ key: 'tl',
51
52
  class: 'vxe-tree--line-wrapper'
52
53
  }, [
53
54
  h('div', {
54
55
  class: 'vxe-tree--line',
55
56
  style: {
56
57
  height: `${isFirstRow ? 1 : calcTreeLine(params, prevRow)}px`,
58
+ bottom: `-${Math.floor(cellHeight / 2)}px`,
57
59
  left: `${(rLevel * treeOpts.indent) + (rLevel ? 2 - getOffsetSize($xeTable) : 0) + 16}px`
58
60
  }
59
61
  })
@@ -89,8 +91,8 @@ function renderTdColumn (
89
91
  const tableInternalData = $xeTable as unknown as TableInternalData
90
92
 
91
93
  const { fullAllDataRowIdData } = tableInternalData
92
- const { columnKey, height, showOverflow: allColumnOverflow, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig } = tableProps
93
- const { tableData, overflowX, currentColumn, scrollXLoad, scrollYLoad, isCalcCellHeight, mergeList, editStore, isAllOverflow, validErrorMaps } = tableReactData
94
+ const { columnKey, height, showOverflow: allColumnOverflow, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps
95
+ const { tableData, overflowX, currentColumn, scrollXLoad, scrollYLoad, calcCellHeightFlag, resizeHeightFlag, mergeList, editStore, isAllOverflow, validErrorMaps } = tableReactData
94
96
  const { afterFullData, scrollXStore, scrollYStore } = tableInternalData
95
97
  const cellOpts = $xeTable.computeCellOpts
96
98
  const validOpts = $xeTable.computeValidOpts
@@ -100,15 +102,16 @@ function renderTdColumn (
100
102
  const rowOpts = $xeTable.computeRowOpts
101
103
  const rowDragOpts = $xeTable.computeRowDragOpts
102
104
  const defaultRowHeight = $xeTable.computeDefaultRowHeight
105
+ const currCellHeight = cellOpts.height || rowOpts.height || defaultRowHeight
103
106
  const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = rowDragOpts
104
107
  const columnOpts = $xeTable.computeColumnOpts
105
108
  const mouseOpts = $xeTable.computeMouseOpts
106
109
  const areaOpts = $xeTable.computeAreaOpts
107
110
  const { selectCellToRow } = areaOpts
108
- const { type, cellRender, editRender, align, showOverflow, className, treeNode, slots } = column
111
+ const { type, cellRender, editRender, align, showOverflow, className, treeNode, rowResize, slots } = column
109
112
  const { verticalAlign } = cellOpts
110
113
  const { actived } = editStore
111
- const { height: customRHeight } = rowOpts
114
+ const rowRest = fullAllDataRowIdData[rowid]
112
115
  const colid = column.id
113
116
  const renderOpts = editRender || cellRender
114
117
  const compConf = renderOpts ? renderer.get(renderOpts.name) : null
@@ -118,21 +121,24 @@ function renderTdColumn (
118
121
  const columnIndex = $xeTable.getColumnIndex(column)
119
122
  const _columnIndex = $xeTable.getVTColumnIndex(column)
120
123
  const isEdit = isEnableConf(editRender)
124
+ const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0
121
125
  let fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX
126
+ const isPadding = allPadding === null ? cellOpts.padding : allPadding
122
127
  const cellOverflow = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? allColumnOverflow : showOverflow
123
128
  const showEllipsis = cellOverflow === 'ellipsis'
124
129
  const showTitle = cellOverflow === 'title'
125
130
  const showTooltip = cellOverflow === true || cellOverflow === 'tooltip'
126
131
  // 如果表格加上 showOverflow 则不再支持列单独设置
127
- const hasEllipsis = allColumnOverflow || showTitle || showTooltip || showEllipsis
132
+ const hasEllipsis = allColumnOverflow || showTitle || showTooltip || showEllipsis || resizeHeight > 0
128
133
  let isDirty
129
134
  const tdOns: any = {}
130
- const rest = fullAllDataRowIdData[rowid]
131
135
  const cellAlign = align || (compConf ? compConf.tableCellAlign : '') || allAlign
132
136
  const errorValidItem = validErrorMaps[`${rowid}:${colid}`]
133
137
  const showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? (height || tableData.length > 1) : validOpts.message === 'inline')
134
- const attrs: any = { colid }
135
- const params: VxeTableDefines.CellRenderBodyParams = {
138
+ const tdAttrs: any = { colid }
139
+ const cellParams: VxeTableDefines.CellRenderBodyParams & {
140
+ $table: VxeTableConstructor<any> & VxeTablePrivateMethods
141
+ } = {
136
142
  $table: $xeTable,
137
143
  $grid: $xeTable.xegrid,
138
144
  isEdit: false,
@@ -160,7 +166,7 @@ function renderTdColumn (
160
166
  isRowDragCell = rowDragOpts.trigger === 'row' || (column.dragSort && rowDragOpts.trigger === 'cell')
161
167
  }
162
168
  if (isRowDragCell) {
163
- isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(params))
169
+ isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams))
164
170
  }
165
171
  // hover 进入事件
166
172
  if (showTitle || showTooltip || showAllTip || tooltipConfig) {
@@ -172,9 +178,9 @@ function renderTdColumn (
172
178
  updateCellTitle(evnt.currentTarget, column)
173
179
  } else if (showTooltip || showAllTip) {
174
180
  // 如果配置了显示 tooltip
175
- $xeTable.triggerBodyTooltipEvent(evnt, params)
181
+ $xeTable.triggerBodyTooltipEvent(evnt, cellParams)
176
182
  }
177
- $xeTable.dispatchEvent('cell-mouseenter', Object.assign({ cell: evnt.currentTarget }, params), evnt)
183
+ $xeTable.dispatchEvent('cell-mouseenter', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt)
178
184
  }
179
185
  }
180
186
  // hover 退出事件
@@ -186,13 +192,13 @@ function renderTdColumn (
186
192
  if (showTooltip || showAllTip) {
187
193
  $xeTable.handleTargetLeaveEvent(evnt)
188
194
  }
189
- $xeTable.dispatchEvent('cell-mouseleave', Object.assign({ cell: evnt.currentTarget }, params), evnt)
195
+ $xeTable.dispatchEvent('cell-mouseleave', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt)
190
196
  }
191
197
  }
192
198
  // 按下事件处理
193
199
  if (isRowDragCell || checkboxOpts.range || mouseConfig) {
194
200
  tdOns.mousedown = (evnt: MouseEvent) => {
195
- $xeTable.triggerCellMousedownEvent(evnt, params)
201
+ $xeTable.triggerCellMousedownEvent(evnt, cellParams)
196
202
  }
197
203
  }
198
204
  // 拖拽列事件
@@ -201,11 +207,11 @@ function renderTdColumn (
201
207
  }
202
208
  // 点击事件处理
203
209
  tdOns.click = (evnt: MouseEvent) => {
204
- $xeTable.triggerCellClickEvent(evnt, params)
210
+ $xeTable.triggerCellClickEvent(evnt, cellParams)
205
211
  }
206
212
  // 双击事件处理
207
213
  tdOns.dblclick = (evnt: MouseEvent) => {
208
- $xeTable.triggerCellDblclickEvent(evnt, params)
214
+ $xeTable.triggerCellDblclickEvent(evnt, cellParams)
209
215
  }
210
216
  // 合并行或列
211
217
  if (mergeList.length) {
@@ -216,28 +222,28 @@ function renderTdColumn (
216
222
  return null
217
223
  }
218
224
  if (rowspan > 1) {
219
- attrs.rowspan = rowspan
225
+ tdAttrs.rowspan = rowspan
220
226
  }
221
227
  if (colspan > 1) {
222
- attrs.colspan = colspan
228
+ tdAttrs.colspan = colspan
223
229
  }
224
230
  }
225
231
  } else if (spanMethod) {
226
232
  // 自定义合并行或列的方法
227
- const { rowspan = 1, colspan = 1 } = spanMethod(params) || {}
233
+ const { rowspan = 1, colspan = 1 } = spanMethod(cellParams) || {}
228
234
  if (!rowspan || !colspan) {
229
235
  return null
230
236
  }
231
237
  if (rowspan > 1) {
232
- attrs.rowspan = rowspan
238
+ tdAttrs.rowspan = rowspan
233
239
  }
234
240
  if (colspan > 1) {
235
- attrs.colspan = colspan
241
+ tdAttrs.colspan = colspan
236
242
  }
237
243
  }
238
244
  // 如果被合并不可隐藏
239
245
  if (fixedHiddenColumn && mergeList) {
240
- if (attrs.colspan > 1 || attrs.rowspan > 1) {
246
+ if (tdAttrs.colspan > 1 || tdAttrs.rowspan > 1) {
241
247
  fixedHiddenColumn = false
242
248
  }
243
249
  }
@@ -245,44 +251,84 @@ function renderTdColumn (
245
251
  if (!fixedHiddenColumn && editConfig && (editRender || cellRender) && (editOpts.showStatus || editOpts.showUpdateStatus)) {
246
252
  isDirty = $xeTable.isUpdateByRow(row, column.field)
247
253
  }
254
+
255
+ const isVNAutoHeight = scrollYLoad && !hasEllipsis
256
+ let cellHeight = currCellHeight
257
+ const vnHeight = calcCellHeightFlag ? rowRest.height : 0
258
+ if (resizeHeight) {
259
+ cellHeight = resizeHeight
260
+ } else {
261
+ if (scrollYLoad) {
262
+ if (!hasEllipsis) {
263
+ cellHeight = vnHeight || currCellHeight
264
+ }
265
+ }
266
+ }
267
+
268
+ const isLastColumn = $columnIndex === columns.length - 1
269
+ const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')
270
+
271
+ let isVNPreEmptyStatus = false
272
+ if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
273
+ isVNPreEmptyStatus = true
274
+ } else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
275
+ isVNPreEmptyStatus = true
276
+ }
277
+
278
+ const tcStyle: Record<string, string> = {}
279
+ if (hasEllipsis) {
280
+ tcStyle.height = `${cellHeight}px`
281
+ } else {
282
+ tcStyle.minHeight = `${cellHeight}px`
283
+ }
284
+
248
285
  const tdVNs = []
249
286
  if (fixedHiddenColumn && (allColumnOverflow ? isAllOverflow : allColumnOverflow)) {
250
287
  tdVNs.push(
251
288
  h('div', {
289
+ key: 'tc',
252
290
  class: ['vxe-cell', {
253
291
  'c--title': showTitle,
254
292
  'c--tooltip': showTooltip,
255
293
  'c--ellipsis': showEllipsis
256
294
  }],
257
- style: {
258
- maxHeight: hasEllipsis && (customRHeight || defaultRowHeight) ? `${customRHeight || defaultRowHeight}px` : ''
259
- }
295
+ style: tcStyle
260
296
  })
261
297
  )
262
298
  } else {
263
299
  // 渲染单元格
264
300
  tdVNs.push(
265
- ...renderLine(h, _vm, params),
301
+ ...renderLine(h, _vm, cellParams, cellHeight),
266
302
  h('div', {
303
+ key: 'tc',
267
304
  class: ['vxe-cell', {
268
305
  'c--title': showTitle,
269
306
  'c--tooltip': showTooltip,
270
307
  'c--ellipsis': showEllipsis
271
308
  }],
272
- style: {
273
- maxHeight: hasEllipsis && (customRHeight || defaultRowHeight) ? `${customRHeight || defaultRowHeight}px` : ''
274
- },
309
+ style: tcStyle,
275
310
  attrs: {
276
311
  title: showTitle ? $xeTable.getCellLabel(row, column) : null
277
312
  }
278
- }, column.renderCell(h, params))
313
+ }, isVNPreEmptyStatus
314
+ ? []
315
+ : [
316
+ h('div', {
317
+ attrs: {
318
+ colid,
319
+ rowid
320
+ },
321
+ class: 'vxe-cell--wrapper'
322
+ }, column.renderCell(h, cellParams))
323
+ ])
279
324
  )
280
325
  if (showValidTip && errorValidItem) {
281
326
  const errRule = errorValidItem.rule
282
327
  const validSlot = slots ? slots.valid : null
283
- const validParams = { ...params, ...errorValidItem, rule: errorValidItem }
328
+ const validParams = { ...cellParams, ...errorValidItem, rule: errorValidItem }
284
329
  tdVNs.push(
285
330
  h('div', {
331
+ key: 'tcv',
286
332
  class: ['vxe-cell--valid-error-tip', getClass(validOpts.className, errorValidItem)],
287
333
  style: errRule && errRule.maxWidth
288
334
  ? {
@@ -305,17 +351,6 @@ function renderTdColumn (
305
351
  )
306
352
  }
307
353
  }
308
- let cellHeight = ''
309
- const vnHeight = isCalcCellHeight ? rest.height : 0
310
- if (hasEllipsis) {
311
- if (customRHeight) {
312
- cellHeight = `${customRHeight}px`
313
- } else if (!isAllOverflow) {
314
- cellHeight = `${vnHeight || defaultRowHeight || 18}px`
315
- }
316
- } else {
317
- cellHeight = `${vnHeight || defaultRowHeight || 18}px`
318
- }
319
354
 
320
355
  if (mouseConfig && mouseOpts.area && selectCellToRow) {
321
356
  if (
@@ -324,18 +359,24 @@ function renderTdColumn (
324
359
  ) {
325
360
  tdVNs.push(
326
361
  h('div', {
362
+ key: 'tca',
327
363
  class: 'vxe-cell--area-status'
328
364
  })
329
365
  )
330
366
  }
331
367
  }
332
- const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')
333
368
 
334
- let isPreLoadStatus = false
335
- if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex || _rowIndex > scrollYStore.visibleEndIndex)) {
336
- isPreLoadStatus = true
337
- } else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex || _columnIndex > scrollXStore.visibleEndIndex)) {
338
- isPreLoadStatus = true
369
+ if (rowResize && rowOpts.resizable) {
370
+ tdVNs.push(
371
+ h('div', {
372
+ key: 'tcr',
373
+ class: 'vxe-cell--row-resizable',
374
+ on: {
375
+ mousedown: (evnt: MouseEvent) => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
376
+ dblclick: (evnt: MouseEvent) => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
377
+ }
378
+ })
379
+ )
339
380
  }
340
381
 
341
382
  return h('td', {
@@ -346,12 +387,14 @@ function renderTdColumn (
346
387
  [`col--${cellAlign}`]: cellAlign,
347
388
  [`col--vertical-${verticalAlign}`]: verticalAlign,
348
389
  [`col--${type}`]: type,
349
- 'col--last': $columnIndex === columns.length - 1,
390
+ 'col--last': isLastColumn,
350
391
  'col--tree-node': treeNode,
351
392
  'col--edit': isEdit,
352
393
  'col--ellipsis': hasEllipsis,
394
+ 'col--auto-height': isVNAutoHeight,
353
395
  'fixed--width': !isAutoCellWidth,
354
396
  'fixed--hidden': fixedHiddenColumn,
397
+ 'is--padding': isPadding,
355
398
  'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
356
399
  'is--drag-disabled': isDisabledDrag,
357
400
  'col--dirty': isDirty,
@@ -359,17 +402,15 @@ function renderTdColumn (
359
402
  'col--valid-error': !!errorValidItem,
360
403
  'col--current': currentColumn === column
361
404
  },
362
- getClass(compCellClassName, params),
363
- getClass(className, params),
364
- getClass(allCellClassName, params)
405
+ getClass(compCellClassName, cellParams),
406
+ getClass(className, cellParams),
407
+ getClass(allCellClassName, cellParams)
365
408
  ],
366
409
  key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? column.id : $columnIndex,
367
- attrs,
368
- style: Object.assign({
369
- height: cellHeight
370
- }, XEUtils.isFunction(compCellStyle) ? compCellStyle(params) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(params) : cellStyle),
410
+ attrs: tdAttrs,
411
+ style: Object.assign({}, XEUtils.isFunction(compCellStyle) ? compCellStyle(cellParams) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(cellParams) : cellStyle),
371
412
  on: tdOns
372
- }, isPreLoadStatus || (isOptimizeMode && fixedHiddenColumn) ? [] : tdVNs)
413
+ }, isOptimizeMode && fixedHiddenColumn ? [] : tdVNs)
373
414
  }
374
415
 
375
416
  function renderRows (h: CreateElement, _vm: any, fixedType: VxeColumnPropTypes.Fixed, isOptimizeMode: boolean, tableData: any[], tableColumn: VxeTableDefines.ColumnInfo[]) {
@@ -694,7 +735,7 @@ export default {
694
735
  $xeTable.triggerBodyScrollEvent(evnt, fixedType)
695
736
  }
696
737
  }
697
- if (scrollYLoad || leftFixedWidth || rightFixedWidth) {
738
+ if (leftFixedWidth || rightFixedWidth) {
698
739
  ons.wheel = $xeTable.triggerBodyWheelEvent
699
740
  }
700
741
 
@@ -170,7 +170,7 @@ function renderTitleContent (h: CreateElement, params: VxeTableDefines.CellRende
170
170
  const ons: Record<string, any> = {}
171
171
  if (showTitle || showTooltip || showAllTip) {
172
172
  ons.mouseenter = (evnt: MouseEvent) => {
173
- if (tableReactData._isResize) {
173
+ if (tableReactData.isDragResize) {
174
174
  return
175
175
  }
176
176
  if (showTitle) {
@@ -182,7 +182,7 @@ function renderTitleContent (h: CreateElement, params: VxeTableDefines.CellRende
182
182
  }
183
183
  if (showTooltip || showAllTip) {
184
184
  ons.mouseleave = (evnt: any) => {
185
- if (tableReactData._isResize) {
185
+ if (tableReactData.isDragResize) {
186
186
  return
187
187
  }
188
188
  if (showTooltip || showAllTip) {
@@ -413,11 +413,7 @@ export const Cell = {
413
413
  return Cell.renderTreeIcon(h, params, Cell.renderDefaultCell.call(this, h, params))
414
414
  },
415
415
  renderDefaultFooter (h: CreateElement, params: VxeTableDefines.CellRenderFooterParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
416
- return [
417
- h('span', {
418
- class: 'vxe-cell--item'
419
- }, getFooterContent(h, params))
420
- ]
416
+ return getFooterContent(h, params)
421
417
  },
422
418
 
423
419
  /**
@@ -1,7 +1,10 @@
1
+ import { PropType } from 'vue'
1
2
  import Cell from './cell'
2
3
  import { defineVxeComponent } from '../../ui/src/comp'
3
4
  import { assembleColumn, destroyColumn } from './util'
4
5
 
6
+ import type { VxeColumnPropTypes } from '../../../types'
7
+
5
8
  export const columnProps = {
6
9
  // 列唯一主键
7
10
  colId: [String, Number],
@@ -66,9 +69,11 @@ export const columnProps = {
66
69
  // 筛选模板配置项
67
70
  filterRender: Object,
68
71
  // 设置为树节点
69
- treeNode: Boolean,
72
+ treeNode: Boolean as PropType<VxeColumnPropTypes.TreeNode>,
70
73
  // 设置为拖拽排序
71
- dragSort: Boolean,
74
+ dragSort: Boolean as PropType<VxeColumnPropTypes.DragSort>,
75
+ // 设置为行高拖拽
76
+ rowResize: Boolean as PropType<VxeColumnPropTypes.RowResize>,
72
77
  // 是否可视
73
78
  visible: { type: Boolean, default: null },
74
79
  // 表头单元格数据导出方法
@@ -91,6 +91,7 @@ export class ColumnInfo {
91
91
  filterRender: _vm.filterRender,
92
92
  treeNode: _vm.treeNode,
93
93
  dragSort: _vm.dragSort,
94
+ rowResize: _vm.rowResize,
94
95
  cellType: _vm.cellType,
95
96
  cellRender: _vm.cellRender,
96
97
  editRender: _vm.editRender,
@@ -37,14 +37,20 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
37
37
  const { scrollXStore } = tableInternalData
38
38
  const tooltipOpts = $xeTable.computeTooltipOpts
39
39
  const columnOpts = $xeTable.computeColumnOpts
40
+ const defaultRowHeight = $xeTable.computeDefaultRowHeight
41
+ const cellOpts = $xeTable.computeCellOpts
42
+ const footerCellOpts = $xeTable.computeFooterCellOpts
43
+ const currCellHeight = footerCellOpts.height || cellOpts.height || defaultRowHeight
40
44
 
41
45
  return tableColumn.map((column: any, $columnIndex: any) => {
42
46
  const { type, showFooterOverflow, footerAlign, align, footerClassName, editRender, cellRender } = column
47
+ const colid = column.id
43
48
  const renderOpts = editRender || cellRender
44
49
  const compConf = renderOpts ? renderer.get(renderOpts.name) : null
45
50
  const showAllTip = tooltipOpts.showAll
46
51
  const isColGroup = column.children && column.children.length
47
52
  const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX
53
+ const isPadding = XEUtils.isBoolean(footerCellOpts.padding) ? footerCellOpts.padding : cellOpts.padding
48
54
  const footOverflow = XEUtils.eqNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow
49
55
  const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign
50
56
  let showEllipsis = footOverflow === 'ellipsis'
@@ -127,20 +133,29 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
127
133
  attrs.colspan = colspan
128
134
  }
129
135
  }
136
+ const isLastColumn = $columnIndex === tableColumn.length - 1
130
137
  const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')
131
138
 
132
- let isPreLoadStatus = false
133
- if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex || _columnIndex > scrollXStore.visibleEndIndex)) {
134
- isPreLoadStatus = true
139
+ let isVNPreEmptyStatus = false
140
+ if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
141
+ isVNPreEmptyStatus = true
142
+ }
143
+
144
+ const tcStyle: Record<string, string> = {}
145
+ if (hasEllipsis) {
146
+ tcStyle.height = `${currCellHeight}px`
147
+ } else {
148
+ tcStyle.minHeight = `${currCellHeight}px`
135
149
  }
136
150
 
137
151
  return h('td', {
138
152
  class: ['vxe-footer--column', column.id, {
139
153
  [`col--${footAlign}`]: footAlign,
140
154
  [`col--${type}`]: type,
141
- 'col--last': $columnIndex === tableColumn.length - 1,
155
+ 'col--last': isLastColumn,
142
156
  'fixed--width': !isAutoCellWidth,
143
157
  'fixed--hidden': fixedHiddenColumn,
158
+ 'is--padding': isPadding,
144
159
  'col--ellipsis': hasEllipsis,
145
160
  'col--current': currentColumn === column
146
161
  }, getClass(footerClassName, cellParams), getClass(footerCellClassName, cellParams)],
@@ -154,8 +169,18 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
154
169
  'c--title': showTitle,
155
170
  'c--tooltip': showTooltip,
156
171
  'c--ellipsis': showEllipsis
157
- }]
158
- }, isPreLoadStatus ? [] : column.renderFooter(h, cellParams))
172
+ }],
173
+ style: tcStyle
174
+ }, isVNPreEmptyStatus
175
+ ? []
176
+ : [
177
+ h('div', {
178
+ attrs: {
179
+ colid
180
+ },
181
+ class: 'vxe-cell--wrapper'
182
+ }, column.renderFooter(h, cellParams))
183
+ ])
159
184
  ])
160
185
  })
161
186
  }