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
@@ -6,7 +6,7 @@ import { getOffsetSize, calcTreeLine, mergeBodyMethod, getRowid } from './util'
6
6
  import { updateCellTitle } from '../../ui/src/dom'
7
7
  import { getSlotVNs } from '../../ui/src/vn'
8
8
 
9
- import type { VxeTableConstructor, VxeTableDefines, TableInternalData, VxeTablePrivateMethods, TableReactData, VxeColumnPropTypes, VxeComponentStyleType } from '../../../types'
9
+ import type { VxeTableConstructor, VxeTableDefines, TableInternalData, VxeTablePrivateMethods, TableReactData, VxeComponentStyleType } from '../../../types'
10
10
 
11
11
  const { getI18n, renderer, renderEmptyElement } = VxeUI
12
12
 
@@ -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
@@ -48,12 +48,14 @@ function renderLine (h: CreateElement, _vm: any, params: VxeTableDefines.CellRen
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
  })
@@ -71,7 +73,7 @@ function renderTdColumn (
71
73
  _vm: any,
72
74
  seq: number | string,
73
75
  rowid: string,
74
- fixedType: VxeColumnPropTypes.Fixed,
76
+ fixedType: 'left' | 'right' | '',
75
77
  isOptimizeMode: boolean,
76
78
  rowLevel: number,
77
79
  row: any,
@@ -89,26 +91,28 @@ 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, resizable: allResizable, border, height, 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
97
99
  const checkboxOpts = $xeTable.computeCheckboxOpts
98
100
  const editOpts = $xeTable.computeEditOpts
99
101
  const tooltipOpts = $xeTable.computeTooltipOpts
102
+ const { isAllColumnDrag, isAllRowDrag } = $xeTable.resizableOpts
100
103
  const rowOpts = $xeTable.computeRowOpts
101
104
  const rowDragOpts = $xeTable.computeRowDragOpts
102
105
  const defaultRowHeight = $xeTable.computeDefaultRowHeight
106
+ const customCellHeight = cellOpts.height || rowOpts.height
103
107
  const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = rowDragOpts
104
108
  const columnOpts = $xeTable.computeColumnOpts
105
109
  const mouseOpts = $xeTable.computeMouseOpts
106
110
  const areaOpts = $xeTable.computeAreaOpts
107
111
  const { selectCellToRow } = areaOpts
108
- const { type, cellRender, editRender, align, showOverflow, className, treeNode, slots } = column
109
- const { verticalAlign } = cellOpts
112
+ const { type, cellRender, editRender, align, showOverflow, className, treeNode, rowResize, padding, verticalAlign, slots } = column
113
+ const { verticalAlign: allVerticalAlign } = cellOpts
110
114
  const { actived } = editStore
111
- const { height: customRHeight } = rowOpts
115
+ const rowRest = fullAllDataRowIdData[rowid]
112
116
  const colid = column.id
113
117
  const renderOpts = editRender || cellRender
114
118
  const compConf = renderOpts ? renderer.get(renderOpts.name) : null
@@ -118,21 +122,27 @@ function renderTdColumn (
118
122
  const columnIndex = $xeTable.getColumnIndex(column)
119
123
  const _columnIndex = $xeTable.getVTColumnIndex(column)
120
124
  const isEdit = isEnableConf(editRender)
125
+ const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0
121
126
  let fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX
122
- const cellOverflow = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? allColumnOverflow : showOverflow
127
+ const isCellPadding = XEUtils.eqNull(padding) ? (allPadding === null ? cellOpts.padding : allPadding) : padding
128
+ const cellOverflow = XEUtils.eqNull(showOverflow) ? isAllOverflow : showOverflow
123
129
  const showEllipsis = cellOverflow === 'ellipsis'
124
130
  const showTitle = cellOverflow === 'title'
125
131
  const showTooltip = cellOverflow === true || cellOverflow === 'tooltip'
126
- // 如果表格加上 showOverflow 则不再支持列单独设置
127
- const hasEllipsis = allColumnOverflow || showTitle || showTooltip || showEllipsis
132
+ const hasEllipsis = isAllOverflow || showTitle || showTooltip || showEllipsis
133
+ const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable))
134
+ const isCsHeight = !!customCellHeight
135
+ const isRsHeight = resizeHeight > 0
128
136
  let isDirty
129
137
  const tdOns: any = {}
130
- const rest = fullAllDataRowIdData[rowid]
131
138
  const cellAlign = align || (compConf ? compConf.tableCellAlign : '') || allAlign
139
+ const cellVerticalAlign = XEUtils.eqNull(verticalAlign) ? allVerticalAlign : verticalAlign
132
140
  const errorValidItem = validErrorMaps[`${rowid}:${colid}`]
133
141
  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 = {
142
+ const tdAttrs: any = { colid }
143
+ const cellParams: VxeTableDefines.CellRenderBodyParams & {
144
+ $table: VxeTableConstructor<any> & VxeTablePrivateMethods
145
+ } = {
136
146
  $table: $xeTable,
137
147
  $grid: $xeTable.xegrid,
138
148
  isEdit: false,
@@ -160,7 +170,7 @@ function renderTdColumn (
160
170
  isRowDragCell = rowDragOpts.trigger === 'row' || (column.dragSort && rowDragOpts.trigger === 'cell')
161
171
  }
162
172
  if (isRowDragCell) {
163
- isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(params))
173
+ isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams))
164
174
  }
165
175
  // hover 进入事件
166
176
  if (showTitle || showTooltip || showAllTip || tooltipConfig) {
@@ -172,9 +182,9 @@ function renderTdColumn (
172
182
  updateCellTitle(evnt.currentTarget, column)
173
183
  } else if (showTooltip || showAllTip) {
174
184
  // 如果配置了显示 tooltip
175
- $xeTable.triggerBodyTooltipEvent(evnt, params)
185
+ $xeTable.triggerBodyTooltipEvent(evnt, cellParams)
176
186
  }
177
- $xeTable.dispatchEvent('cell-mouseenter', Object.assign({ cell: evnt.currentTarget }, params), evnt)
187
+ $xeTable.dispatchEvent('cell-mouseenter', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt)
178
188
  }
179
189
  }
180
190
  // hover 退出事件
@@ -186,13 +196,13 @@ function renderTdColumn (
186
196
  if (showTooltip || showAllTip) {
187
197
  $xeTable.handleTargetLeaveEvent(evnt)
188
198
  }
189
- $xeTable.dispatchEvent('cell-mouseleave', Object.assign({ cell: evnt.currentTarget }, params), evnt)
199
+ $xeTable.dispatchEvent('cell-mouseleave', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt)
190
200
  }
191
201
  }
192
202
  // 按下事件处理
193
203
  if (isRowDragCell || checkboxOpts.range || mouseConfig) {
194
204
  tdOns.mousedown = (evnt: MouseEvent) => {
195
- $xeTable.triggerCellMousedownEvent(evnt, params)
205
+ $xeTable.triggerCellMousedownEvent(evnt, cellParams)
196
206
  }
197
207
  }
198
208
  // 拖拽列事件
@@ -201,11 +211,11 @@ function renderTdColumn (
201
211
  }
202
212
  // 点击事件处理
203
213
  tdOns.click = (evnt: MouseEvent) => {
204
- $xeTable.triggerCellClickEvent(evnt, params)
214
+ $xeTable.triggerCellClickEvent(evnt, cellParams)
205
215
  }
206
216
  // 双击事件处理
207
217
  tdOns.dblclick = (evnt: MouseEvent) => {
208
- $xeTable.triggerCellDblclickEvent(evnt, params)
218
+ $xeTable.triggerCellDblclickEvent(evnt, cellParams)
209
219
  }
210
220
  // 合并行或列
211
221
  if (mergeList.length) {
@@ -216,28 +226,28 @@ function renderTdColumn (
216
226
  return null
217
227
  }
218
228
  if (rowspan > 1) {
219
- attrs.rowspan = rowspan
229
+ tdAttrs.rowspan = rowspan
220
230
  }
221
231
  if (colspan > 1) {
222
- attrs.colspan = colspan
232
+ tdAttrs.colspan = colspan
223
233
  }
224
234
  }
225
235
  } else if (spanMethod) {
226
236
  // 自定义合并行或列的方法
227
- const { rowspan = 1, colspan = 1 } = spanMethod(params) || {}
237
+ const { rowspan = 1, colspan = 1 } = spanMethod(cellParams) || {}
228
238
  if (!rowspan || !colspan) {
229
239
  return null
230
240
  }
231
241
  if (rowspan > 1) {
232
- attrs.rowspan = rowspan
242
+ tdAttrs.rowspan = rowspan
233
243
  }
234
244
  if (colspan > 1) {
235
- attrs.colspan = colspan
245
+ tdAttrs.colspan = colspan
236
246
  }
237
247
  }
238
248
  // 如果被合并不可隐藏
239
249
  if (fixedHiddenColumn && mergeList) {
240
- if (attrs.colspan > 1 || attrs.rowspan > 1) {
250
+ if (tdAttrs.colspan > 1 || tdAttrs.rowspan > 1) {
241
251
  fixedHiddenColumn = false
242
252
  }
243
253
  }
@@ -247,31 +257,30 @@ function renderTdColumn (
247
257
  }
248
258
 
249
259
  const isVNAutoHeight = scrollYLoad && !hasEllipsis
250
- let cellHeight = 0
251
- const vnHeight = isCalcCellHeight ? rest.height : 0
252
- if (hasEllipsis) {
253
- if (customRHeight) {
254
- cellHeight = customRHeight
255
- } else if (!isAllOverflow) {
256
- cellHeight = vnHeight || defaultRowHeight || 18
257
- }
258
- } else {
259
- cellHeight = vnHeight || defaultRowHeight || 18
260
+ const cellHeight = calcCellHeightFlag ? (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight) : defaultRowHeight
261
+
262
+ const isLastColumn = $columnIndex === columns.length - 1
263
+ const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')
264
+
265
+ let isVNPreEmptyStatus = false
266
+ if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
267
+ isVNPreEmptyStatus = true
268
+ } else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
269
+ isVNPreEmptyStatus = true
260
270
  }
261
271
 
262
272
  const tcStyle: Record<string, string> = {}
263
- if (cellHeight) {
264
- if (hasEllipsis) {
265
- tcStyle.maxHeight = `${cellHeight}px`
266
- } else if (isVNAutoHeight) {
267
- tcStyle.height = `${cellHeight}px`
268
- }
273
+ if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
274
+ tcStyle.height = `${cellHeight}px`
275
+ } else {
276
+ tcStyle.minHeight = `${cellHeight}px`
269
277
  }
270
278
 
271
279
  const tdVNs = []
272
- if (fixedHiddenColumn && (allColumnOverflow ? isAllOverflow : allColumnOverflow)) {
280
+ if (fixedHiddenColumn && isAllOverflow) {
273
281
  tdVNs.push(
274
282
  h('div', {
283
+ key: 'tc',
275
284
  class: ['vxe-cell', {
276
285
  'c--title': showTitle,
277
286
  'c--tooltip': showTooltip,
@@ -283,8 +292,9 @@ function renderTdColumn (
283
292
  } else {
284
293
  // 渲染单元格
285
294
  tdVNs.push(
286
- ...renderLine(h, _vm, params),
295
+ ...renderLine(h, _vm, cellParams, cellHeight),
287
296
  h('div', {
297
+ key: 'tc',
288
298
  class: ['vxe-cell', {
289
299
  'c--title': showTitle,
290
300
  'c--tooltip': showTooltip,
@@ -294,20 +304,25 @@ function renderTdColumn (
294
304
  attrs: {
295
305
  title: showTitle ? $xeTable.getCellLabel(row, column) : null
296
306
  }
297
- }, isVNAutoHeight
298
- ? [
307
+ }, isVNPreEmptyStatus
308
+ ? []
309
+ : [
299
310
  h('div', {
300
- class: 'vxe-cell--auto-wrapper'
301
- }, column.renderCell(h, params))
302
- ]
303
- : column.renderCell(h, params))
311
+ attrs: {
312
+ colid,
313
+ rowid
314
+ },
315
+ class: 'vxe-cell--wrapper'
316
+ }, column.renderCell(h, cellParams))
317
+ ])
304
318
  )
305
319
  if (showValidTip && errorValidItem) {
306
320
  const errRule = errorValidItem.rule
307
321
  const validSlot = slots ? slots.valid : null
308
- const validParams = { ...params, ...errorValidItem, rule: errorValidItem }
322
+ const validParams = { ...cellParams, ...errorValidItem, rule: errorValidItem }
309
323
  tdVNs.push(
310
324
  h('div', {
325
+ key: 'tcv',
311
326
  class: ['vxe-cell--valid-error-tip', getClass(validOpts.className, errorValidItem)],
312
327
  style: errRule && errRule.maxWidth
313
328
  ? {
@@ -331,43 +346,63 @@ function renderTdColumn (
331
346
  }
332
347
  }
333
348
 
349
+ let showAreaRowStatus = false
334
350
  if (mouseConfig && mouseOpts.area && selectCellToRow) {
335
351
  if (
336
- (!$columnIndex && selectCellToRow === true) ||
352
+ (!_columnIndex && selectCellToRow === true) ||
337
353
  (selectCellToRow === column.field)
338
354
  ) {
339
- tdVNs.push(
340
- h('div', {
341
- class: 'vxe-cell--area-status'
342
- })
343
- )
355
+ showAreaRowStatus = true
344
356
  }
345
357
  }
346
- const isLastColumn = $columnIndex === columns.length - 1
347
- const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')
348
358
 
349
- let isVNPreEmptyStatus = false
350
- if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
351
- isVNPreEmptyStatus = true
352
- } else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
353
- isVNPreEmptyStatus = true
359
+ if (!fixedHiddenColumn && showResizable && isAllColumnDrag) {
360
+ tdVNs.push(
361
+ h('div', {
362
+ key: 'tcc',
363
+ class: ['vxe-cell--col-resizable', {
364
+ 'is--line': !border || border === 'none'
365
+ }],
366
+ on: {
367
+ mousedown: (evnt: MouseEvent) => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
368
+ dblclick: (evnt: MouseEvent) => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
369
+ }
370
+ })
371
+ )
372
+ }
373
+
374
+ if ((rowResize || isAllRowDrag) && rowOpts.resizable) {
375
+ tdVNs.push(
376
+ h('div', {
377
+ key: 'tcr',
378
+ class: 'vxe-cell--row-resizable',
379
+ on: {
380
+ mousedown: (evnt: MouseEvent) => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
381
+ dblclick: (evnt: MouseEvent) => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
382
+ }
383
+ })
384
+ )
354
385
  }
355
386
 
356
387
  return h('td', {
357
388
  class: [
358
389
  'vxe-body--column',
359
- column.id,
390
+ colid,
391
+ cellVerticalAlign ? `col--vertical-${cellVerticalAlign}` : '',
392
+ cellAlign ? `col--${cellAlign}` : '',
393
+ type ? `col--${type}` : '',
360
394
  {
361
- [`col--${cellAlign}`]: cellAlign,
362
- [`col--vertical-${verticalAlign}`]: verticalAlign,
363
- [`col--${type}`]: type,
364
395
  'col--last': isLastColumn,
365
396
  'col--tree-node': treeNode,
366
397
  'col--edit': isEdit,
367
398
  'col--ellipsis': hasEllipsis,
399
+ 'col--cs-height': isCsHeight,
400
+ 'col--rs-height': isRsHeight,
401
+ 'col--to-row': showAreaRowStatus,
368
402
  'col--auto-height': isVNAutoHeight,
369
403
  'fixed--width': !isAutoCellWidth,
370
404
  'fixed--hidden': fixedHiddenColumn,
405
+ 'is--padding': isCellPadding,
371
406
  'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
372
407
  'is--drag-disabled': isDisabledDrag,
373
408
  'col--dirty': isDirty,
@@ -375,27 +410,25 @@ function renderTdColumn (
375
410
  'col--valid-error': !!errorValidItem,
376
411
  'col--current': currentColumn === column
377
412
  },
378
- getClass(compCellClassName, params),
379
- getClass(className, params),
380
- getClass(allCellClassName, params)
413
+ getClass(compCellClassName, cellParams),
414
+ getClass(className, cellParams),
415
+ getClass(allCellClassName, cellParams)
381
416
  ],
382
417
  key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? column.id : $columnIndex,
383
- attrs,
384
- style: Object.assign({
385
- height: cellHeight ? `${cellHeight}px` : ''
386
- }, XEUtils.isFunction(compCellStyle) ? compCellStyle(params) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(params) : cellStyle),
418
+ attrs: tdAttrs,
419
+ style: Object.assign({}, XEUtils.isFunction(compCellStyle) ? compCellStyle(cellParams) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(cellParams) : cellStyle),
387
420
  on: tdOns
388
- }, isVNPreEmptyStatus || (isOptimizeMode && fixedHiddenColumn) ? [] : tdVNs)
421
+ }, isOptimizeMode && fixedHiddenColumn ? [] : tdVNs)
389
422
  }
390
423
 
391
- function renderRows (h: CreateElement, _vm: any, fixedType: VxeColumnPropTypes.Fixed, isOptimizeMode: boolean, tableData: any[], tableColumn: VxeTableDefines.ColumnInfo[]) {
424
+ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '', isOptimizeMode: boolean, tableData: any[], tableColumn: VxeTableDefines.ColumnInfo[]) {
392
425
  const $xeTable = _vm.$parent as VxeTableConstructor & VxeTablePrivateMethods
393
426
  const tableProps = $xeTable
394
427
  const tableReactData = $xeTable as unknown as TableReactData
395
428
  const tableInternalData = $xeTable as unknown as TableInternalData
396
429
 
397
- const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, showOverflow: allColumnOverflow, editConfig, treeConfig } = tableProps
398
- const { hasFixedColumn, treeExpandedMaps, scrollXLoad, scrollYLoad, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove } = tableReactData
430
+ const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps
431
+ const { hasFixedColumn, treeExpandedMaps, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove } = tableReactData
399
432
  const { fullAllDataRowIdData } = tableInternalData
400
433
  const checkboxOpts = $xeTable.computeCheckboxOpts
401
434
  const radioOpts = $xeTable.computeRadioOpts
@@ -481,7 +514,7 @@ function renderRows (h: CreateElement, _vm: any, fixedType: VxeColumnPropTypes.F
481
514
  return renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData)
482
515
  })
483
516
  rows.push(
484
- columnOpts.drag && columnDragOpts.animation
517
+ !isColLoading && (columnOpts.drag && columnDragOpts.animation)
485
518
  ? h('transition-group', {
486
519
  props: {
487
520
  tag: 'tr',
@@ -517,7 +550,7 @@ function renderRows (h: CreateElement, _vm: any, fixedType: VxeColumnPropTypes.F
517
550
  cellStyle.paddingLeft = `${(rowLevel * treeOpts.indent) + 30}px`
518
551
  }
519
552
  const { showOverflow } = expandColumn
520
- const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? allColumnOverflow : showOverflow
553
+ const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? isAllOverflow : showOverflow
521
554
  const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex }
522
555
  rows.push(
523
556
  h('tr', {
@@ -615,8 +648,8 @@ export default {
615
648
  const { xID, $scopedSlots } = $xeTable
616
649
  const { fixedColumn, fixedType, tableColumn } = props
617
650
 
618
- const { showOverflow: allColumnOverflow, spanMethod, footerSpanMethod, mouseConfig } = tableProps
619
- const { isGroup, tableData, scrollXLoad, scrollYLoad, isAllOverflow, isDragRowMove, expandColumn, dragRow, dragCol } = tableReactData
651
+ const { spanMethod, footerSpanMethod, mouseConfig } = tableProps
652
+ const { isGroup, tableData, isRowLoading, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, isDragRowMove, expandColumn, dragRow, dragCol } = tableReactData
620
653
  const { visibleColumn, fullAllDataRowIdData, fullColumnIdData } = tableInternalData
621
654
  const rowOpts = $xeTable.computeRowOpts
622
655
  const emptyOpts = $xeTable.computeEmptyOpts
@@ -629,7 +662,7 @@ export default {
629
662
  let renderColumnList = tableColumn as VxeTableDefines.ColumnInfo[]
630
663
  let isOptimizeMode = false
631
664
  // 如果是使用优化模式
632
- if (scrollXLoad || scrollYLoad || (allColumnOverflow && isAllOverflow)) {
665
+ if (scrollXLoad || scrollYLoad || isAllOverflow) {
633
666
  if (expandColumn || spanMethod || footerSpanMethod) {
634
667
  // 如果不支持优化模式
635
668
  } else {
@@ -760,9 +793,9 @@ export default {
760
793
  })
761
794
  })),
762
795
  /**
763
- * 内容
764
- */
765
- rowOpts.drag && rowDragOpts.animation
796
+ * 内容
797
+ */
798
+ !(isRowLoading || isColLoading) && (rowOpts.drag && rowDragOpts.animation)
766
799
  ? h('transition-group', {
767
800
  ref: 'refBodyTBody',
768
801
  props: {
@@ -808,6 +841,9 @@ export default {
808
841
  }),
809
842
  h('span', {
810
843
  class: 'vxe-table--cell-active-area'
844
+ }),
845
+ h('span', {
846
+ class: 'vxe-table--cell-row-status-area'
811
847
  })
812
848
  ])
813
849
  : renderEmptyElement($xeTable),
@@ -6,7 +6,7 @@ import { updateCellTitle } from '../../ui/src/dom'
6
6
  import { createColumn, getRowid } from './util'
7
7
  import { getSlotVNs } from '../../ui/src/vn'
8
8
 
9
- import type { VxeTableDefines, VxeColumnPropTypes, VxeTableConstructor, VxeTablePrivateMethods, VxeComponentSlotType, TableReactData, TableInternalData } from '../../../types'
9
+ import type { VxeTableDefines, VxeTableConstructor, VxeTablePrivateMethods, VxeComponentSlotType, TableReactData, TableInternalData } from '../../../types'
10
10
 
11
11
  const { getI18n, getIcon, renderer, formats, renderEmptyElement } = VxeUI
12
12
 
@@ -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) {
@@ -206,25 +206,6 @@ function renderTitleContent (h: CreateElement, params: VxeTableDefines.CellRende
206
206
  ]
207
207
  }
208
208
 
209
- function formatFooterLabel (footerFormatter: VxeColumnPropTypes.FooterFormatter, params: {
210
- itemValue: any
211
- column: VxeTableDefines.ColumnInfo
212
- row: any
213
- items: any[]
214
- _columnIndex: number
215
- }) {
216
- if (XEUtils.isFunction(footerFormatter)) {
217
- return `${footerFormatter(params)}`
218
- }
219
- const isArr = XEUtils.isArray(footerFormatter)
220
- const gFormatOpts = isArr ? formats.get(footerFormatter[0]) : formats.get(footerFormatter)
221
- const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null
222
- if (footerFormatMethod) {
223
- return `${isArr ? footerFormatMethod(params, ...footerFormatter.slice(1)) : footerFormatMethod(params)}`
224
- }
225
- return ''
226
- }
227
-
228
209
  function getFooterContent (h: CreateElement, params: VxeTableDefines.CellRenderFooterParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
229
210
  const { $table, column, _columnIndex, row, items } = params
230
211
  const { slots, editRender, cellRender, footerFormatter } = column
@@ -232,40 +213,37 @@ function getFooterContent (h: CreateElement, params: VxeTableDefines.CellRenderF
232
213
  if (slots && slots.footer) {
233
214
  return $table.callSlot(slots.footer, params, h)
234
215
  }
216
+ let itemValue = ''
217
+ // 兼容老模式
218
+ if (XEUtils.isArray(items)) {
219
+ itemValue = items[_columnIndex]
220
+ } else {
221
+ itemValue = XEUtils.get(row, column.field)
222
+ }
223
+ const footParams = Object.assign(params, {
224
+ itemValue
225
+ })
226
+ if (footerFormatter) {
227
+ if (XEUtils.isFunction(footerFormatter)) {
228
+ return `${footerFormatter(footParams)}`
229
+ }
230
+ const isArr = XEUtils.isArray(footerFormatter)
231
+ const gFormatOpts = isArr ? formats.get(footerFormatter[0]) : formats.get(footerFormatter)
232
+ const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null
233
+ if (footerFormatMethod) {
234
+ return `${isArr ? footerFormatMethod(footParams, ...footerFormatter.slice(1)) : footerFormatMethod(footParams)}`
235
+ }
236
+ return ''
237
+ }
235
238
  if (renderOpts) {
236
239
  const compConf = renderer.get(renderOpts.name)
237
240
  const rtFooter = compConf ? (compConf.renderTableFooter || compConf.renderFooter) : null
238
241
  if (rtFooter) {
239
- return getSlotVNs(rtFooter.call($table, h, renderOpts, params))
242
+ return getSlotVNs(rtFooter.call($table, h, renderOpts, footParams))
240
243
  }
241
244
  }
242
- let itemValue = ''
243
- // 兼容老模式
244
- if (XEUtils.isArray(items)) {
245
- itemValue = items[_columnIndex]
246
- return [
247
- footerFormatter
248
- ? formatFooterLabel(footerFormatter, {
249
- itemValue,
250
- column,
251
- row,
252
- items,
253
- _columnIndex
254
- })
255
- : formatText(itemValue, 1)
256
- ]
257
- }
258
- itemValue = XEUtils.get(row, column.field)
259
245
  return [
260
- footerFormatter
261
- ? formatFooterLabel(footerFormatter, {
262
- itemValue,
263
- column,
264
- row,
265
- items,
266
- _columnIndex
267
- })
268
- : formatText(itemValue, 1)
246
+ formatText(itemValue, 1)
269
247
  ]
270
248
  }
271
249
 
@@ -413,11 +391,7 @@ export const Cell = {
413
391
  return Cell.renderTreeIcon(h, params, Cell.renderDefaultCell.call(this, h, params))
414
392
  },
415
393
  renderDefaultFooter (h: CreateElement, params: VxeTableDefines.CellRenderFooterParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
416
- return [
417
- h('span', {
418
- class: 'vxe-cell--item'
419
- }, getFooterContent(h, params))
420
- ]
394
+ return getFooterContent(h, params)
421
395
  },
422
396
 
423
397
  /**
@@ -893,7 +867,7 @@ export const Cell = {
893
867
  renderSortIcon (h: CreateElement, params: (VxeTableDefines.CellRenderHeaderParams | VxeTableDefines.CellRenderHeaderParams) & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
894
868
  const { $table, column } = params
895
869
  const sortOpts = $table.computeSortOpts
896
- const { showIcon, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts
870
+ const { showIcon, allowBtn, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts
897
871
  if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
898
872
  return [
899
873
  h('span', {
@@ -906,12 +880,14 @@ export const Cell = {
906
880
  attrs: {
907
881
  title: getI18n('vxe.table.sortAsc')
908
882
  },
909
- on: {
910
- click (evnt: any) {
911
- evnt.stopPropagation()
912
- $table.triggerSortEvent(evnt, column, 'asc')
913
- }
914
- }
883
+ on: allowBtn
884
+ ? {
885
+ click (evnt: any) {
886
+ evnt.stopPropagation()
887
+ $table.triggerSortEvent(evnt, column, 'asc')
888
+ }
889
+ }
890
+ : undefined
915
891
  }),
916
892
  h('i', {
917
893
  class: ['vxe-sort--desc-btn', iconDesc || getIcon().TABLE_SORT_DESC, {
@@ -920,12 +896,14 @@ export const Cell = {
920
896
  attrs: {
921
897
  title: getI18n('vxe.table.sortDesc')
922
898
  },
923
- on: {
924
- click (evnt: any) {
925
- evnt.stopPropagation()
926
- $table.triggerSortEvent(evnt, column, 'desc')
927
- }
928
- }
899
+ on: allowBtn
900
+ ? {
901
+ click (evnt: any) {
902
+ evnt.stopPropagation()
903
+ $table.triggerSortEvent(evnt, column, 'desc')
904
+ }
905
+ }
906
+ : undefined
929
907
  })
930
908
  ])
931
909
  ]