From a821c62c5a438ff24282230376b18cd0bfdbfc19 Mon Sep 17 00:00:00 2001 From: yuhengzhouz <106374751+yuhengzhouz@users.noreply.github.com> Date: Sat, 18 Nov 2023 06:36:46 -0600 Subject: [PATCH] feat(module:tooltip,popover,popconfirm): make cdkConnectedOverlayPush open for tooltip (#8166) Co-authored-by: YuhengZhou --- components/popconfirm/popconfirm.ts | 2 +- components/popover/popover.ts | 2 +- components/tooltip/base.ts | 3 +++ components/tooltip/tooltip.ts | 3 ++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/components/popconfirm/popconfirm.ts b/components/popconfirm/popconfirm.ts index 131fb2b4c8..73e591dcdb 100644 --- a/components/popconfirm/popconfirm.ts +++ b/components/popconfirm/popconfirm.ts @@ -147,7 +147,7 @@ export class NzPopconfirmDirective extends NzTooltipBaseDirective { (positionChange)="onPositionChange($event)" [cdkConnectedOverlayPositions]="_positions" [cdkConnectedOverlayOpen]="_visible" - [cdkConnectedOverlayPush]="true" + [cdkConnectedOverlayPush]="cdkConnectedOverlayPush" [nzArrowPointAtCenter]="nzArrowPointAtCenter" >
(); /** @@ -272,6 +273,7 @@ export abstract class NzTooltipBaseDirective implements OnChanges, OnDestroy, Af overlayClassName: ['nzOverlayClassName', () => this._overlayClassName], overlayStyle: ['nzOverlayStyle', () => this._overlayStyle], arrowPointAtCenter: ['nzArrowPointAtCenter', () => this.arrowPointAtCenter], + cdkConnectedOverlayPush: ['cdkConnectedOverlayPush', () => this.cdkConnectedOverlayPush], ...this.getProxyPropertyMap() }; @@ -342,6 +344,7 @@ export abstract class NzTooltipBaseComponent implements OnDestroy, OnInit { nzBackdrop = false; nzMouseEnterDelay?: number; nzMouseLeaveDelay?: number; + cdkConnectedOverlayPush?: boolean = true; nzVisibleChange = new Subject(); diff --git a/components/tooltip/tooltip.ts b/components/tooltip/tooltip.ts index 47b53fe9dc..a145b7ce53 100644 --- a/components/tooltip/tooltip.ts +++ b/components/tooltip/tooltip.ts @@ -58,6 +58,7 @@ export class NzTooltipDirective extends NzTooltipBaseDirective { @Input('nzTooltipOverlayClassName') override overlayClassName?: string; @Input('nzTooltipOverlayStyle') override overlayStyle?: NgStyleInterface; @Input('nzTooltipArrowPointAtCenter') @InputBoolean() override arrowPointAtCenter?: boolean; + @Input() @InputBoolean() override cdkConnectedOverlayPush?: boolean = true; @Input() nzTooltipColor?: string; // eslint-disable-next-line @angular-eslint/no-output-rename @@ -98,7 +99,7 @@ export class NzTooltipDirective extends NzTooltipBaseDirective { [cdkConnectedOverlayOrigin]="origin" [cdkConnectedOverlayOpen]="_visible" [cdkConnectedOverlayPositions]="_positions" - [cdkConnectedOverlayPush]="true" + [cdkConnectedOverlayPush]="cdkConnectedOverlayPush" [nzArrowPointAtCenter]="nzArrowPointAtCenter" (overlayOutsideClick)="onClickOutside($event)" (detach)="hide()"