@alauda/ui 6.5.8 → 6.5.9-beta.0

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.
@@ -1580,9 +1580,11 @@ class BaseTooltip {
1580
1580
  this.componentIns.hide$.pipe(takeUntil(this.destroy$)).subscribe(() => {
1581
1581
  this._disposeTooltip();
1582
1582
  });
1583
- merge(this.componentIns.beforeHide$, this.componentIns.beforeShow$.pipe(delay(0)))
1584
- .pipe(takeUntil(this.destroy$))
1585
- .subscribe(this._updateTransformOrigin.bind(this));
1583
+ if (!this.disableAnimation) {
1584
+ merge(this.componentIns.beforeHide$, this.componentIns.beforeShow$.pipe(delay(0)))
1585
+ .pipe(takeUntil(this.destroy$))
1586
+ .subscribe(this._updateTransformOrigin.bind(this));
1587
+ }
1586
1588
  if (this.trigger === TooltipTrigger.Hover) {
1587
1589
  this.componentIns.hover$
1588
1590
  .pipe(takeUntil(this.componentIns.destroy$))
@@ -1627,7 +1629,13 @@ class BaseTooltip {
1627
1629
  this._createTooltip();
1628
1630
  }
1629
1631
  hide() {
1630
- this.componentIns?.hide();
1632
+ if (this.disableAnimation) {
1633
+ // 如果禁用了动画就立即销毁,而不是等动画完成事件后才销毁
1634
+ this._disposeTooltip();
1635
+ }
1636
+ else {
1637
+ this.componentIns?.hide();
1638
+ }
1631
1639
  }
1632
1640
  updatePosition() {
1633
1641
  if (this.overlayRef) {
@@ -1699,7 +1707,7 @@ class BaseTooltip {
1699
1707
  this.hostHovered = false;
1700
1708
  await sleep(HIDDEN_DELAY);
1701
1709
  if (!this.tooltipHovered && !this.hostHovered) {
1702
- this.componentIns?.hide();
1710
+ this.hide();
1703
1711
  }
1704
1712
  }
1705
1713
  async onTooltipHovered(hovered) {
@@ -1707,7 +1715,7 @@ class BaseTooltip {
1707
1715
  if (!hovered) {
1708
1716
  await sleep(HIDDEN_DELAY);
1709
1717
  if (!this.tooltipHovered && !this.hostHovered) {
1710
- this.componentIns?.hide();
1718
+ this.hide();
1711
1719
  }
1712
1720
  }
1713
1721
  }
@@ -1718,14 +1726,14 @@ class BaseTooltip {
1718
1726
  if (!this.elRef.nativeElement.contains(event.target) &&
1719
1727
  (this.hideOnClick ||
1720
1728
  !this.componentIns.elRef.nativeElement.contains(event.target))) {
1721
- this.componentIns?.hide();
1729
+ this.hide();
1722
1730
  }
1723
1731
  }
1724
1732
  onFocus() {
1725
1733
  this._createTooltip();
1726
1734
  }
1727
1735
  onBlur() {
1728
- this.componentIns?.hide();
1736
+ this.hide();
1729
1737
  }
1730
1738
  }
1731
1739
  BaseTooltip.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: BaseTooltip, deps: [{ token: i1$2.Overlay }, { token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
@@ -10948,6 +10956,12 @@ class TabHeaderComponent {
10948
10956
  this._destroyed.next();
10949
10957
  this._destroyed.complete();
10950
10958
  }
10959
+ ngAfterViewInit() {
10960
+ // 等ngAfterContentInit的_updatePagination执行后再滚动,因为Pagination会影响布局
10961
+ requestAnimationFrame(() => {
10962
+ this._scrollToLabel(this._selectedIndex);
10963
+ });
10964
+ }
10951
10965
  ngAfterContentChecked() {
10952
10966
  // If the number of tab labels have changed, check if scrolling should be enabled
10953
10967
  if (this._tabLabelCount !== this._labelWrappers.length) {