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
@@ -67,17 +67,17 @@ hooks.add('tableEditModule', {
67
67
  const { item: parentRow } = matchObj;
68
68
  const parentRest = fullAllDataRowIdData[getRowid($xeTable, parentRow)];
69
69
  const parentLevel = parentRest ? parentRest.level : 0;
70
- let parentChilds = parentRow[childrenField];
71
- let mapChilds = parentRow[mapChildrenField];
72
- if (!XEUtils.isArray(parentChilds)) {
73
- parentChilds = parentRow[childrenField] = [];
70
+ let pChilds = parentRow[childrenField];
71
+ let pMapChilds = parentRow[mapChildrenField];
72
+ if (!XEUtils.isArray(pChilds)) {
73
+ pChilds = parentRow[childrenField] = [];
74
74
  }
75
- if (!XEUtils.isArray(mapChilds)) {
76
- mapChilds = parentRow[childrenField] = [];
75
+ if (!XEUtils.isArray(pMapChilds)) {
76
+ pMapChilds = parentRow[mapChildrenField] = [];
77
77
  }
78
- parentChilds[funcName](item);
79
- mapChilds[funcName](item);
80
- 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 };
78
+ pChilds[funcName](item);
79
+ pMapChilds[funcName](item);
80
+ 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 };
81
81
  fullDataRowIdData[rowid] = rest;
82
82
  fullAllDataRowIdData[rowid] = rest;
83
83
  }
@@ -178,14 +178,16 @@ hooks.add('tableEditModule', {
178
178
  treeRecords.forEach((row, i) => {
179
179
  if (parentRow) {
180
180
  if (row[parentField] !== parentRow[rowField]) {
181
- row[parentField] = parentRow[rowField];
182
181
  errLog('vxe.error.errProp', [`${parentField}=${row[parentField]}`, `${parentField}=${parentRow[rowField]}`]);
182
+ row[parentField] = parentRow[rowField];
183
183
  }
184
184
  }
185
185
  else {
186
186
  if (row[parentField] !== null) {
187
+ if (!XEUtils.eqNull(row[parentField])) {
188
+ errLog('vxe.error.errProp', [`${parentField}=${row[parentField]}`, 'null']);
189
+ }
187
190
  row[parentField] = null;
188
- errLog('vxe.error.errProp', [`${parentField}=${row[parentField]}`, 'null']);
189
191
  }
190
192
  }
191
193
  let targetIndex = matchMapObj.index + i;
@@ -2,7 +2,7 @@ import { h, ref, inject, nextTick, onMounted, onUnmounted } from 'vue';
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';
@@ -40,22 +40,38 @@ export default defineVxeComponent({
40
40
  };
41
41
  const renderLine = (rowid, params, cellHeight) => {
42
42
  const { column } = params;
43
- const { afterFullData } = tableInternalData;
44
43
  const { treeConfig } = tableProps;
44
+ const cellOpts = computeCellOpts.value;
45
+ const rowOpts = computeRowOpts.value;
46
+ const defaultRowHeight = computeDefaultRowHeight.value;
45
47
  const treeOpts = computeTreeOpts.value;
46
48
  const { slots, treeNode } = column;
47
49
  const { fullAllDataRowIdData } = tableInternalData;
48
- if (slots && slots.line) {
49
- return $xeTable.callSlot(slots.line, params);
50
- }
51
- const rowRest = fullAllDataRowIdData[rowid];
52
- let rLevel = 0;
53
- let prevRow = null;
54
- if (rowRest) {
55
- rLevel = rowRest.level;
56
- prevRow = rowRest.items[rowRest.treeIndex - 1];
57
- }
58
50
  if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
51
+ if (slots && slots.line) {
52
+ return $xeTable.callSlot(slots.line, params);
53
+ }
54
+ const rowRest = fullAllDataRowIdData[rowid];
55
+ let rLevel = 0;
56
+ let prevRow = null;
57
+ let parentRow = null;
58
+ let lineHeight = '';
59
+ if (rowRest) {
60
+ rLevel = rowRest.level;
61
+ prevRow = rowRest.items[rowRest.treeIndex - 1];
62
+ parentRow = rowRest.parent;
63
+ }
64
+ if (!rLevel && !treeOpts.showRootLine) {
65
+ return [];
66
+ }
67
+ if (prevRow) {
68
+ const prevRowRest = fullAllDataRowIdData[getRowid($xeTable, prevRow)] || {};
69
+ lineHeight = `${prevRowRest.lineHeight || 0}px`;
70
+ }
71
+ else if (rLevel && parentRow) {
72
+ const parentRowRest = fullAllDataRowIdData[getRowid($xeTable, parentRow)] || {};
73
+ lineHeight = `calc(-1em + ${Math.floor(cellHeight / 2 + getCellRestHeight(parentRowRest, cellOpts, rowOpts, defaultRowHeight) / 2)}px)`;
74
+ }
59
75
  return [
60
76
  h('div', {
61
77
  key: 'tl',
@@ -64,9 +80,9 @@ export default defineVxeComponent({
64
80
  h('div', {
65
81
  class: 'vxe-tree--line',
66
82
  style: {
67
- height: `${getRowid($xeTable, afterFullData[0]) === rowid ? 1 : calcTreeLine(params, prevRow)}px`,
83
+ height: lineHeight,
68
84
  bottom: `-${Math.floor(cellHeight / 2)}px`,
69
- left: `${(rLevel * treeOpts.indent) + (rLevel ? 2 - getOffsetSize($xeTable) : 0) + 16}px`
85
+ left: `calc(${(rLevel * treeOpts.indent)}px + 1em)`
70
86
  }
71
87
  })
72
88
  ])
@@ -1,7 +1,7 @@
1
1
  import { h, reactive, 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';
@@ -46,6 +46,7 @@ export default defineVxeComponent({
46
46
  const VxeUILoadingComponent = VxeUI.getComponent('VxeLoading');
47
47
  const VxeUITooltipComponent = VxeUI.getComponent('VxeTooltip');
48
48
  const $xeTabs = inject('$xeTabs', null);
49
+ const $xeParentTable = inject('$xeTable', null);
49
50
  const $xeGrid = inject('$xeGrid', null);
50
51
  const $xeGantt = inject('$xeGantt', null);
51
52
  const $xeGGWrapper = $xeGrid || $xeGantt;
@@ -1771,6 +1772,9 @@ export default defineVxeComponent({
1771
1772
  internalData.customHeight = 300;
1772
1773
  }
1773
1774
  };
1775
+ /**
1776
+ * 计算自适应列宽
1777
+ */
1774
1778
  const calcColumnAutoWidth = (column, wrapperEl) => {
1775
1779
  const columnOpts = computeColumnOpts.value;
1776
1780
  const { autoOptions } = columnOpts;
@@ -1799,6 +1803,9 @@ export default defineVxeComponent({
1799
1803
  }
1800
1804
  return colWidth + leftRightPadding;
1801
1805
  };
1806
+ /**
1807
+ * 自适应列宽
1808
+ */
1802
1809
  const calcCellWidth = () => {
1803
1810
  const autoWidthColumnList = computeAutoWidthColumnList.value;
1804
1811
  const { fullColumnIdData } = internalData;
@@ -1931,6 +1938,9 @@ export default defineVxeComponent({
1931
1938
  updateColumnOffsetLeft();
1932
1939
  updateHeight();
1933
1940
  };
1941
+ /**
1942
+ * 计算自适应行高
1943
+ */
1934
1944
  const calcCellAutoHeight = (rowRest, wrapperEl) => {
1935
1945
  const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
1936
1946
  let colHeight = rowRest.height;
@@ -1948,12 +1958,17 @@ export default defineVxeComponent({
1948
1958
  }
1949
1959
  return colHeight;
1950
1960
  };
1961
+ /**
1962
+ * 自适应行高
1963
+ */
1951
1964
  const calcCellHeight = () => {
1965
+ const { treeConfig } = props;
1952
1966
  const { tableData, isAllOverflow, scrollYLoad, scrollXLoad } = reactData;
1953
1967
  const { fullAllDataRowIdData } = internalData;
1968
+ const treeOpts = computeTreeOpts.value;
1954
1969
  const defaultRowHeight = computeDefaultRowHeight.value;
1955
1970
  const el = refElem.value;
1956
- if (!isAllOverflow && (scrollYLoad || scrollXLoad) && el) {
1971
+ if (!isAllOverflow && (scrollYLoad || scrollXLoad || (treeConfig && treeOpts.showLine)) && el) {
1957
1972
  const { handleGetRowId } = createHandleGetRowId($xeTable);
1958
1973
  el.setAttribute('data-calc-row', 'Y');
1959
1974
  tableData.forEach(row => {
@@ -3608,6 +3623,7 @@ export default defineVxeComponent({
3608
3623
  }
3609
3624
  reactData.isRowLoading = false;
3610
3625
  handleRecalculateStyle(false, false, false);
3626
+ updateTreeLineStyle();
3611
3627
  // 如果是自动行高,特殊情况需调用 recalculate 手动刷新
3612
3628
  if (!props.showOverflow) {
3613
3629
  setTimeout(() => {
@@ -3621,6 +3637,7 @@ export default defineVxeComponent({
3621
3637
  .then(() => {
3622
3638
  handleRecalculateStyle(false, true, true);
3623
3639
  updateRowOffsetTop();
3640
+ updateTreeLineStyle();
3624
3641
  resolve();
3625
3642
  });
3626
3643
  }
@@ -3630,6 +3647,7 @@ export default defineVxeComponent({
3630
3647
  .then(() => {
3631
3648
  handleRecalculateStyle(false, true, true);
3632
3649
  updateRowOffsetTop();
3650
+ updateTreeLineStyle();
3633
3651
  resolve();
3634
3652
  });
3635
3653
  });
@@ -4426,32 +4444,89 @@ export default defineVxeComponent({
4426
4444
  * 更新树连接线样式
4427
4445
  */
4428
4446
  const updateTreeLineStyle = () => {
4429
- // const { tableData } = reactData
4430
- // const { rowExpandedMaps } = internalData
4431
- // const treeOpts = computeTreeOpts.value
4432
- // const { transform, mapChildrenField } = treeOpts
4433
- // const childrenField = treeOpts.children || treeOpts.childrenField
4434
- // const { handleGetRowId } = createHandleGetRowId($xeTable)
4435
- // // 待优化
4436
- // if (transform) {
4437
- // // x
4438
- // } else {
4439
- // // x
4440
- // }
4441
- // const handleNodeRow = (row: any, parentRow: any) => {
4442
- // const childList: any[] = row[transform ? mapChildrenField : childrenField]
4443
- // if (childList && childList.length) {
4444
- // childList.forEach(childRow => {
4445
- // const childRowid = handleGetRowId(childRow)
4446
- // if (rowExpandedMaps[childRowid]) {
4447
- // handleNodeRow(childRow, row)
4448
- // }
4449
- // })
4450
- // }
4451
- // }
4452
- // tableData.forEach(row => {
4453
- // handleNodeRow(row, null)
4454
- // })
4447
+ const { treeConfig } = props;
4448
+ if (!treeConfig) {
4449
+ return;
4450
+ }
4451
+ const { tableData } = reactData;
4452
+ const { fullAllDataRowIdData, treeExpandedMaps } = internalData;
4453
+ const cellOpts = computeCellOpts.value;
4454
+ const rowOpts = computeRowOpts.value;
4455
+ const defaultRowHeight = computeDefaultRowHeight.value;
4456
+ const treeOpts = computeTreeOpts.value;
4457
+ const { transform, mapChildrenField } = treeOpts;
4458
+ const childrenField = treeOpts.children || treeOpts.childrenField;
4459
+ const { handleGetRowId } = createHandleGetRowId($xeTable);
4460
+ const expParentList = [];
4461
+ const handleNodeRow = (row, rIndex, rows) => {
4462
+ const rowid = handleGetRowId(row);
4463
+ const rowRest = fullAllDataRowIdData[rowid] || {};
4464
+ const childList = row[transform ? mapChildrenField : childrenField];
4465
+ const prevRow = rows[rIndex - 1] || null;
4466
+ const nextRow = rows[rIndex + 1] || null;
4467
+ if (childList && childList.length && treeExpandedMaps[rowid]) {
4468
+ expParentList.push({ row, prevRow, nextRow });
4469
+ childList.forEach((childRow, crIndex) => {
4470
+ const childRowid = handleGetRowId(childRow);
4471
+ if (treeExpandedMaps[childRowid]) {
4472
+ handleNodeRow(childRow, crIndex, childList);
4473
+ }
4474
+ });
4475
+ }
4476
+ else {
4477
+ if (nextRow) {
4478
+ const nextRowid = handleGetRowId(nextRow);
4479
+ const nextRowRest = fullAllDataRowIdData[nextRowid] || {};
4480
+ const currCellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
4481
+ const nextCellHeight = getCellRestHeight(nextRowRest, cellOpts, rowOpts, defaultRowHeight);
4482
+ rowRest.oHeight = currCellHeight;
4483
+ rowRest.lineHeight = Math.floor(currCellHeight / 2 + nextCellHeight / 2);
4484
+ }
4485
+ else {
4486
+ rowRest.oHeight = 0;
4487
+ rowRest.lineHeight = 0;
4488
+ }
4489
+ }
4490
+ };
4491
+ tableData.forEach((row, rIndex) => {
4492
+ handleNodeRow(row, rIndex, tableData);
4493
+ });
4494
+ XEUtils.lastArrayEach(expParentList, ({ row, nextRow }) => {
4495
+ const rowid = handleGetRowId(row);
4496
+ const childList = row[transform ? mapChildrenField : childrenField];
4497
+ const rowRest = fullAllDataRowIdData[rowid];
4498
+ if (rowRest) {
4499
+ const currCellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
4500
+ let countOffsetHeight = currCellHeight;
4501
+ let countLineHeight = 0;
4502
+ childList.forEach((childRow) => {
4503
+ const childRowid = handleGetRowId(childRow);
4504
+ const childRowRest = fullAllDataRowIdData[childRowid] || {};
4505
+ const childList = childRow[transform ? mapChildrenField : childrenField];
4506
+ if (treeExpandedMaps[childRowid] && childList && childList.length) {
4507
+ countOffsetHeight += (childRowRest.oHeight || 0);
4508
+ countLineHeight += (childRowRest.oHeight || 0);
4509
+ }
4510
+ else {
4511
+ const cellHeight = getCellRestHeight(childRowRest, cellOpts, rowOpts, defaultRowHeight);
4512
+ childRowRest.oHeight = cellHeight;
4513
+ childRowRest.lineHeight = cellHeight;
4514
+ countOffsetHeight += cellHeight;
4515
+ countLineHeight += cellHeight;
4516
+ }
4517
+ });
4518
+ if (nextRow) {
4519
+ const nextRowid = handleGetRowId(nextRow);
4520
+ const nextRowRest = fullAllDataRowIdData[nextRowid] || {};
4521
+ const currCellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
4522
+ const nextCellHeight = getCellRestHeight(nextRowRest, cellOpts, rowOpts, defaultRowHeight);
4523
+ countOffsetHeight += currCellHeight;
4524
+ countLineHeight += Math.floor(currCellHeight / 2 + nextCellHeight / 2);
4525
+ }
4526
+ rowRest.lineHeight = countLineHeight;
4527
+ rowRest.oHeight = countOffsetHeight;
4528
+ }
4529
+ });
4455
4530
  };
4456
4531
  const handleRowExpandScroll = () => {
4457
4532
  const { elemStore } = internalData;
@@ -11348,6 +11423,21 @@ export default defineVxeComponent({
11348
11423
  return;
11349
11424
  }
11350
11425
  }
11426
+ // 展开行处理,如果展开行嵌入表格中
11427
+ if ($xeParentTable) {
11428
+ if (isRollY) {
11429
+ if (checkTargetElement(evnt.target, [leftScrollElem, bodyScrollElem, rightScrollElem], evnt.currentTarget)) {
11430
+ evnt.stopPropagation();
11431
+ return;
11432
+ }
11433
+ }
11434
+ if (isRollX) {
11435
+ if (checkTargetElement(evnt.target, [headerScrollElem, bodyScrollElem, footerScrollElem], evnt.currentTarget)) {
11436
+ evnt.stopPropagation();
11437
+ return;
11438
+ }
11439
+ }
11440
+ }
11351
11441
  if (!(leftFixedWidth || rightFixedWidth || expandColumn)) {
11352
11442
  return;
11353
11443
  }
@@ -12572,7 +12662,7 @@ export default defineVxeComponent({
12572
12662
  watch(dataFlag, () => {
12573
12663
  const { initStatus } = internalData;
12574
12664
  const value = props.data || [];
12575
- if (value && value.length >= 50000) {
12665
+ if (value && value.length >= 20000) {
12576
12666
  warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)']);
12577
12667
  }
12578
12668
  loadTableData(value, true).then(() => {
@@ -12796,7 +12886,7 @@ export default defineVxeComponent({
12796
12886
  }
12797
12887
  handleUpdateRowGroup(groupFields);
12798
12888
  nextTick(() => {
12799
- const { data, exportConfig, importConfig, treeConfig, showOverflow, highlightCurrentRow, highlightCurrentColumn } = props;
12889
+ const { data, exportConfig, importConfig, treeConfig, highlightCurrentRow, highlightCurrentColumn } = props;
12800
12890
  const { scrollXStore, scrollYStore } = internalData;
12801
12891
  const editOpts = computeEditOpts.value;
12802
12892
  const treeOpts = computeTreeOpts.value;
@@ -12828,9 +12918,9 @@ export default defineVxeComponent({
12828
12918
  if (props.editConfig && (editOpts.showStatus || editOpts.showUpdateStatus || editOpts.showInsertStatus) && !props.keepSource) {
12829
12919
  warnLog('vxe.error.reqProp', ['keep-source']);
12830
12920
  }
12831
- if (treeConfig && (treeOpts.showLine || treeOpts.line) && !showOverflow) {
12832
- warnLog('vxe.error.reqProp', ['show-overflow']);
12833
- }
12921
+ // if (treeConfig && (treeOpts.showLine || treeOpts.line) && !showOverflow) {
12922
+ // warnLog('vxe.error.reqProp', ['show-overflow'])
12923
+ // }
12834
12924
  if (treeConfig && !treeOpts.transform && props.stripe) {
12835
12925
  warnLog('vxe.error.noTree', ['stripe']);
12836
12926
  }
@@ -560,70 +560,6 @@ export function getLastChildColumn(column) {
560
560
  }
561
561
  return column;
562
562
  }
563
- const lineOffsetSizes = {
564
- mini: 3,
565
- small: 2,
566
- medium: 1,
567
- large: 0
568
- };
569
- function countTreeExpandSize(prevRow, params) {
570
- let count = 1;
571
- if (!prevRow) {
572
- return count;
573
- }
574
- const { $table } = params;
575
- const reactData = $table.reactData;
576
- const { treeExpandedFlag } = reactData;
577
- const internalData = $table.internalData;
578
- const { treeExpandedMaps } = internalData;
579
- const { computeTreeOpts } = $table.getComputeMaps();
580
- const treeOpts = computeTreeOpts.value;
581
- const { transform, mapChildrenField } = treeOpts;
582
- const childrenField = treeOpts.children || treeOpts.childrenField;
583
- const rowChildren = prevRow[transform ? mapChildrenField : childrenField];
584
- if (rowChildren && treeExpandedFlag && treeExpandedMaps[getRowid($table, prevRow)]) {
585
- for (let index = 0; index < rowChildren.length; index++) {
586
- count += countTreeExpandSize(rowChildren[index], params);
587
- }
588
- }
589
- return count;
590
- }
591
- export function getOffsetSize($xeTable) {
592
- const { computeSize } = $xeTable.getComputeMaps();
593
- const vSize = computeSize.value;
594
- if (vSize) {
595
- return lineOffsetSizes[vSize] || 0;
596
- }
597
- return 0;
598
- }
599
- export function calcTreeLine(params, prevRow) {
600
- const { $table, row } = params;
601
- const tableProps = $table.props;
602
- const tableReactData = $table.reactData;
603
- const tableInternalData = $table.internalData;
604
- const { showOverflow } = tableProps;
605
- const { scrollYLoad } = tableReactData;
606
- const { fullAllDataRowIdData } = tableInternalData;
607
- const { computeRowOpts, computeCellOpts, computeDefaultRowHeight } = $table.getComputeMaps();
608
- const rowOpts = computeRowOpts.value;
609
- const cellOpts = computeCellOpts.value;
610
- const defaultRowHeight = computeDefaultRowHeight.value;
611
- const rowid = getRowid($table, row);
612
- const rowRest = fullAllDataRowIdData[rowid];
613
- const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
614
- let expandSize = 1;
615
- if (prevRow) {
616
- expandSize = countTreeExpandSize(prevRow, params);
617
- }
618
- let cellHeight = currCellHeight;
619
- const vnHeight = rowRest.height;
620
- if (scrollYLoad) {
621
- if (!showOverflow) {
622
- cellHeight = vnHeight || currCellHeight;
623
- }
624
- }
625
- return cellHeight * expandSize - (prevRow ? 1 : (12 - getOffsetSize($table)));
626
- }
627
563
  export function clearTableDefaultStatus($xeTable) {
628
564
  const { props, internalData } = $xeTable;
629
565
  internalData.initStatus = false;
@@ -3547,13 +3547,14 @@
3547
3547
  left: 50%;
3548
3548
  font-size: 12px;
3549
3549
  line-height: 1em;
3550
- transform: translate(-50%, -50%);
3550
+ transform: translate(-50%, -2px);
3551
3551
  text-align: left;
3552
3552
  z-index: 4;
3553
3553
  padding: 0 var(--vxe-ui-table-cell-padding-default);
3554
3554
  pointer-events: none;
3555
3555
  }
3556
3556
  .vxe-table--render-default .vxe-body--column .vxe-cell--valid-error-wrapper {
3557
+ position: relative;
3557
3558
  display: inline-block;
3558
3559
  border-radius: var(--vxe-ui-border-radius);
3559
3560
  pointer-events: auto;
@@ -3584,11 +3585,11 @@
3584
3585
  }
3585
3586
  .vxe-table--render-default.valid-msg--single .vxe-body--row:last-child .vxe-cell--valid-error-tip {
3586
3587
  bottom: 100%;
3587
- transform: translate(-50%, 50%);
3588
+ transform: translate(-50%, 0);
3588
3589
  }
3589
3590
  .vxe-table--render-default.valid-msg--single .vxe-body--row:last-child:first-child .vxe-cell--valid-error-tip {
3590
3591
  bottom: auto;
3591
- transform: translate(-50%, -50%);
3592
+ transform: translate(-50%, -2px);
3592
3593
  }
3593
3594
  .vxe-table--render-default.valid-msg--full .vxe-body--row:last-child .vxe-cell--valid-error-tip {
3594
3595
  top: calc(100% - 1.3em);