@douyinfe/semi-ui 2.36.1-alpha.0 → 2.36.1-alpha.2

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.
@@ -18667,6 +18667,7 @@ class foundation_Tooltip extends foundation {
18667
18667
  return null;
18668
18668
  }
18669
18669
  calcPosStyle(props) {
18670
+ var _a, _b, _c;
18670
18671
  const {
18671
18672
  spacing,
18672
18673
  isOverFlow
@@ -18680,7 +18681,7 @@ class foundation_Tooltip extends foundation {
18680
18681
  // eslint-disable-next-line
18681
18682
  const position = props.position != null ? props.position : this.getProp('position');
18682
18683
  // eslint-disable-next-line
18683
- const SPACING = spacing != null ? spacing : this.getProp('spacing');
18684
+ let SPACING = spacing != null ? spacing : this.getProp('spacing');
18684
18685
  const {
18685
18686
  arrowPointAtCenter,
18686
18687
  showArrow,
@@ -18711,6 +18712,10 @@ class foundation_Tooltip extends foundation {
18711
18712
  const isTriggerNearLeft = middleX - containerRect.left < containerRect.right - middleX;
18712
18713
  const isTriggerNearTop = middleY - containerRect.top < containerRect.bottom - middleY;
18713
18714
  const isWrapperWidthOverflow = wrapperRect.width > innerWidth;
18715
+ const scaled = Math.abs((wrapperRect === null || wrapperRect === void 0 ? void 0 : wrapperRect.width) - ((_a = this._adapter.getContainer()) === null || _a === void 0 ? void 0 : _a.clientWidth)) > 1;
18716
+ if (scaled) {
18717
+ SPACING = SPACING * wrapperRect.width / this._adapter.getContainer().clientWidth;
18718
+ }
18714
18719
  switch (position) {
18715
18720
  case 'top':
18716
18721
  // left = middleX;
@@ -18827,6 +18832,12 @@ class foundation_Tooltip extends foundation {
18827
18832
  // Calculate container positioning relative to window
18828
18833
  left = left - containerRect.left;
18829
18834
  top = top - containerRect.top;
18835
+ if (Math.abs((wrapperRect === null || wrapperRect === void 0 ? void 0 : wrapperRect.width) - ((_b = this._adapter.getContainer()) === null || _b === void 0 ? void 0 : _b.clientWidth)) > 1) {
18836
+ left /= wrapperRect.width / this._adapter.getContainer().clientWidth;
18837
+ }
18838
+ if (Math.abs((wrapperRect === null || wrapperRect === void 0 ? void 0 : wrapperRect.height) - ((_c = this._adapter.getContainer()) === null || _c === void 0 ? void 0 : _c.clientHeight)) > 1) {
18839
+ top /= wrapperRect.height / this._adapter.getContainer().clientHeight;
18840
+ }
18830
18841
  /**
18831
18842
  * container为body时,如果position不为relative或absolute,这时trigger计算出的top/left会根据html定位(initial containing block)
18832
18843
  * 此时如果body有margin,则计算出的位置相对于body会有问题 fix issue #1368