vxe-table 4.17.3 → 4.17.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 (54) hide show
  1. package/README.md +1 -0
  2. package/es/index.css +1 -1
  3. package/es/index.min.css +1 -1
  4. package/es/style.css +1 -1
  5. package/es/style.min.css +1 -1
  6. package/es/table/module/edit/hook.js +13 -11
  7. package/es/table/src/body.js +30 -14
  8. package/es/table/src/table.js +123 -33
  9. package/es/table/src/util.js +0 -64
  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 +83 -154
  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/hook.js +13 -11
  24. package/lib/table/module/edit/hook.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/table.js +21 -35
  28. package/lib/table/src/table.min.js +1 -1
  29. package/lib/table/src/util.js +0 -92
  30. package/lib/table/src/util.min.js +1 -1
  31. package/lib/table/style/style.css +4 -3
  32. package/lib/table/style/style.min.css +1 -1
  33. package/lib/ui/index.js +3 -2
  34. package/lib/ui/index.min.js +1 -1
  35. package/lib/ui/src/dom.js +18 -0
  36. package/lib/ui/src/dom.min.js +1 -1
  37. package/lib/ui/src/log.js +1 -1
  38. package/lib/ui/src/log.min.js +1 -1
  39. package/lib/vxe-table/style/style.css +4 -3
  40. package/lib/vxe-table/style/style.min.css +1 -1
  41. package/package.json +2 -2
  42. package/packages/table/module/edit/hook.ts +13 -11
  43. package/packages/table/src/body.ts +29 -14
  44. package/packages/table/src/table.ts +127 -33
  45. package/packages/table/src/util.ts +0 -69
  46. package/packages/ui/index.ts +2 -1
  47. package/packages/ui/src/dom.ts +18 -0
  48. package/styles/components/table.scss +34 -3
  49. /package/es/{iconfont.1761545730136.ttf → iconfont.1761786608199.ttf} +0 -0
  50. /package/es/{iconfont.1761545730136.woff → iconfont.1761786608199.woff} +0 -0
  51. /package/es/{iconfont.1761545730136.woff2 → iconfont.1761786608199.woff2} +0 -0
  52. /package/lib/{iconfont.1761545730136.ttf → iconfont.1761786608199.ttf} +0 -0
  53. /package/lib/{iconfont.1761545730136.woff → iconfont.1761786608199.woff} +0 -0
  54. /package/lib/{iconfont.1761545730136.woff2 → iconfont.1761786608199.woff2} +0 -0
@@ -78,17 +78,17 @@ hooks.add('tableEditModule', {
78
78
  const { item: parentRow } = matchObj
79
79
  const parentRest = fullAllDataRowIdData[getRowid($xeTable, parentRow)]
80
80
  const parentLevel = parentRest ? parentRest.level : 0
81
- let parentChilds = parentRow[childrenField]
82
- let mapChilds = parentRow[mapChildrenField]
83
- if (!XEUtils.isArray(parentChilds)) {
84
- parentChilds = parentRow[childrenField] = []
81
+ let pChilds = parentRow[childrenField]
82
+ let pMapChilds = parentRow[mapChildrenField]
83
+ if (!XEUtils.isArray(pChilds)) {
84
+ pChilds = parentRow[childrenField] = []
85
85
  }
86
- if (!XEUtils.isArray(mapChilds)) {
87
- mapChilds = parentRow[childrenField] = []
86
+ if (!XEUtils.isArray(pMapChilds)) {
87
+ pMapChilds = parentRow[mapChildrenField] = []
88
88
  }
89
- parentChilds[funcName](item)
90
- mapChilds[funcName](item)
91
- 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 }
89
+ pChilds[funcName](item)
90
+ pMapChilds[funcName](item)
91
+ 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 }
92
92
  fullDataRowIdData[rowid] = rest
93
93
  fullAllDataRowIdData[rowid] = rest
94
94
  } else {
@@ -185,13 +185,15 @@ hooks.add('tableEditModule', {
185
185
  treeRecords.forEach((row, i) => {
186
186
  if (parentRow) {
187
187
  if (row[parentField] !== parentRow[rowField]) {
188
- row[parentField] = parentRow[rowField]
189
188
  errLog('vxe.error.errProp', [`${parentField}=${row[parentField]}`, `${parentField}=${parentRow[rowField]}`])
189
+ row[parentField] = parentRow[rowField]
190
190
  }
191
191
  } else {
192
192
  if (row[parentField] !== null) {
193
+ if (!XEUtils.eqNull(row[parentField])) {
194
+ errLog('vxe.error.errProp', [`${parentField}=${row[parentField]}`, 'null'])
195
+ }
193
196
  row[parentField] = null
194
- errLog('vxe.error.errProp', [`${parentField}=${row[parentField]}`, 'null'])
195
197
  }
196
198
  }
197
199
  let targetIndex = matchMapObj.index + i
@@ -2,7 +2,7 @@ import { h, ref, Ref, PropType, inject, nextTick, onMounted, onUnmounted } from
2
2
  import { defineVxeComponent } from '../../ui/src/comp'
3
3
  import XEUtils from 'xe-utils'
4
4
  import { VxeUI } from '../../ui'
5
- import { getOffsetSize, calcTreeLine, getRowid, createHandleGetRowId, getCellRestHeight } from './util'
5
+ import { getRowid, createHandleGetRowId, getCellRestHeight } from './util'
6
6
  import { updateCellTitle, getPropClass } from '../../ui/src/dom'
7
7
  import { isEnableConf } from '../../ui/src/utils'
8
8
  import { getSlotVNs } from '../../ui/src/vn'
@@ -49,22 +49,37 @@ export default defineVxeComponent({
49
49
 
50
50
  const renderLine = (rowid: string, params: VxeTableDefines.CellRenderBodyParams, cellHeight: number): VxeComponentSlotType[] => {
51
51
  const { column } = params
52
- const { afterFullData } = tableInternalData
53
52
  const { treeConfig } = tableProps
53
+ const cellOpts = computeCellOpts.value
54
+ const rowOpts = computeRowOpts.value
55
+ const defaultRowHeight = computeDefaultRowHeight.value
54
56
  const treeOpts = computeTreeOpts.value
55
57
  const { slots, treeNode } = column
56
58
  const { fullAllDataRowIdData } = tableInternalData
57
- if (slots && (slots as any).line) {
58
- return $xeTable.callSlot((slots as any).line, params)
59
- }
60
- const rowRest = fullAllDataRowIdData[rowid]
61
- let rLevel = 0
62
- let prevRow = null
63
- if (rowRest) {
64
- rLevel = rowRest.level
65
- prevRow = rowRest.items[rowRest.treeIndex - 1]
66
- }
67
59
  if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
60
+ if (slots && (slots as any).line) {
61
+ return $xeTable.callSlot((slots as any).line, params)
62
+ }
63
+ const rowRest = fullAllDataRowIdData[rowid]
64
+ let rLevel = 0
65
+ let prevRow = null
66
+ let parentRow = null
67
+ let lineHeight = ''
68
+ if (rowRest) {
69
+ rLevel = rowRest.level
70
+ prevRow = rowRest.items[rowRest.treeIndex - 1]
71
+ parentRow = rowRest.parent
72
+ }
73
+ if (!rLevel && !treeOpts.showRootLine) {
74
+ return []
75
+ }
76
+ if (prevRow) {
77
+ const prevRowRest = fullAllDataRowIdData[getRowid($xeTable, prevRow)] || {}
78
+ lineHeight = `${prevRowRest.lineHeight || 0}px`
79
+ } else if (rLevel && parentRow) {
80
+ const parentRowRest = fullAllDataRowIdData[getRowid($xeTable, parentRow)] || {}
81
+ lineHeight = `calc(-1em + ${Math.floor(cellHeight / 2 + getCellRestHeight(parentRowRest, cellOpts, rowOpts, defaultRowHeight) / 2)}px)`
82
+ }
68
83
  return [
69
84
  h('div', {
70
85
  key: 'tl',
@@ -73,9 +88,9 @@ export default defineVxeComponent({
73
88
  h('div', {
74
89
  class: 'vxe-tree--line',
75
90
  style: {
76
- height: `${getRowid($xeTable, afterFullData[0]) === rowid ? 1 : calcTreeLine(params, prevRow)}px`,
91
+ height: lineHeight,
77
92
  bottom: `-${Math.floor(cellHeight / 2)}px`,
78
- left: `${(rLevel * treeOpts.indent) + (rLevel ? 2 - getOffsetSize($xeTable) : 0) + 16}px`
93
+ left: `calc(${(rLevel * treeOpts.indent)}px + 1em)`
79
94
  }
80
95
  })
81
96
  ])
@@ -1,7 +1,7 @@
1
1
  import { h, ComponentPublicInstance, reactive, ref, Ref, provide, inject, nextTick, Teleport, onActivated, onDeactivated, onBeforeUnmount, onUnmounted, watch, computed, onMounted } from 'vue'
2
2
  import { defineVxeComponent } from '../../ui/src/comp'
3
3
  import XEUtils from 'xe-utils'
4
- import { initTpImg, getTpImg, isPx, isScale, hasClass, addClass, removeClass, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey } from '../../ui/src/dom'
4
+ import { initTpImg, getTpImg, isPx, isScale, hasClass, addClass, removeClass, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey, checkTargetElement } from '../../ui/src/dom'
5
5
  import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils'
6
6
  import { VxeUI } from '../../ui'
7
7
  import { createInternalData, getRowUniqueId, clearTableAllStatus, getColumnList, toFilters, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, createHandleUpdateRowId, createHandleGetRowId, getCalcHeight, getCellRestHeight, getLastChildColumn } from './util'
@@ -62,6 +62,7 @@ export default defineVxeComponent({
62
62
  const VxeUITooltipComponent = VxeUI.getComponent('VxeTooltip')
63
63
 
64
64
  const $xeTabs = inject<(VxeTabsConstructor & VxeTabsPrivateMethods) | null>('$xeTabs', null)
65
+ const $xeParentTable = inject<(VxeTableConstructor & VxeTablePrivateMethods) | null>('$xeTable', null)
65
66
  const $xeGrid = inject<(VxeGridConstructor & VxeGridPrivateMethods) | null>('$xeGrid', null)
66
67
  const $xeGantt = inject<(VxeGanttConstructor & VxeGanttPrivateMethods) | null>('$xeGantt', null)
67
68
  const $xeGGWrapper = $xeGrid || $xeGantt
@@ -1907,6 +1908,9 @@ export default defineVxeComponent({
1907
1908
  }
1908
1909
  }
1909
1910
 
1911
+ /**
1912
+ * 计算自适应列宽
1913
+ */
1910
1914
  const calcColumnAutoWidth = (column: VxeTableDefines.ColumnInfo, wrapperEl: HTMLDivElement) => {
1911
1915
  const columnOpts = computeColumnOpts.value
1912
1916
  const { autoOptions } = columnOpts
@@ -1936,6 +1940,9 @@ export default defineVxeComponent({
1936
1940
  return colWidth + leftRightPadding
1937
1941
  }
1938
1942
 
1943
+ /**
1944
+ * 自适应列宽
1945
+ */
1939
1946
  const calcCellWidth = () => {
1940
1947
  const autoWidthColumnList = computeAutoWidthColumnList.value
1941
1948
  const { fullColumnIdData } = internalData
@@ -2069,6 +2076,9 @@ export default defineVxeComponent({
2069
2076
  updateHeight()
2070
2077
  }
2071
2078
 
2079
+ /**
2080
+ * 计算自适应行高
2081
+ */
2072
2082
  const calcCellAutoHeight = (rowRest: VxeTableDefines.RowCacheItem, wrapperEl: HTMLDivElement) => {
2073
2083
  const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`)
2074
2084
  let colHeight = rowRest.height
@@ -2087,12 +2097,17 @@ export default defineVxeComponent({
2087
2097
  return colHeight
2088
2098
  }
2089
2099
 
2100
+ /**
2101
+ * 自适应行高
2102
+ */
2090
2103
  const calcCellHeight = () => {
2104
+ const { treeConfig } = props
2091
2105
  const { tableData, isAllOverflow, scrollYLoad, scrollXLoad } = reactData
2092
2106
  const { fullAllDataRowIdData } = internalData
2107
+ const treeOpts = computeTreeOpts.value
2093
2108
  const defaultRowHeight = computeDefaultRowHeight.value
2094
2109
  const el = refElem.value
2095
- if (!isAllOverflow && (scrollYLoad || scrollXLoad) && el) {
2110
+ if (!isAllOverflow && (scrollYLoad || scrollXLoad || (treeConfig && treeOpts.showLine)) && el) {
2096
2111
  const { handleGetRowId } = createHandleGetRowId($xeTable)
2097
2112
  el.setAttribute('data-calc-row', 'Y')
2098
2113
  tableData.forEach(row => {
@@ -3779,6 +3794,7 @@ export default defineVxeComponent({
3779
3794
  }
3780
3795
  reactData.isRowLoading = false
3781
3796
  handleRecalculateStyle(false, false, false)
3797
+ updateTreeLineStyle()
3782
3798
  // 如果是自动行高,特殊情况需调用 recalculate 手动刷新
3783
3799
  if (!props.showOverflow) {
3784
3800
  setTimeout(() => {
@@ -3792,6 +3808,7 @@ export default defineVxeComponent({
3792
3808
  .then(() => {
3793
3809
  handleRecalculateStyle(false, true, true)
3794
3810
  updateRowOffsetTop()
3811
+ updateTreeLineStyle()
3795
3812
  resolve()
3796
3813
  })
3797
3814
  } else {
@@ -3800,6 +3817,7 @@ export default defineVxeComponent({
3800
3817
  .then(() => {
3801
3818
  handleRecalculateStyle(false, true, true)
3802
3819
  updateRowOffsetTop()
3820
+ updateTreeLineStyle()
3803
3821
  resolve()
3804
3822
  })
3805
3823
  })
@@ -4617,32 +4635,92 @@ export default defineVxeComponent({
4617
4635
  * 更新树连接线样式
4618
4636
  */
4619
4637
  const updateTreeLineStyle = () => {
4620
- // const { tableData } = reactData
4621
- // const { rowExpandedMaps } = internalData
4622
- // const treeOpts = computeTreeOpts.value
4623
- // const { transform, mapChildrenField } = treeOpts
4624
- // const childrenField = treeOpts.children || treeOpts.childrenField
4625
- // const { handleGetRowId } = createHandleGetRowId($xeTable)
4626
- // // 待优化
4627
- // if (transform) {
4628
- // // x
4629
- // } else {
4630
- // // x
4631
- // }
4632
- // const handleNodeRow = (row: any, parentRow: any) => {
4633
- // const childList: any[] = row[transform ? mapChildrenField : childrenField]
4634
- // if (childList && childList.length) {
4635
- // childList.forEach(childRow => {
4636
- // const childRowid = handleGetRowId(childRow)
4637
- // if (rowExpandedMaps[childRowid]) {
4638
- // handleNodeRow(childRow, row)
4639
- // }
4640
- // })
4641
- // }
4642
- // }
4643
- // tableData.forEach(row => {
4644
- // handleNodeRow(row, null)
4645
- // })
4638
+ const { treeConfig } = props
4639
+ if (!treeConfig) {
4640
+ return
4641
+ }
4642
+ const { tableData } = reactData
4643
+ const { fullAllDataRowIdData, treeExpandedMaps } = internalData
4644
+ const cellOpts = computeCellOpts.value
4645
+ const rowOpts = computeRowOpts.value
4646
+ const defaultRowHeight = computeDefaultRowHeight.value
4647
+ const treeOpts = computeTreeOpts.value
4648
+ const { transform, mapChildrenField } = treeOpts
4649
+ const childrenField = treeOpts.children || treeOpts.childrenField
4650
+ const { handleGetRowId } = createHandleGetRowId($xeTable)
4651
+ const expParentList: {
4652
+ row: any
4653
+ prevRow: any
4654
+ nextRow: any
4655
+ }[] = []
4656
+
4657
+ const handleNodeRow = (row: any, rIndex: number, rows: any[]) => {
4658
+ const rowid = handleGetRowId(row)
4659
+ const rowRest = fullAllDataRowIdData[rowid] || {}
4660
+ const childList: any[] = row[transform ? mapChildrenField : childrenField]
4661
+ const prevRow = rows[rIndex - 1] || null
4662
+ const nextRow = rows[rIndex + 1] || null
4663
+ if (childList && childList.length && treeExpandedMaps[rowid]) {
4664
+ expParentList.push({ row, prevRow, nextRow })
4665
+ childList.forEach((childRow, crIndex) => {
4666
+ const childRowid = handleGetRowId(childRow)
4667
+ if (treeExpandedMaps[childRowid]) {
4668
+ handleNodeRow(childRow, crIndex, childList)
4669
+ }
4670
+ })
4671
+ } else {
4672
+ if (nextRow) {
4673
+ const nextRowid = handleGetRowId(nextRow)
4674
+ const nextRowRest = fullAllDataRowIdData[nextRowid] || {}
4675
+ const currCellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight)
4676
+ const nextCellHeight = getCellRestHeight(nextRowRest, cellOpts, rowOpts, defaultRowHeight)
4677
+ rowRest.oHeight = currCellHeight
4678
+ rowRest.lineHeight = Math.floor(currCellHeight / 2 + nextCellHeight / 2)
4679
+ } else {
4680
+ rowRest.oHeight = 0
4681
+ rowRest.lineHeight = 0
4682
+ }
4683
+ }
4684
+ }
4685
+ tableData.forEach((row, rIndex) => {
4686
+ handleNodeRow(row, rIndex, tableData)
4687
+ })
4688
+
4689
+ XEUtils.lastArrayEach(expParentList, ({ row, nextRow }) => {
4690
+ const rowid = handleGetRowId(row)
4691
+ const childList: any[] = row[transform ? mapChildrenField : childrenField]
4692
+ const rowRest = fullAllDataRowIdData[rowid]
4693
+ if (rowRest) {
4694
+ const currCellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight)
4695
+ let countOffsetHeight = currCellHeight
4696
+ let countLineHeight = 0
4697
+ childList.forEach((childRow) => {
4698
+ const childRowid = handleGetRowId(childRow)
4699
+ const childRowRest = fullAllDataRowIdData[childRowid] || {}
4700
+ const childList: any[] = childRow[transform ? mapChildrenField : childrenField]
4701
+ if (treeExpandedMaps[childRowid] && childList && childList.length) {
4702
+ countOffsetHeight += (childRowRest.oHeight || 0)
4703
+ countLineHeight += (childRowRest.oHeight || 0)
4704
+ } else {
4705
+ const cellHeight = getCellRestHeight(childRowRest, cellOpts, rowOpts, defaultRowHeight)
4706
+ childRowRest.oHeight = cellHeight
4707
+ childRowRest.lineHeight = cellHeight
4708
+ countOffsetHeight += cellHeight
4709
+ countLineHeight += cellHeight
4710
+ }
4711
+ })
4712
+ if (nextRow) {
4713
+ const nextRowid = handleGetRowId(nextRow)
4714
+ const nextRowRest = fullAllDataRowIdData[nextRowid] || {}
4715
+ const currCellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight)
4716
+ const nextCellHeight = getCellRestHeight(nextRowRest, cellOpts, rowOpts, defaultRowHeight)
4717
+ countOffsetHeight += currCellHeight
4718
+ countLineHeight += Math.floor(currCellHeight / 2 + nextCellHeight / 2)
4719
+ }
4720
+ rowRest.lineHeight = countLineHeight
4721
+ rowRest.oHeight = countOffsetHeight
4722
+ }
4723
+ })
4646
4724
  }
4647
4725
 
4648
4726
  const handleRowExpandScroll = () => {
@@ -11517,6 +11595,22 @@ export default defineVxeComponent({
11517
11595
  }
11518
11596
  }
11519
11597
 
11598
+ // 展开行处理,如果展开行嵌入表格中
11599
+ if ($xeParentTable) {
11600
+ if (isRollY) {
11601
+ if (checkTargetElement(evnt.target, [leftScrollElem, bodyScrollElem, rightScrollElem], evnt.currentTarget)) {
11602
+ evnt.stopPropagation()
11603
+ return
11604
+ }
11605
+ }
11606
+ if (isRollX) {
11607
+ if (checkTargetElement(evnt.target, [headerScrollElem, bodyScrollElem, footerScrollElem], evnt.currentTarget)) {
11608
+ evnt.stopPropagation()
11609
+ return
11610
+ }
11611
+ }
11612
+ }
11613
+
11520
11614
  if (!(leftFixedWidth || rightFixedWidth || expandColumn)) {
11521
11615
  return
11522
11616
  }
@@ -12773,7 +12867,7 @@ export default defineVxeComponent({
12773
12867
  watch(dataFlag, () => {
12774
12868
  const { initStatus } = internalData
12775
12869
  const value = props.data || []
12776
- if (value && value.length >= 50000) {
12870
+ if (value && value.length >= 20000) {
12777
12871
  warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)'])
12778
12872
  }
12779
12873
  loadTableData(value, true).then(() => {
@@ -13021,7 +13115,7 @@ export default defineVxeComponent({
13021
13115
  handleUpdateRowGroup(groupFields)
13022
13116
 
13023
13117
  nextTick(() => {
13024
- const { data, exportConfig, importConfig, treeConfig, showOverflow, highlightCurrentRow, highlightCurrentColumn } = props
13118
+ const { data, exportConfig, importConfig, treeConfig, highlightCurrentRow, highlightCurrentColumn } = props
13025
13119
  const { scrollXStore, scrollYStore } = internalData
13026
13120
  const editOpts = computeEditOpts.value
13027
13121
  const treeOpts = computeTreeOpts.value
@@ -13054,9 +13148,9 @@ export default defineVxeComponent({
13054
13148
  if (props.editConfig && (editOpts.showStatus || editOpts.showUpdateStatus || editOpts.showInsertStatus) && !props.keepSource) {
13055
13149
  warnLog('vxe.error.reqProp', ['keep-source'])
13056
13150
  }
13057
- if (treeConfig && (treeOpts.showLine || treeOpts.line) && !showOverflow) {
13058
- warnLog('vxe.error.reqProp', ['show-overflow'])
13059
- }
13151
+ // if (treeConfig && (treeOpts.showLine || treeOpts.line) && !showOverflow) {
13152
+ // warnLog('vxe.error.reqProp', ['show-overflow'])
13153
+ // }
13060
13154
  if (treeConfig && !treeOpts.transform && props.stripe) {
13061
13155
  warnLog('vxe.error.noTree', ['stripe'])
13062
13156
  }
@@ -631,75 +631,6 @@ export function getLastChildColumn (column: VxeTableDefines.ColumnInfo): VxeTabl
631
631
  return column
632
632
  }
633
633
 
634
- const lineOffsetSizes = {
635
- mini: 3,
636
- small: 2,
637
- medium: 1,
638
- large: 0
639
- }
640
-
641
- function countTreeExpandSize (prevRow: any, params: VxeTableDefines.CellRenderBodyParams) {
642
- let count = 1
643
- if (!prevRow) {
644
- return count
645
- }
646
- const { $table } = params
647
- const reactData = $table.reactData
648
- const { treeExpandedFlag } = reactData
649
- const internalData = $table.internalData
650
- const { treeExpandedMaps } = internalData
651
- const { computeTreeOpts } = $table.getComputeMaps()
652
- const treeOpts = computeTreeOpts.value
653
- const { transform, mapChildrenField } = treeOpts
654
- const childrenField = treeOpts.children || treeOpts.childrenField
655
- const rowChildren = prevRow[transform ? mapChildrenField : childrenField]
656
- if (rowChildren && treeExpandedFlag && treeExpandedMaps[getRowid($table, prevRow)]) {
657
- for (let index = 0; index < rowChildren.length; index++) {
658
- count += countTreeExpandSize(rowChildren[index], params)
659
- }
660
- }
661
- return count
662
- }
663
-
664
- export function getOffsetSize ($xeTable: VxeTableConstructor) {
665
- const { computeSize } = $xeTable.getComputeMaps()
666
- const vSize = computeSize.value
667
- if (vSize) {
668
- return lineOffsetSizes[vSize] || 0
669
- }
670
- return 0
671
- }
672
-
673
- export function calcTreeLine (params: VxeTableDefines.CellRenderBodyParams, prevRow: any) {
674
- const { $table, row } = params
675
- const tableProps = $table.props
676
- const tableReactData = $table.reactData
677
- const tableInternalData = $table.internalData
678
-
679
- const { showOverflow } = tableProps
680
- const { scrollYLoad } = tableReactData
681
- const { fullAllDataRowIdData } = tableInternalData
682
- const { computeRowOpts, computeCellOpts, computeDefaultRowHeight } = $table.getComputeMaps()
683
- const rowOpts = computeRowOpts.value
684
- const cellOpts = computeCellOpts.value
685
- const defaultRowHeight = computeDefaultRowHeight.value
686
- const rowid = getRowid($table, row)
687
- const rowRest = fullAllDataRowIdData[rowid]
688
- const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight
689
- let expandSize = 1
690
- if (prevRow) {
691
- expandSize = countTreeExpandSize(prevRow, params)
692
- }
693
- let cellHeight = currCellHeight
694
- const vnHeight = rowRest.height
695
- if (scrollYLoad) {
696
- if (!showOverflow) {
697
- cellHeight = vnHeight || currCellHeight
698
- }
699
- }
700
- return cellHeight * expandSize - (prevRow ? 1 : (12 - getOffsetSize($table)))
701
- }
702
-
703
634
  export function clearTableDefaultStatus ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
704
635
  const { props, internalData } = $xeTable
705
636
 
@@ -178,7 +178,8 @@ VxeUI.setConfig({
178
178
  hasChildField: 'hasChild',
179
179
  mapChildrenField: '_X_ROW_CHILD',
180
180
  indent: 20,
181
- showIcon: true
181
+ showIcon: true,
182
+ showRootLine: true
182
183
  },
183
184
  expandConfig: {
184
185
  // 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
  }