vxe-pc-ui 4.17.7 → 4.17.8

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 (55) hide show
  1. package/dist/all.esm.js +205 -222
  2. package/dist/style.css +1 -1
  3. package/dist/style.min.css +1 -1
  4. package/es/button-group/style.css +1 -1
  5. package/es/button-group/style.min.css +1 -1
  6. package/es/icon/style.css +1 -1
  7. package/es/style.css +1 -1
  8. package/es/style.min.css +1 -1
  9. package/es/tooltip/src/tooltip.js +80 -134
  10. package/es/tree/src/tree.js +2 -2
  11. package/es/ui/index.js +4 -4
  12. package/es/ui/src/dom.js +118 -81
  13. package/es/ui/src/log.js +1 -1
  14. package/es/vxe-button-group/style.css +1 -1
  15. package/es/vxe-button-group/style.min.css +1 -1
  16. package/lib/button-group/style/style.css +1 -1
  17. package/lib/button-group/style/style.min.css +1 -1
  18. package/lib/icon/style/style.css +1 -1
  19. package/lib/icon/style/style.min.css +1 -1
  20. package/lib/index.umd.js +210 -225
  21. package/lib/index.umd.min.js +1 -1
  22. package/lib/style.css +1 -1
  23. package/lib/style.min.css +1 -1
  24. package/lib/tooltip/src/tooltip.js +91 -140
  25. package/lib/tooltip/src/tooltip.min.js +1 -1
  26. package/lib/tree/src/tree.js +2 -1
  27. package/lib/tree/src/tree.min.js +1 -1
  28. package/lib/ui/index.js +4 -4
  29. package/lib/ui/index.min.js +1 -1
  30. package/lib/ui/src/dom.js +113 -79
  31. package/lib/ui/src/dom.min.js +1 -1
  32. package/lib/ui/src/log.js +1 -1
  33. package/lib/ui/src/log.min.js +1 -1
  34. package/lib/vxe-button-group/style/style.css +1 -1
  35. package/lib/vxe-button-group/style/style.min.css +1 -1
  36. package/package.json +3 -2
  37. package/packages/tooltip/src/tooltip.ts +83 -134
  38. package/packages/tree/src/tree.ts +2 -2
  39. package/packages/ui/index.ts +3 -3
  40. package/packages/ui/src/dom.ts +128 -83
  41. package/styles/components/button-group.scss +4 -2
  42. package/types/components/table.d.ts +6 -0
  43. package/types/components/tooltip.d.ts +4 -0
  44. /package/es/icon/{iconfont.1787197092496.ttf → iconfont.1787216141017.ttf} +0 -0
  45. /package/es/icon/{iconfont.1787197092496.woff → iconfont.1787216141017.woff} +0 -0
  46. /package/es/icon/{iconfont.1787197092496.woff2 → iconfont.1787216141017.woff2} +0 -0
  47. /package/es/{iconfont.1787197092496.ttf → iconfont.1787216141017.ttf} +0 -0
  48. /package/es/{iconfont.1787197092496.woff → iconfont.1787216141017.woff} +0 -0
  49. /package/es/{iconfont.1787197092496.woff2 → iconfont.1787216141017.woff2} +0 -0
  50. /package/lib/icon/style/{iconfont.1787197092496.ttf → iconfont.1787216141017.ttf} +0 -0
  51. /package/lib/icon/style/{iconfont.1787197092496.woff → iconfont.1787216141017.woff} +0 -0
  52. /package/lib/icon/style/{iconfont.1787197092496.woff2 → iconfont.1787216141017.woff2} +0 -0
  53. /package/lib/{iconfont.1787197092496.ttf → iconfont.1787216141017.ttf} +0 -0
  54. /package/lib/{iconfont.1787197092496.woff → iconfont.1787216141017.woff} +0 -0
  55. /package/lib/{iconfont.1787197092496.woff2 → iconfont.1787216141017.woff2} +0 -0
package/dist/all.esm.js CHANGED
@@ -81,7 +81,7 @@ function checkDynamic() {
81
81
  }
82
82
 
83
83
  const { log } = VxeUI;
84
- const uiVersion = `ui v${"4.17.7"}`;
84
+ const uiVersion = `ui v${"4.17.8"}`;
85
85
  function createComponentLog(name) {
86
86
  const tableVersion = VxeUI.tableVersion ? `table v${VxeUI.tableVersion}` : '';
87
87
  const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
@@ -95,7 +95,7 @@ function createComponentLog(name) {
95
95
  const warnLog$i = log.create('warn', uiVersion);
96
96
  log.create('error', uiVersion);
97
97
 
98
- const version = "4.17.7";
98
+ const version = "4.17.8";
99
99
  VxeUI.uiVersion = version;
100
100
  VxeUI.dynamicApp = dynamicApp;
101
101
  function config(options) {
@@ -512,7 +512,8 @@ setConfig$1({
512
512
  theme: 'dark',
513
513
  enterDelay: 500,
514
514
  leaveDelay: 300,
515
- isArrow: true
515
+ isArrow: true,
516
+ defaultPlacement: 'top'
516
517
  },
517
518
  transfer: {},
518
519
  tree: {
@@ -526,8 +527,7 @@ setConfig$1({
526
527
  tooltipConfig: {
527
528
  mode: 'tooltip',
528
529
  enterable: true,
529
- leaveDelay: 300,
530
- defaultPlacement: 'top'
530
+ leaveDelay: 300
531
531
  },
532
532
  dragConfig: {
533
533
  showIcon: true,
@@ -1964,119 +1964,156 @@ function scrollToView(elem) {
1964
1964
  }
1965
1965
  }
1966
1966
  }
1967
+ /**
1968
+ * 通用定位计算
1969
+ */
1967
1970
  function updatePanelPlacement(targetElem, panelElem, options) {
1968
- const { placement, defaultPlacement, teleportTo, marginSize, isMinWidth } = Object.assign({ teleportTo: false, marginSize: 18, isMinWidth: true }, options);
1971
+ const { defaultTop, defaultLeft, placement, defaultPlacement, teleportTo, marginSize, isMinWidth } = Object.assign({
1972
+ teleportTo: false,
1973
+ marginSize: 18,
1974
+ isMinWidth: true
1975
+ }, options);
1969
1976
  let panelPlacement = 'bottom';
1970
1977
  let top = '';
1971
1978
  let bottom = '';
1972
- let left = '';
1973
- const right = '';
1979
+ let left = 0;
1974
1980
  let minWidth = '';
1981
+ let arrowLeft = '';
1975
1982
  const stys = {};
1976
1983
  if (panelElem && targetElem) {
1977
- const documentElement = document.documentElement;
1978
- const bodyElem = document.body;
1979
- const targetHeight = targetElem.offsetHeight;
1980
- const panelHeight = panelElem.offsetHeight;
1981
- const panelWidth = panelElem.offsetWidth;
1982
- const panelRect = panelElem.getBoundingClientRect();
1983
- const targetRect = targetElem.getBoundingClientRect();
1984
- const visibleHeight = documentElement.clientHeight || bodyElem.clientHeight;
1985
- const visibleWidth = documentElement.clientWidth || bodyElem.clientWidth;
1986
- minWidth = targetElem.offsetWidth;
1987
- if (teleportTo) {
1988
- left = targetRect.left;
1989
- top = targetRect.top + targetHeight;
1990
- if (placement === 'top') {
1991
- panelPlacement = 'top';
1992
- top = targetRect.top - panelHeight;
1993
- }
1994
- else if (!placement) {
1995
- if (defaultPlacement === 'top') {
1984
+ const parentEl = panelElem.parentElement;
1985
+ const parentWrapperEl = parentEl === document.body ? document.documentElement : parentEl;
1986
+ if (parentWrapperEl) {
1987
+ const targetWidth = targetElem.offsetWidth;
1988
+ const targetHeight = targetElem.offsetHeight;
1989
+ const panelHeight = panelElem.offsetHeight;
1990
+ const panelWidth = panelElem.offsetWidth;
1991
+ const parentWrapperRect = parentWrapperEl.getBoundingClientRect();
1992
+ const panelRect = panelElem.getBoundingClientRect();
1993
+ const targetRect = targetElem.getBoundingClientRect();
1994
+ const visibleHeight = parentWrapperEl.clientHeight;
1995
+ const visibleWidth = parentWrapperEl.clientWidth;
1996
+ const offsetLeft = parentWrapperRect.left;
1997
+ const offsetTop = parentWrapperRect.top;
1998
+ const targetLeft = targetRect.left;
1999
+ const targetTop = targetRect.top;
2000
+ minWidth = targetElem.offsetWidth;
2001
+ if (teleportTo) {
2002
+ left = defaultLeft || (targetLeft);
2003
+ top = defaultTop || (targetTop + targetHeight);
2004
+ if (placement === 'top') {
1996
2005
  panelPlacement = 'top';
1997
- top = targetRect.top - panelHeight;
1998
- // 如果上面不够放,则向下
1999
- if (top < marginSize) {
2000
- panelPlacement = 'bottom';
2001
- top = targetRect.top + targetHeight;
2002
- }
2003
- // 如果下面不够放,则向上(优先)
2004
- if (top + panelHeight + marginSize > visibleHeight) {
2006
+ top = targetTop - panelHeight;
2007
+ }
2008
+ else if (!placement) {
2009
+ if (defaultPlacement === 'top') {
2005
2010
  panelPlacement = 'top';
2006
- top = targetRect.top - panelHeight;
2011
+ top = targetTop - panelHeight;
2012
+ // 如果上面不够放,则向下
2013
+ if (top < marginSize) {
2014
+ panelPlacement = 'bottom';
2015
+ top = targetTop + targetHeight;
2016
+ }
2017
+ // 如果下面不够放,则向上(优先)
2018
+ if (top + panelHeight + marginSize > visibleHeight) {
2019
+ panelPlacement = 'top';
2020
+ top = targetTop - panelHeight;
2021
+ }
2022
+ }
2023
+ else {
2024
+ // 如果下面不够放,则向上
2025
+ if (top + panelHeight + marginSize > visibleHeight) {
2026
+ panelPlacement = 'top';
2027
+ top = targetTop - panelHeight;
2028
+ }
2029
+ // 如果上面不够放,则向下(优先)
2030
+ if (top < marginSize) {
2031
+ panelPlacement = 'bottom';
2032
+ top = targetTop + targetHeight;
2033
+ }
2007
2034
  }
2008
2035
  }
2009
- else {
2036
+ // 如果溢出右边
2037
+ if (left + panelWidth + marginSize > visibleWidth) {
2038
+ left -= left + panelWidth + marginSize - visibleWidth;
2039
+ }
2040
+ // 如果溢出左边
2041
+ if (left < marginSize) {
2042
+ left = marginSize;
2043
+ }
2044
+ // 偏移
2045
+ top -= offsetTop;
2046
+ left -= offsetLeft;
2047
+ }
2048
+ else {
2049
+ if (placement === 'top') {
2050
+ panelPlacement = 'top';
2051
+ bottom = targetHeight;
2052
+ }
2053
+ else if (!placement) {
2010
2054
  // 如果下面不够放,则向上
2011
- if (top + panelHeight + marginSize > visibleHeight) {
2012
- panelPlacement = 'top';
2013
- top = targetRect.top - panelHeight;
2014
- }
2015
- // 如果上面不够放,则向下(优先)
2016
- if (top < marginSize) {
2017
- panelPlacement = 'bottom';
2018
- top = targetRect.top + targetHeight;
2055
+ top = targetHeight;
2056
+ if (targetTop + targetHeight + panelHeight + marginSize > visibleHeight) {
2057
+ // 如果上面不够放,则向下(优先)
2058
+ if (targetTop - targetHeight - panelHeight > marginSize) {
2059
+ panelPlacement = 'top';
2060
+ top = '';
2061
+ bottom = targetHeight;
2062
+ }
2019
2063
  }
2020
2064
  }
2065
+ // 是否超出右侧
2066
+ if (panelRect.left + panelRect.width + marginSize > visibleWidth) {
2067
+ left = -(panelRect.left + panelRect.width + marginSize - visibleWidth);
2068
+ }
2021
2069
  }
2022
- // 如果溢出右边
2023
- if (left + panelWidth + marginSize > visibleWidth) {
2024
- left -= left + panelWidth + marginSize - visibleWidth;
2070
+ if (XEUtils.isNumber(top)) {
2071
+ stys.top = toCssUnit(top);
2025
2072
  }
2026
- // 如果溢出左边
2027
- if (left < marginSize) {
2028
- left = marginSize;
2073
+ if (XEUtils.isNumber(bottom)) {
2074
+ stys.bottom = toCssUnit(bottom);
2029
2075
  }
2030
- }
2031
- else {
2032
- if (placement === 'top') {
2033
- panelPlacement = 'top';
2034
- bottom = targetHeight;
2035
- }
2036
- else if (!placement) {
2037
- // 如果下面不够放,则向上
2038
- top = targetHeight;
2039
- if (targetRect.top + targetHeight + panelHeight + marginSize > visibleHeight) {
2040
- // 如果上面不够放,则向下(优先)
2041
- if (targetRect.top - targetHeight - panelHeight > marginSize) {
2042
- panelPlacement = 'top';
2043
- top = '';
2044
- bottom = targetHeight;
2045
- }
2076
+ if (XEUtils.isNumber(left)) {
2077
+ stys.left = toCssUnit(left);
2078
+ }
2079
+ if (isMinWidth && XEUtils.isNumber(minWidth)) {
2080
+ stys.minWidth = toCssUnit(minWidth);
2081
+ }
2082
+ // 箭头
2083
+ if (left === targetLeft) {
2084
+ if (targetWidth <= panelWidth) {
2085
+ arrowLeft = targetWidth / 2;
2046
2086
  }
2047
2087
  }
2048
- // 是否超出右侧
2049
- if (panelRect.left + panelRect.width + marginSize > visibleWidth) {
2050
- left = -(panelRect.left + panelRect.width + marginSize - visibleWidth);
2088
+ else if (left < targetLeft) {
2089
+ if (left + panelWidth > targetLeft + targetWidth) {
2090
+ arrowLeft = (targetLeft - left) + targetWidth / 2;
2091
+ }
2092
+ else {
2093
+ arrowLeft = (targetLeft - left) + (panelWidth - (targetLeft - left)) / 2;
2094
+ }
2051
2095
  }
2052
2096
  }
2053
- if (XEUtils.isNumber(top)) {
2054
- stys.top = toCssUnit(top);
2055
- }
2056
- if (XEUtils.isNumber(bottom)) {
2057
- stys.bottom = toCssUnit(bottom);
2058
- }
2059
- if (XEUtils.isNumber(left)) {
2060
- stys.left = toCssUnit(left);
2061
- }
2062
- if (XEUtils.isNumber(right)) {
2063
- stys.right = toCssUnit(right);
2064
- }
2065
- if (isMinWidth && XEUtils.isNumber(minWidth)) {
2066
- stys.minWidth = toCssUnit(minWidth);
2067
- }
2068
2097
  }
2069
2098
  return {
2070
2099
  top: top || 0,
2071
2100
  bottom: bottom || 0,
2072
2101
  left: left || 0,
2073
- right: 0,
2102
+ arrowLeft: arrowLeft || 0,
2074
2103
  style: stys,
2075
2104
  placement: panelPlacement
2076
2105
  };
2077
2106
  }
2078
2107
  function getPopupContainer(appendTo) {
2079
- return appendTo ? ((XEUtils.isFunction(appendTo) ? appendTo({}) : appendTo) || 'body') : 'body';
2108
+ const selectElem = appendTo && XEUtils.isFunction(appendTo) ? appendTo({}) : appendTo;
2109
+ return selectElem || 'body';
2110
+ }
2111
+ function getPopupAppendElement(appendTo) {
2112
+ const selectElem = getPopupContainer(appendTo);
2113
+ if (XEUtils.isString(selectElem)) {
2114
+ return document.querySelector(selectElem) || document.body;
2115
+ }
2116
+ return selectElem;
2080
2117
  }
2081
2118
 
2082
2119
  function assembleAnchorLink($xeAnchor, elem, linkConfig, $xeParentAnchorLink) {
@@ -2691,6 +2728,10 @@ var VxeTooltipComponent = defineVxeComponent({
2691
2728
  leaveDelay: {
2692
2729
  type: Number,
2693
2730
  default: () => getConfig$3().tooltip.leaveDelay
2731
+ },
2732
+ appendTo: {
2733
+ type: [String, Function],
2734
+ default: () => getConfig$3().tooltip.appendTo
2694
2735
  }
2695
2736
  },
2696
2737
  emits: [
@@ -2738,99 +2779,8 @@ var VxeTooltipComponent = defineVxeComponent({
2738
2779
  internalData,
2739
2780
  getRefMaps: () => refMaps
2740
2781
  };
2741
- let tooltipMethods = {};
2742
- const updateTipStyle = () => {
2743
- const { isArrow, placement, defaultPlacement } = props;
2744
- const { tipTarget: targetElem, tipStore, tipPos } = reactData;
2745
- let top = '';
2746
- let left = '';
2747
- let panelPlacement = 'bottom';
2748
- let arrowLeft = '';
2749
- const panelElem = refElem.value;
2750
- if (panelElem && targetElem) {
2751
- const documentElement = document.documentElement;
2752
- const bodyElem = document.body;
2753
- const targetWidth = targetElem.offsetWidth;
2754
- const targetHeight = targetElem.offsetHeight;
2755
- const panelHeight = panelElem.offsetHeight;
2756
- const panelWidth = panelElem.offsetWidth;
2757
- const targetRect = targetElem.getBoundingClientRect();
2758
- const visibleHeight = documentElement.clientHeight || bodyElem.clientHeight;
2759
- const visibleWidth = documentElement.clientWidth || bodyElem.clientWidth;
2760
- const marginSize = 6;
2761
- left = targetRect.left;
2762
- top = targetRect.top + targetHeight;
2763
- if (tipPos && (tipPos.oLeft || tipPos.oTop)) {
2764
- if (isArrow) {
2765
- left = left + Math.max(8, Math.min(targetWidth - 8, tipPos.oLeft)) - panelWidth / 2;
2766
- }
2767
- else {
2768
- left = tipPos.x + 1;
2769
- top = tipPos.y + 1;
2770
- }
2771
- }
2772
- else {
2773
- left = targetRect.left + (targetWidth - panelWidth) / 2;
2774
- }
2775
- if (placement === 'top') {
2776
- panelPlacement = 'top';
2777
- top = targetRect.top - panelHeight;
2778
- }
2779
- else if (!placement) {
2780
- if (defaultPlacement === 'top') {
2781
- panelPlacement = 'top';
2782
- top = targetRect.top - panelHeight;
2783
- // 如果上面不够放,则向下
2784
- if (top < marginSize) {
2785
- panelPlacement = 'bottom';
2786
- top = targetRect.top + targetHeight;
2787
- }
2788
- // 如果下面不够放,则向上(优先)
2789
- if (top + panelHeight + marginSize > visibleHeight) {
2790
- panelPlacement = 'top';
2791
- top = targetRect.top - panelHeight;
2792
- }
2793
- }
2794
- else {
2795
- // 如果下面不够放,则向上
2796
- if (top + panelHeight + marginSize > visibleHeight) {
2797
- panelPlacement = 'top';
2798
- top = targetRect.top - panelHeight;
2799
- }
2800
- // 如果上面不够放,则向下(优先)
2801
- if (top < marginSize) {
2802
- panelPlacement = 'bottom';
2803
- top = targetRect.top + targetHeight;
2804
- }
2805
- }
2806
- }
2807
- // 如果溢出右边
2808
- if (left + panelWidth + marginSize > visibleWidth) {
2809
- left -= left + panelWidth + marginSize - visibleWidth;
2810
- }
2811
- // 如果溢出左边
2812
- if (left < marginSize) {
2813
- left = marginSize;
2814
- }
2815
- // 箭头
2816
- if (left === targetRect.left) {
2817
- if (targetWidth <= panelWidth) {
2818
- arrowLeft = targetWidth / 2;
2819
- }
2820
- }
2821
- else if (left < targetRect.left) {
2822
- if (left + panelWidth > targetRect.left + targetWidth) {
2823
- arrowLeft = (targetRect.left - left) + targetWidth / 2;
2824
- }
2825
- else {
2826
- arrowLeft = (targetRect.left - left) + (panelWidth - (targetRect.left - left)) / 2;
2827
- }
2828
- }
2829
- tipStore.placement = panelPlacement;
2830
- tipStore.style.top = `${top}px`;
2831
- tipStore.style.left = `${left}px`;
2832
- tipStore.arrowStyle.left = `${arrowLeft}px`;
2833
- }
2782
+ const dispatchEvent = (type, params, evnt) => {
2783
+ emit(type, createEvent(evnt, { $tooltip: $xeTooltip }, params));
2834
2784
  };
2835
2785
  const updateValue = (value) => {
2836
2786
  if (value !== reactData.visible) {
@@ -2839,14 +2789,18 @@ var VxeTooltipComponent = defineVxeComponent({
2839
2789
  emit('update:modelValue', value);
2840
2790
  }
2841
2791
  };
2842
- const updateZindex = () => {
2843
- if (reactData.tipZindex < getLastZIndex()) {
2792
+ const updateZIndex = () => {
2793
+ const { zIndex } = props;
2794
+ if (zIndex) {
2795
+ reactData.tipZindex = XEUtils.toNumber(zIndex);
2796
+ }
2797
+ else if (reactData.tipZindex < getLastZIndex()) {
2844
2798
  reactData.tipZindex = nextZIndex();
2845
2799
  }
2846
2800
  };
2847
2801
  const clickEvent = () => {
2848
2802
  if (reactData.visible) {
2849
- tooltipMethods.close();
2803
+ $xeTooltip.close();
2850
2804
  }
2851
2805
  else {
2852
2806
  handleVisible(reactData.target || getSelectorEl(), props.content);
@@ -2861,12 +2815,12 @@ var VxeTooltipComponent = defineVxeComponent({
2861
2815
  if (enterable && trigger === 'hover') {
2862
2816
  setTimeout(() => {
2863
2817
  if (!reactData.tipActive) {
2864
- tooltipMethods.close();
2818
+ $xeTooltip.close();
2865
2819
  }
2866
2820
  }, leaveDelay);
2867
2821
  }
2868
2822
  else {
2869
- tooltipMethods.close();
2823
+ $xeTooltip.close();
2870
2824
  }
2871
2825
  };
2872
2826
  const wrapperMouseenterEvent = () => {
@@ -2878,22 +2832,23 @@ var VxeTooltipComponent = defineVxeComponent({
2878
2832
  if (enterable && trigger === 'hover') {
2879
2833
  setTimeout(() => {
2880
2834
  if (!reactData.tipActive) {
2881
- tooltipMethods.close();
2835
+ $xeTooltip.close();
2882
2836
  }
2883
2837
  }, leaveDelay);
2884
2838
  }
2885
2839
  };
2886
2840
  const showTip = () => {
2841
+ const { appendTo } = props;
2887
2842
  const { tipStore } = reactData;
2888
- const el = refElem.value;
2889
- if (el) {
2890
- const parentNode = el.parentNode;
2843
+ const panelElem = refElem.value;
2844
+ if (panelElem) {
2845
+ const parentNode = panelElem.parentNode;
2891
2846
  if (!parentNode) {
2892
- document.body.appendChild(el);
2847
+ getPopupAppendElement(appendTo).appendChild(panelElem);
2893
2848
  }
2894
2849
  }
2895
2850
  updateValue(true);
2896
- updateZindex();
2851
+ updateZIndex();
2897
2852
  tipStore.placement = 'top';
2898
2853
  tipStore.style = { width: 'auto', left: 0, top: 0, zIndex: props.zIndex || reactData.tipZindex };
2899
2854
  tipStore.arrowStyle = { left: '50%' };
@@ -2954,10 +2909,50 @@ var VxeTooltipComponent = defineVxeComponent({
2954
2909
  }
2955
2910
  return null;
2956
2911
  };
2957
- tooltipMethods = {
2958
- dispatchEvent(type, params, evnt) {
2959
- emit(type, createEvent(evnt, { $tooltip: $xeTooltip }, params));
2960
- },
2912
+ const updateTipStyle = () => {
2913
+ const { placement, defaultPlacement, isArrow } = props;
2914
+ const { tipTarget: targetElem, tipStore, tipPos, tipZindex } = reactData;
2915
+ const panelElem = refElem.value;
2916
+ if (!targetElem || !panelElem) {
2917
+ return;
2918
+ }
2919
+ const targetRect = targetElem.getBoundingClientRect();
2920
+ const targetWidth = targetElem.offsetWidth;
2921
+ const targetHeight = targetElem.offsetHeight;
2922
+ const panelWidth = panelElem.offsetWidth;
2923
+ const targetLeft = targetRect.left;
2924
+ const targetTop = targetRect.top;
2925
+ // 支持特殊定位逻辑
2926
+ let left = targetLeft;
2927
+ let top = targetTop + targetHeight;
2928
+ if (tipPos && (tipPos.oLeft || tipPos.oTop)) {
2929
+ if (isArrow) {
2930
+ left = left + Math.max(8, Math.min(targetWidth - 8, tipPos.oLeft)) - panelWidth / 2;
2931
+ }
2932
+ else {
2933
+ left = tipPos.x + 1;
2934
+ top = tipPos.y + 1;
2935
+ }
2936
+ }
2937
+ else {
2938
+ left = targetLeft + (targetWidth - panelWidth) / 2;
2939
+ }
2940
+ const ppObj = updatePanelPlacement(targetElem, panelElem, {
2941
+ defaultTop: top,
2942
+ defaultLeft: left,
2943
+ placement: placement,
2944
+ defaultPlacement: defaultPlacement,
2945
+ teleportTo: true
2946
+ });
2947
+ const panelStyle = Object.assign(ppObj.style, {
2948
+ zIndex: tipZindex
2949
+ });
2950
+ tipStore.placement = ppObj.placement;
2951
+ tipStore.style = panelStyle;
2952
+ tipStore.arrowStyle.left = `${ppObj.arrowLeft}px`;
2953
+ };
2954
+ const tooltipMethods = {
2955
+ dispatchEvent,
2961
2956
  openByEvent(evnt, target, content) {
2962
2957
  return handleVisible(target || reactData.target || getSelectorEl(), content, evnt);
2963
2958
  },
@@ -2980,20 +2975,8 @@ var VxeTooltipComponent = defineVxeComponent({
2980
2975
  return handleVisible(target, content);
2981
2976
  },
2982
2977
  updatePlacement() {
2983
- const { visible, tipTarget } = reactData;
2984
- let el = refElem.value;
2985
- if (visible && tipTarget && el) {
2986
- updateTipStyle();
2987
- }
2988
- return nextTick().then(() => {
2989
- el = refElem.value;
2990
- if (tipTarget && el) {
2991
- updateTipStyle();
2992
- return nextTick().then(() => {
2993
- updateTipStyle();
2994
- });
2995
- }
2996
- });
2978
+ updateTipStyle();
2979
+ return nextTick().then(updateTipStyle);
2997
2980
  },
2998
2981
  isActived() {
2999
2982
  return reactData.tipActive;
@@ -3080,7 +3063,7 @@ var VxeTooltipComponent = defineVxeComponent({
3080
3063
  handleVisible(reactData.target || getSelectorEl(), props.content);
3081
3064
  }
3082
3065
  else {
3083
- tooltipMethods.close();
3066
+ $xeTooltip.close();
3084
3067
  }
3085
3068
  }
3086
3069
  reactData.isUpdate = false;
@@ -3093,21 +3076,21 @@ var VxeTooltipComponent = defineVxeComponent({
3093
3076
  }
3094
3077
  nextTick(() => {
3095
3078
  const { trigger, content } = props;
3096
- const wrapperElem = refElem.value;
3097
- if (wrapperElem) {
3098
- const parentNode = wrapperElem.parentNode;
3079
+ const panelElem = refElem.value;
3080
+ if (panelElem) {
3081
+ const parentNode = panelElem.parentNode;
3099
3082
  if (parentNode) {
3100
3083
  reactData.tipContent = content;
3101
3084
  reactData.tipZindex = nextZIndex();
3102
- XEUtils.arrayEach(wrapperElem.children, (elem, index) => {
3085
+ XEUtils.arrayEach(panelElem.children, (elem, index) => {
3103
3086
  if (index) {
3104
- parentNode.insertBefore(elem, wrapperElem);
3087
+ parentNode.insertBefore(elem, panelElem);
3105
3088
  if (!reactData.target) {
3106
3089
  reactData.target = elem;
3107
3090
  }
3108
3091
  }
3109
3092
  });
3110
- parentNode.removeChild(wrapperElem);
3093
+ parentNode.removeChild(panelElem);
3111
3094
  const { target } = reactData;
3112
3095
  if (target) {
3113
3096
  if (trigger === 'hover') {
@@ -3127,7 +3110,7 @@ var VxeTooltipComponent = defineVxeComponent({
3127
3110
  });
3128
3111
  onBeforeUnmount(() => {
3129
3112
  const { target } = reactData;
3130
- const wrapperElem = refElem.value;
3113
+ const panelElem = refElem.value;
3131
3114
  if (target) {
3132
3115
  target.onmouseenter = null;
3133
3116
  target.onmouseleave = null;
@@ -3137,10 +3120,10 @@ var VxeTooltipComponent = defineVxeComponent({
3137
3120
  if (contentWrapperfEl) {
3138
3121
  contentWrapperfEl.removeEventListener('wheel', wheelEvent);
3139
3122
  }
3140
- if (wrapperElem) {
3141
- const parentNode = wrapperElem.parentNode;
3123
+ if (panelElem) {
3124
+ const parentNode = panelElem.parentNode;
3142
3125
  if (parentNode) {
3143
- parentNode.removeChild(wrapperElem);
3126
+ parentNode.removeChild(panelElem);
3144
3127
  }
3145
3128
  }
3146
3129
  });
@@ -44403,11 +44386,11 @@ var VxeTreeComponent = defineVxeComponent({
44403
44386
  ]);
44404
44387
  };
44405
44388
  const renderList = (treeList) => {
44406
- const { transform, emptyText } = props;
44389
+ const { loading, transform, emptyText } = props;
44407
44390
  const { treeExpandedMaps } = internalData;
44408
44391
  const childrenField = computeChildrenField.value;
44409
44392
  const emptySlot = slots.empty;
44410
- if (!treeList.length) {
44393
+ if (!loading && !treeList.length) {
44411
44394
  return [
44412
44395
  h('div', {
44413
44396
  class: 'vxe-tree--empty-placeholder'