vxe-table 3.19.3 → 3.19.5

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 (57) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/style.css +1 -1
  4. package/es/style.min.css +1 -1
  5. package/es/table/module/edit/mixin.js +13 -11
  6. package/es/table/src/body.js +30 -14
  7. package/es/table/src/methods.js +122 -4
  8. package/es/table/src/table.js +9 -5
  9. package/es/table/src/util.js +0 -61
  10. package/es/table/style.css +4 -3
  11. package/es/table/style.min.css +1 -1
  12. package/es/ui/index.js +3 -2
  13. package/es/ui/src/dom.js +17 -0
  14. package/es/ui/src/log.js +1 -1
  15. package/es/vxe-table/style.css +4 -3
  16. package/es/vxe-table/style.min.css +1 -1
  17. package/lib/index.css +1 -1
  18. package/lib/index.min.css +1 -1
  19. package/lib/index.umd.js +209 -116
  20. package/lib/index.umd.min.js +1 -1
  21. package/lib/style.css +1 -1
  22. package/lib/style.min.css +1 -1
  23. package/lib/table/module/edit/mixin.js +13 -11
  24. package/lib/table/module/edit/mixin.min.js +1 -1
  25. package/lib/table/src/body.js +28 -15
  26. package/lib/table/src/body.min.js +1 -1
  27. package/lib/table/src/methods.js +139 -3
  28. package/lib/table/src/methods.min.js +1 -1
  29. package/lib/table/src/table.js +8 -5
  30. package/lib/table/src/table.min.js +1 -1
  31. package/lib/table/src/util.js +0 -81
  32. package/lib/table/src/util.min.js +1 -1
  33. package/lib/table/style/style.css +4 -3
  34. package/lib/table/style/style.min.css +1 -1
  35. package/lib/ui/index.js +3 -2
  36. package/lib/ui/index.min.js +1 -1
  37. package/lib/ui/src/dom.js +18 -0
  38. package/lib/ui/src/dom.min.js +1 -1
  39. package/lib/ui/src/log.js +1 -1
  40. package/lib/ui/src/log.min.js +1 -1
  41. package/lib/vxe-table/style/style.css +4 -3
  42. package/lib/vxe-table/style/style.min.css +1 -1
  43. package/package.json +2 -2
  44. package/packages/table/module/edit/mixin.ts +13 -11
  45. package/packages/table/src/body.ts +29 -14
  46. package/packages/table/src/methods.ts +127 -4
  47. package/packages/table/src/table.ts +9 -5
  48. package/packages/table/src/util.ts +0 -66
  49. package/packages/ui/index.ts +2 -1
  50. package/packages/ui/src/dom.ts +18 -0
  51. package/styles/components/table.scss +34 -3
  52. /package/es/{iconfont.1761545705692.ttf → iconfont.1761784799557.ttf} +0 -0
  53. /package/es/{iconfont.1761545705692.woff → iconfont.1761784799557.woff} +0 -0
  54. /package/es/{iconfont.1761545705692.woff2 → iconfont.1761784799557.woff2} +0 -0
  55. /package/lib/{iconfont.1761545705692.ttf → iconfont.1761784799557.ttf} +0 -0
  56. /package/lib/{iconfont.1761545705692.woff → iconfont.1761784799557.woff} +0 -0
  57. /package/lib/{iconfont.1761545705692.woff2 → iconfont.1761784799557.woff2} +0 -0
@@ -70,17 +70,17 @@ function insertTreeRow ($xeTable: VxeTableConstructor & VxeTablePrivateMethods,
70
70
  const { item: parentRow } = matchObj
71
71
  const parentRest = fullAllDataRowIdData[getRowid($xeTable, parentRow)]
72
72
  const parentLevel = parentRest ? parentRest.level : 0
73
- let parentChilds = parentRow[childrenField]
74
- let mapChilds = parentRow[mapChildrenField]
75
- if (!XEUtils.isArray(parentChilds)) {
76
- parentChilds = parentRow[childrenField] = []
73
+ let pChilds = parentRow[childrenField]
74
+ let pMapChilds = parentRow[mapChildrenField]
75
+ if (!XEUtils.isArray(pChilds)) {
76
+ pChilds = parentRow[childrenField] = []
77
77
  }
78
- if (!XEUtils.isArray(mapChilds)) {
79
- mapChilds = parentRow[childrenField] = []
78
+ if (!XEUtils.isArray(pMapChilds)) {
79
+ pMapChilds = parentRow[mapChildrenField] = []
80
80
  }
81
- parentChilds[funcName](item)
82
- mapChilds[funcName](item)
83
- const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: parentChilds, parent: parentRow, level: parentLevel + 1, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
81
+ pChilds[funcName](item)
82
+ pMapChilds[funcName](item)
83
+ const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: pChilds, parent: parentRow, level: parentLevel + 1, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
84
84
  fullDataRowIdData[rowid] = rest
85
85
  fullAllDataRowIdData[rowid] = rest
86
86
  } else {
@@ -181,13 +181,15 @@ function handleInsertRowAt ($xeTable: VxeTableConstructor & VxeTablePrivateMetho
181
181
  treeRecords.forEach((row, i) => {
182
182
  if (parentRow) {
183
183
  if (row[parentField] !== parentRow[rowField]) {
184
- row[parentField] = parentRow[rowField]
185
184
  errLog('vxe.error.errProp', [`${parentField}=${row[parentField]}`, `${parentField}=${parentRow[rowField]}`])
185
+ row[parentField] = parentRow[rowField]
186
186
  }
187
187
  } else {
188
188
  if (row[parentField] !== null) {
189
+ if (!XEUtils.eqNull(row[parentField])) {
190
+ errLog('vxe.error.errProp', [`${parentField}=${row[parentField]}`, 'null'])
191
+ }
189
192
  row[parentField] = null
190
- errLog('vxe.error.errProp', [`${parentField}=${row[parentField]}`, 'null'])
191
193
  }
192
194
  }
193
195
  let targetIndex = matchMapObj.index + i
@@ -2,7 +2,7 @@ import { PropType, CreateElement } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
3
  import { VxeUI } from '../../ui'
4
4
  import { isEnableConf, getClass } from '../../ui/src/utils'
5
- import { getOffsetSize, calcTreeLine, getRowid, createHandleGetRowId, getCellRestHeight } from './util'
5
+ import { getRowid, createHandleGetRowId, getCellRestHeight } from './util'
6
6
  import { updateCellTitle } from '../../ui/src/dom'
7
7
  import { getSlotVNs } from '../../ui/src/vn'
8
8
 
@@ -28,22 +28,37 @@ function renderLine (h: CreateElement, $xeTable : VxeTableConstructor & VxeTable
28
28
  const tableInternalData = $xeTable as unknown as TableInternalData
29
29
 
30
30
  const { column } = params
31
- const { afterFullData } = tableInternalData
32
31
  const { treeConfig } = tableProps
32
+ const cellOpts = $xeTable.computeCellOpts
33
+ const rowOpts = $xeTable.computeRowOpts
34
+ const defaultRowHeight = $xeTable.computeDefaultRowHeight
33
35
  const treeOpts = $xeTable.computeTreeOpts
34
36
  const { slots, treeNode } = column
35
37
  const { fullAllDataRowIdData } = tableInternalData
36
- if (slots && (slots as any).line) {
37
- return $xeTable.callSlot((slots as any).line, params, h)
38
- }
39
- const rowRest = fullAllDataRowIdData[rowid]
40
- let rLevel = 0
41
- let prevRow = null
42
- if (rowRest) {
43
- rLevel = rowRest.level
44
- prevRow = rowRest.items[rowRest.treeIndex - 1]
45
- }
46
38
  if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
39
+ if (slots && (slots as any).line) {
40
+ return $xeTable.callSlot((slots as any).line, params, h)
41
+ }
42
+ const rowRest = fullAllDataRowIdData[rowid]
43
+ let rLevel = 0
44
+ let prevRow = null
45
+ let parentRow = null
46
+ let lineHeight = ''
47
+ if (rowRest) {
48
+ rLevel = rowRest.level
49
+ prevRow = rowRest.items[rowRest.treeIndex - 1]
50
+ parentRow = rowRest.parent
51
+ }
52
+ if (!rLevel && !treeOpts.showRootLine) {
53
+ return []
54
+ }
55
+ if (prevRow) {
56
+ const prevRowRest = fullAllDataRowIdData[getRowid($xeTable, prevRow)] || {}
57
+ lineHeight = `${prevRowRest.lineHeight || 0}px`
58
+ } else if (rLevel && parentRow) {
59
+ const parentRowRest = fullAllDataRowIdData[getRowid($xeTable, parentRow)] || {}
60
+ lineHeight = `calc(-1em + ${Math.floor(cellHeight / 2 + getCellRestHeight(parentRowRest, cellOpts, rowOpts, defaultRowHeight) / 2)}px)`
61
+ }
47
62
  return [
48
63
  h('div', {
49
64
  key: 'tl',
@@ -52,9 +67,9 @@ function renderLine (h: CreateElement, $xeTable : VxeTableConstructor & VxeTable
52
67
  h('div', {
53
68
  class: 'vxe-tree--line',
54
69
  style: {
55
- height: `${getRowid($xeTable, afterFullData[0]) === rowid ? 1 : calcTreeLine(params, prevRow)}px`,
70
+ height: lineHeight,
56
71
  bottom: `-${Math.floor(cellHeight / 2)}px`,
57
- left: `${(rLevel * treeOpts.indent) + (rLevel ? 2 - getOffsetSize($xeTable) : 0) + 16}px`
72
+ left: `calc(${(rLevel * treeOpts.indent)}px + 1em)`
58
73
  }
59
74
  })
60
75
  ])
@@ -1,5 +1,5 @@
1
1
  import XEUtils from 'xe-utils'
2
- import { getTpImg, isPx, isScale, hasClass, addClass, removeClass, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey } from '../../ui/src/dom'
2
+ import { getTpImg, isPx, isScale, hasClass, addClass, removeClass, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey, checkTargetElement } from '../../ui/src/dom'
3
3
  import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils'
4
4
  import { VxeUI } from '../../ui'
5
5
  import Cell from './cell'
@@ -2510,6 +2510,9 @@ function autoCellWidth ($xeTable: VxeTableConstructor & VxeTablePrivateMethods)
2510
2510
  updateHeight($xeTable)
2511
2511
  }
2512
2512
 
2513
+ /**
2514
+ * 计算自适应行高
2515
+ */
2513
2516
  const calcCellAutoHeight = (rowRest: VxeTableDefines.RowCacheItem, wrapperEl: HTMLDivElement) => {
2514
2517
  const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`)
2515
2518
  let colHeight = rowRest.height
@@ -2528,15 +2531,21 @@ const calcCellAutoHeight = (rowRest: VxeTableDefines.RowCacheItem, wrapperEl: HT
2528
2531
  return colHeight
2529
2532
  }
2530
2533
 
2534
+ /**
2535
+ * 自适应行高
2536
+ */
2531
2537
  const calcCellHeight = ($xeTable: VxeTableConstructor) => {
2538
+ const props = $xeTable
2532
2539
  const reactData = $xeTable as unknown as TableReactData
2533
2540
  const internalData = $xeTable as unknown as TableInternalData
2534
2541
 
2542
+ const { treeConfig } = props
2535
2543
  const { tableData, isAllOverflow, scrollYLoad, scrollXLoad } = reactData
2536
2544
  const { fullAllDataRowIdData } = internalData
2545
+ const treeOpts = $xeTable.computeTreeOpts
2537
2546
  const defaultRowHeight = $xeTable.computeDefaultRowHeight
2538
2547
  const el = $xeTable.$refs.refElem as HTMLDivElement
2539
- if (!isAllOverflow && (scrollYLoad || scrollXLoad) && el) {
2548
+ if (!isAllOverflow && (scrollYLoad || scrollXLoad || (treeConfig && treeOpts.showLine)) && el) {
2540
2549
  const { handleGetRowId } = createHandleGetRowId($xeTable)
2541
2550
  tableData.forEach(row => {
2542
2551
  const rowid = handleGetRowId(row)
@@ -3418,6 +3427,7 @@ function loadTableData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods,
3418
3427
  }
3419
3428
  reactData.isRowLoading = false
3420
3429
  handleRecalculateStyle($xeTable, false, false, false)
3430
+ updateTreeLineStyle($xeTable)
3421
3431
  // 如果是自动行高,特殊情况需调用 recalculate 手动刷新
3422
3432
  if (!props.showOverflow) {
3423
3433
  setTimeout(() => {
@@ -3431,6 +3441,7 @@ function loadTableData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods,
3431
3441
  .then(() => {
3432
3442
  handleRecalculateStyle($xeTable, false, true, true)
3433
3443
  updateRowOffsetTop($xeTable)
3444
+ updateTreeLineStyle($xeTable)
3434
3445
  resolve()
3435
3446
  })
3436
3447
  } else {
@@ -3439,6 +3450,7 @@ function loadTableData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods,
3439
3450
  .then(() => {
3440
3451
  handleRecalculateStyle($xeTable, false, true, true)
3441
3452
  updateRowOffsetTop($xeTable)
3453
+ updateTreeLineStyle($xeTable)
3442
3454
  resolve()
3443
3455
  })
3444
3456
  })
@@ -3946,6 +3958,9 @@ function updateHeight ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
3946
3958
  }
3947
3959
  }
3948
3960
 
3961
+ /**
3962
+ * 计算自适应列宽
3963
+ */
3949
3964
  function calcColumnAutoWidth ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, column: VxeTableDefines.ColumnInfo, wrapperEl: HTMLDivElement) {
3950
3965
  const columnOpts = $xeTable.computeColumnOpts
3951
3966
  const { autoOptions } = columnOpts
@@ -3975,6 +3990,9 @@ function calcColumnAutoWidth ($xeTable: VxeTableConstructor & VxeTablePrivateMet
3975
3990
  return colWidth + leftRightPadding
3976
3991
  }
3977
3992
 
3993
+ /**
3994
+ * 自适应列宽
3995
+ */
3978
3996
  function calcCellWidth ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
3979
3997
  const internalData = $xeTable as unknown as TableInternalData
3980
3998
 
@@ -4125,9 +4143,97 @@ function updateRowExpandStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMe
4125
4143
  /**
4126
4144
  * 更新树连接线样式
4127
4145
  */
4128
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
4129
4146
  function updateTreeLineStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
4130
- // 待优化
4147
+ const props = $xeTable
4148
+ const reactData = $xeTable as unknown as TableReactData
4149
+ const internalData = $xeTable as unknown as TableInternalData
4150
+
4151
+ const { treeConfig } = props
4152
+ if (!treeConfig) {
4153
+ return
4154
+ }
4155
+ const { tableData } = reactData
4156
+ const { fullAllDataRowIdData, treeExpandedMaps } = internalData
4157
+ const cellOpts = $xeTable.computeCellOpts
4158
+ const rowOpts = $xeTable.computeRowOpts
4159
+ const defaultRowHeight = $xeTable.computeDefaultRowHeight
4160
+ const treeOpts = $xeTable.computeTreeOpts
4161
+ const { transform, mapChildrenField } = treeOpts
4162
+ const childrenField = treeOpts.children || treeOpts.childrenField
4163
+ const { handleGetRowId } = createHandleGetRowId($xeTable)
4164
+ const expParentList: {
4165
+ row: any
4166
+ prevRow: any
4167
+ nextRow: any
4168
+ }[] = []
4169
+
4170
+ const handleNodeRow = (row: any, rIndex: number, rows: any[]) => {
4171
+ const rowid = handleGetRowId(row)
4172
+ const rowRest = fullAllDataRowIdData[rowid] || {}
4173
+ const childList: any[] = row[transform ? mapChildrenField : childrenField]
4174
+ const prevRow = rows[rIndex - 1] || null
4175
+ const nextRow = rows[rIndex + 1] || null
4176
+ if (childList && childList.length && treeExpandedMaps[rowid]) {
4177
+ expParentList.push({ row, prevRow, nextRow })
4178
+ childList.forEach((childRow, crIndex) => {
4179
+ const childRowid = handleGetRowId(childRow)
4180
+ if (treeExpandedMaps[childRowid]) {
4181
+ handleNodeRow(childRow, crIndex, childList)
4182
+ }
4183
+ })
4184
+ } else {
4185
+ if (nextRow) {
4186
+ const nextRowid = handleGetRowId(nextRow)
4187
+ const nextRowRest = fullAllDataRowIdData[nextRowid] || {}
4188
+ const currCellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight)
4189
+ const nextCellHeight = getCellRestHeight(nextRowRest, cellOpts, rowOpts, defaultRowHeight)
4190
+ rowRest.oHeight = currCellHeight
4191
+ rowRest.lineHeight = Math.floor(currCellHeight / 2 + nextCellHeight / 2)
4192
+ } else {
4193
+ rowRest.oHeight = 0
4194
+ rowRest.lineHeight = 0
4195
+ }
4196
+ }
4197
+ }
4198
+ tableData.forEach((row, rIndex) => {
4199
+ handleNodeRow(row, rIndex, tableData)
4200
+ })
4201
+
4202
+ XEUtils.lastArrayEach(expParentList, ({ row, nextRow }) => {
4203
+ const rowid = handleGetRowId(row)
4204
+ const childList: any[] = row[transform ? mapChildrenField : childrenField]
4205
+ const rowRest = fullAllDataRowIdData[rowid]
4206
+ if (rowRest) {
4207
+ const currCellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight)
4208
+ let countOffsetHeight = currCellHeight
4209
+ let countLineHeight = 0
4210
+ childList.forEach((childRow) => {
4211
+ const childRowid = handleGetRowId(childRow)
4212
+ const childRowRest = fullAllDataRowIdData[childRowid] || {}
4213
+ const childList: any[] = childRow[transform ? mapChildrenField : childrenField]
4214
+ if (treeExpandedMaps[childRowid] && childList && childList.length) {
4215
+ countOffsetHeight += (childRowRest.oHeight || 0)
4216
+ countLineHeight += (childRowRest.oHeight || 0)
4217
+ } else {
4218
+ const cellHeight = getCellRestHeight(childRowRest, cellOpts, rowOpts, defaultRowHeight)
4219
+ childRowRest.oHeight = cellHeight
4220
+ childRowRest.lineHeight = cellHeight
4221
+ countOffsetHeight += cellHeight
4222
+ countLineHeight += cellHeight
4223
+ }
4224
+ })
4225
+ if (nextRow) {
4226
+ const nextRowid = handleGetRowId(nextRow)
4227
+ const nextRowRest = fullAllDataRowIdData[nextRowid] || {}
4228
+ const currCellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight)
4229
+ const nextCellHeight = getCellRestHeight(nextRowRest, cellOpts, rowOpts, defaultRowHeight)
4230
+ countOffsetHeight += currCellHeight
4231
+ countLineHeight += Math.floor(currCellHeight / 2 + nextCellHeight / 2)
4232
+ }
4233
+ rowRest.lineHeight = countLineHeight
4234
+ rowRest.oHeight = countOffsetHeight
4235
+ }
4236
+ })
4131
4237
  }
4132
4238
 
4133
4239
  function handleRowExpandScroll ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
@@ -11180,6 +11286,7 @@ const Methods = {
11180
11286
  },
11181
11287
  triggerBodyWheelEvent (evnt: WheelEvent) {
11182
11288
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
11289
+ const $xeParentTable = $xeTable.$xeParentTable as VxeTableConstructor & VxeTablePrivateMethods
11183
11290
  const tableProps = $xeTable
11184
11291
  const reactData = $xeTable as unknown as TableReactData
11185
11292
  const internalData = $xeTable as unknown as TableInternalData
@@ -11246,6 +11353,22 @@ const Methods = {
11246
11353
  }
11247
11354
  }
11248
11355
 
11356
+ // 展开行处理,如果展开行嵌入表格中
11357
+ if ($xeParentTable) {
11358
+ if (isRollY) {
11359
+ if (checkTargetElement(evnt.target, [leftScrollElem, bodyScrollElem, rightScrollElem], evnt.currentTarget)) {
11360
+ evnt.stopPropagation()
11361
+ return
11362
+ }
11363
+ }
11364
+ if (isRollX) {
11365
+ if (checkTargetElement(evnt.target, [headerScrollElem, bodyScrollElem, footerScrollElem], evnt.currentTarget)) {
11366
+ evnt.stopPropagation()
11367
+ return
11368
+ }
11369
+ }
11370
+ }
11371
+
11249
11372
  if (!(leftFixedWidth || rightFixedWidth || expandColumn)) {
11250
11373
  return
11251
11374
  }
@@ -532,6 +532,10 @@ export default {
532
532
  $xeTabs: {
533
533
  default: null
534
534
  },
535
+ $xeParentTable: {
536
+ from: '$xeTable',
537
+ default: null
538
+ },
535
539
  $xeGrid: {
536
540
  default: null
537
541
  },
@@ -1490,7 +1494,7 @@ export default {
1490
1494
  const reactData = $xeTable as unknown as TableReactData
1491
1495
 
1492
1496
  const { initStatus } = this
1493
- if (value && value.length >= 50000) {
1497
+ if (value && value.length >= 20000) {
1494
1498
  warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)'])
1495
1499
  }
1496
1500
  this.loadTableData(value || [], true).then(() => {
@@ -1640,7 +1644,7 @@ export default {
1640
1644
 
1641
1645
  handleKeyField($xeTable)
1642
1646
 
1643
- const { data, exportConfig, importConfig, treeConfig, showOverflow, highlightCurrentRow, highlightCurrentColumn } = props
1647
+ const { data, exportConfig, importConfig, treeConfig, highlightCurrentRow, highlightCurrentColumn } = props
1644
1648
  const { scrollXStore, scrollYStore } = internalData
1645
1649
  const columnOpts = $xeTable.computeColumnOpts
1646
1650
  const editOpts = $xeTable.computeEditOpts
@@ -1675,9 +1679,9 @@ export default {
1675
1679
  if (props.editConfig && editOpts.showStatus && !props.keepSource) {
1676
1680
  warnLog('vxe.error.reqProp', ['keep-source'])
1677
1681
  }
1678
- if (treeConfig && (treeOpts.showLine || treeOpts.line) && !showOverflow) {
1679
- warnLog('vxe.error.reqProp', ['show-overflow'])
1680
- }
1682
+ // if (treeConfig && (treeOpts.showLine || treeOpts.line) && !showOverflow) {
1683
+ // warnLog('vxe.error.reqProp', ['show-overflow'])
1684
+ // }
1681
1685
  if (treeConfig && !treeOpts.transform && props.stripe) {
1682
1686
  warnLog('vxe.error.noTree', ['stripe'])
1683
1687
  }
@@ -549,72 +549,6 @@ export function getLastChildColumn (column: VxeTableDefines.ColumnInfo): VxeTabl
549
549
  return column
550
550
  }
551
551
 
552
- const lineOffsetSizes: Record<string, any> = {
553
- mini: 3,
554
- small: 2,
555
- medium: 1,
556
- large: 0
557
- }
558
-
559
- function countTreeExpandSize (prevRow: any, params: VxeTableDefines.CellRenderBodyParams) {
560
- let count = 1
561
- if (!prevRow) {
562
- return count
563
- }
564
- const { $table } = params
565
- const reactData = $table as unknown as TableReactData
566
- const { treeExpandedFlag } = reactData
567
- const internalData = $table as unknown as TableInternalData
568
- const { treeExpandedMaps } = internalData
569
- const treeOpts = $table.computeTreeOpts
570
- const { transform, mapChildrenField } = treeOpts
571
- const childrenField = treeOpts.children || treeOpts.childrenField
572
- const rowChildren = prevRow[transform ? mapChildrenField : childrenField]
573
- if (rowChildren && treeExpandedFlag && treeExpandedMaps[getRowid($table, prevRow)]) {
574
- for (let index = 0; index < rowChildren.length; index++) {
575
- count += countTreeExpandSize(rowChildren[index], params)
576
- }
577
- }
578
- return count
579
- }
580
-
581
- export function getOffsetSize ($xeTable: VxeTableConstructor) {
582
- const vSize = $xeTable.computeSize
583
- if (vSize) {
584
- return lineOffsetSizes[vSize] || 0
585
- }
586
- return 0
587
- }
588
-
589
- export function calcTreeLine (params: VxeTableDefines.CellRenderBodyParams, prevRow: any) {
590
- const { $table, row } = params
591
- const tableProps = $table
592
- const tableReactData = $table as unknown as TableReactData
593
- const tableInternalData = $table as unknown as TableInternalData
594
-
595
- const { showOverflow } = tableProps
596
- const { scrollYLoad } = tableReactData
597
- const { fullAllDataRowIdData } = tableInternalData
598
- const rowOpts = $table.computeRowOpts
599
- const cellOpts = $table.computeCellOpts
600
- const defaultRowHeight = $table.computeDefaultRowHeight
601
- const rowid = getRowid($table, row)
602
- const rowRest = fullAllDataRowIdData[rowid]
603
- const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight
604
- let expandSize = 1
605
- if (prevRow) {
606
- expandSize = countTreeExpandSize(prevRow, params)
607
- }
608
- let cellHeight = currCellHeight
609
- const vnHeight = rowRest.height
610
- if (scrollYLoad) {
611
- if (!showOverflow) {
612
- cellHeight = vnHeight || currCellHeight
613
- }
614
- }
615
- return cellHeight * expandSize - (prevRow ? 1 : (12 - getOffsetSize($table)))
616
- }
617
-
618
552
  export function getCellValue (row: any, column: any) {
619
553
  return XEUtils.get(row, column.field)
620
554
  }
@@ -179,7 +179,8 @@ VxeUI.setConfig({
179
179
  hasChildField: 'hasChild',
180
180
  mapChildrenField: '_X_ROW_CHILD',
181
181
  indent: 20,
182
- showIcon: true
182
+ showIcon: true,
183
+ showRootLine: true
183
184
  },
184
185
  expandConfig: {
185
186
  // trigger: 'default',
@@ -140,6 +140,24 @@ export function updateCellTitle (overflowElem: any, column: any) {
140
140
  }
141
141
  }
142
142
 
143
+ export function checkTargetElement (target: HTMLElement | EventTarget | null, exEls: (HTMLElement | null)[], endEl?: HTMLElement | EventTarget | null) {
144
+ let targetEl = target
145
+ if (!exEls || !exEls.length) {
146
+ return false
147
+ }
148
+ const [exEl1, exEl2, exEl3] = exEls
149
+ while (targetEl) {
150
+ if (exEl1 === targetEl || (exEl2 && targetEl === exEl2) || (exEl3 && targetEl === exEl3)) {
151
+ return true
152
+ }
153
+ if (endEl && targetEl === endEl) {
154
+ return false
155
+ }
156
+ targetEl = (targetEl as HTMLElement).parentElement
157
+ }
158
+ return false
159
+ }
160
+
143
161
  /**
144
162
  * 检查触发源是否属于目标节点
145
163
  */
@@ -2223,16 +2223,28 @@ $btnThemeList: (
2223
2223
  left: 50%;
2224
2224
  font-size: 12px;
2225
2225
  line-height: 1em;
2226
- transform: translate(-50%, -50%);
2226
+ transform: translate(-50%, -2px);
2227
2227
  text-align: left;
2228
2228
  z-index: 4;
2229
2229
  padding: 0 var(--vxe-ui-table-cell-padding-default);
2230
2230
  pointer-events: none;
2231
2231
  }
2232
2232
  .vxe-cell--valid-error-wrapper {
2233
+ position: relative;
2233
2234
  display: inline-block;
2234
2235
  border-radius: var(--vxe-ui-border-radius);
2235
2236
  pointer-events: auto;
2237
+ // &::before {
2238
+ // content: "";
2239
+ // position: absolute;
2240
+ // top: -0.75em;
2241
+ // left: 50%;
2242
+ // bottom: auto;
2243
+ // transform: translateX(-50%);
2244
+ // border-width: 0.5em;
2245
+ // border-style: solid;
2246
+ // border-color: transparent transparent var(--vxe-ui-table-validate-error-color) transparent;
2247
+ // }
2236
2248
  }
2237
2249
  .vxe-cell--valid-error-theme-beautify {
2238
2250
  padding: 0.2em 0.6em 0.25em 0.6em;
@@ -2267,12 +2279,26 @@ $btnThemeList: (
2267
2279
  &:last-child {
2268
2280
  .vxe-cell--valid-error-tip {
2269
2281
  bottom: calc(100%);
2270
- transform: translate(-50%, 50%);
2282
+ transform: translate(-50%, 0);
2283
+ // .vxe-cell--valid-error-wrapper {
2284
+ // &::before {
2285
+ // bottom: -0.75em;
2286
+ // top: auto;
2287
+ // border-color: var(--vxe-ui-table-validate-error-color) transparent transparent transparent;
2288
+ // }
2289
+ // }
2271
2290
  }
2272
2291
  &:first-child {
2273
2292
  .vxe-cell--valid-error-tip {
2274
2293
  bottom: auto;
2275
- transform: translate(-50%, -50%);
2294
+ transform: translate(-50%, -2px);
2295
+ // .vxe-cell--valid-error-wrapper {
2296
+ // &::before {
2297
+ // top: -0.75em;
2298
+ // bottom: auto;
2299
+ // border-color: transparent transparent var(--vxe-ui-table-validate-error-color) transparent;
2300
+ // }
2301
+ // }
2276
2302
  }
2277
2303
  }
2278
2304
  }
@@ -2308,6 +2334,11 @@ $btnThemeList: (
2308
2334
  background-color: #f56c6c;
2309
2335
  pointer-events: auto;
2310
2336
  }
2337
+ // .vxe-cell--valid-error-wrapper {
2338
+ // &::before {
2339
+ // display: none;
2340
+ // }
2341
+ // }
2311
2342
  }
2312
2343
  }
2313
2344
  }