Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class RdxHoverCardAnchorDirective {
* */
protected rootDirective = injectHoverCardRoot(true);
/** @ignore */
readonly elementRef = inject(ElementRef);
readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);
/** @ignore */
readonly overlayOrigin = inject(CdkOverlayOrigin);
/** @ignore */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ export class RdxHoverCardContentDirective implements OnInit {
return this.connectedOverlay.positionChange.asObservable();
}

updatePosition() {
this.connectedOverlay.overlayRef?.updatePosition();
}

/** @ignore */
private connectKeydownEscape() {
this.connectedOverlay.overlayKeydown
Expand Down Expand Up @@ -277,7 +281,7 @@ export class RdxHoverCardContentDirective implements OnInit {
const prevPositions = this.connectedOverlay.positions;
this.connectedOverlay.positions = positions;
this.fireOverlayNgOnChanges('positions', this.connectedOverlay.positions, prevPositions);
this.connectedOverlay.overlayRef?.updatePosition();
this.updatePosition();
}

/** @ignore */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class RdxPopoverAnchorDirective {
* */
protected popoverRoot = injectPopoverRoot(true);
/** @ignore */
readonly elementRef = inject(ElementRef);
readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);
/** @ignore */
readonly overlayOrigin = inject(CdkOverlayOrigin);
/** @ignore */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ export class RdxPopoverContentDirective implements OnInit {
return this.connectedOverlay.positionChange.asObservable();
}

updatePosition() {
this.connectedOverlay.overlayRef?.updatePosition();
}

/** @ignore */
private connectKeydownEscape() {
this.connectedOverlay.overlayKeydown
Expand Down Expand Up @@ -277,7 +281,7 @@ export class RdxPopoverContentDirective implements OnInit {
const prevPositions = this.connectedOverlay.positions;
this.connectedOverlay.positions = positions;
this.fireOverlayNgOnChanges('positions', this.connectedOverlay.positions, prevPositions);
this.connectedOverlay.overlayRef?.updatePosition();
this.updatePosition();
}

/** @ignore */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class RdxTooltipAnchorDirective {
* */
protected rootDirective = injectTooltipRoot(true);
/** @ignore */
readonly elementRef = inject(ElementRef);
readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);
/** @ignore */
readonly overlayOrigin = inject(CdkOverlayOrigin);
/** @ignore */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ export class RdxTooltipContentDirective implements OnInit {
return this.connectedOverlay.positionChange.asObservable();
}

updatePosition() {
this.connectedOverlay.overlayRef?.updatePosition();
}

/** @ignore */
private connectKeydownEscape() {
this.connectedOverlay.overlayKeydown
Expand Down Expand Up @@ -277,7 +281,7 @@ export class RdxTooltipContentDirective implements OnInit {
const prevPositions = this.connectedOverlay.positions;
this.connectedOverlay.positions = positions;
this.fireOverlayNgOnChanges('positions', this.connectedOverlay.positions, prevPositions);
this.connectedOverlay.overlayRef?.updatePosition();
this.updatePosition();
}

/** @ignore */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@ export class RdxTooltipRootDirective {
.asObservable()
.pipe(
map((action) => {
console.log(action);
switch (action) {
case RdxTooltipAction.OPEN:
return { action, duration: this.openDelay() };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, viewChild } from '@angular/core';
import { Component, signal, viewChild } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { LucideAngularModule, MapPin, MapPinPlus, MountainSnow, TriangleAlert, X } from 'lucide-angular';
import { RdxTooltipModule } from '../index';
Expand All @@ -7,6 +7,7 @@ import { RdxTooltipContentAttributesComponent } from '../src/tooltip-content-att
import { provideRdxCdkEventService } from '../src/utils/cdk-event.service';
import { containerAlert } from './utils/constants';
import { OptionPanelBase } from './utils/option-panel-base.class';
import { generateRandomSentence } from './utils/rendom-sentence.util';
import styles from './utils/styles.constants';
import { WithOptionPanelComponent } from './utils/with-option-panel.component';

Expand Down Expand Up @@ -64,7 +65,7 @@ import { WithOptionPanelComponent } from './utils/with-option-panel.component';
<button class="reset TooltipClose" rdxTooltipClose aria-label="Close">
<lucide-angular [img]="XIcon" size="12" style="display: flex" />
</button>
Add to library
{{ tooltipHtml() }}
<div
class="TooltipArrow"
[width]="arrowWidth()"
Expand Down Expand Up @@ -120,7 +121,7 @@ import { WithOptionPanelComponent } from './utils/with-option-panel.component';
<button class="reset TooltipClose" rdxTooltipClose aria-label="Close">
<lucide-angular [img]="XIcon" size="12" style="display: flex" />
</button>
Add to library
{{ tooltipHtml() }}
<div
class="TooltipArrow"
[width]="arrowWidth()"
Expand All @@ -136,6 +137,8 @@ import { WithOptionPanelComponent } from './utils/with-option-panel.component';
`
})
export class RdxTooltipAnchorComponent extends OptionPanelBase {
tooltipHtml = signal(generateRandomSentence());

readonly rootDirective1 = viewChild('root1');
readonly rootDirective2 = viewChild('root2');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { RdxTooltipContentAttributesComponent } from '../src/tooltip-content-att
import { provideRdxCdkEventService } from '../src/utils/cdk-event.service';
import { containerAlert } from './utils/constants';
import { OptionPanelBase } from './utils/option-panel-base.class';
import { generateRandomSentence } from './utils/rendom-sentence.util';
import styles from './utils/styles.constants';
import { WithOptionPanelComponent } from './utils/with-option-panel.component';

Expand Down Expand Up @@ -77,7 +78,7 @@ import { WithOptionPanelComponent } from './utils/with-option-panel.component';
<button class="TooltipClose reset" rdxTooltipClose aria-label="Close">
<lucide-angular [img]="XIcon" size="16" style="display: flex" />
</button>
Add to library
{{ tooltipHtml() }}
<div
class="TooltipArrow"
[width]="arrowWidth()"
Expand All @@ -93,6 +94,8 @@ import { WithOptionPanelComponent } from './utils/with-option-panel.component';
`
})
export class RdxTooltipAnimationsComponent extends OptionPanelBase {
tooltipHtml = signal(generateRandomSentence());

readonly rootDirective = viewChild(RdxTooltipRootDirective);

readonly MountainSnowIcon = MountainSnow;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Component, viewChild } from '@angular/core';
import { Component, signal, viewChild } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { LucideAngularModule, MountainSnow, TriangleAlert, X } from 'lucide-angular';
import { RdxTooltipModule, RdxTooltipRootDirective } from '../index';
import { RdxTooltipContentAttributesComponent } from '../src/tooltip-content-attributes.component';
import { provideRdxCdkEventService } from '../src/utils/cdk-event.service';
import { containerAlert } from './utils/constants';
import { OptionPanelBase } from './utils/option-panel-base.class';
import { generateRandomSentence } from './utils/rendom-sentence.util';
import styles from './utils/styles.constants';
import { WithOptionPanelComponent } from './utils/with-option-panel.component';

Expand Down Expand Up @@ -52,7 +53,7 @@ import { WithOptionPanelComponent } from './utils/with-option-panel.component';
<button class="reset TooltipClose" rdxTooltipClose aria-label="Close">
<lucide-angular [img]="XIcon" size="12" style="display: flex" />
</button>
Add to library
{{ tooltipHtml() }}
<div
class="TooltipArrow"
[width]="arrowWidth()"
Expand All @@ -68,6 +69,8 @@ import { WithOptionPanelComponent } from './utils/with-option-panel.component';
`
})
export class RdxTooltipDefaultComponent extends OptionPanelBase {
tooltipHtml = signal(generateRandomSentence());

readonly rootDirective = viewChild(RdxTooltipRootDirective);

readonly MountainSnowIcon = MountainSnow;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, viewChild } from '@angular/core';
import { Component, signal, viewChild } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { RdxPositionAlign, RdxPositionSide } from '@radix-ng/primitives/core';
import { LucideAngularModule, MountainSnow, TriangleAlert, X } from 'lucide-angular';
Expand All @@ -7,6 +7,7 @@ import { RdxTooltipContentAttributesComponent } from '../src/tooltip-content-att
import { provideRdxCdkEventService } from '../src/utils/cdk-event.service';
import { containerAlert } from './utils/constants';
import { OptionPanelBase } from './utils/option-panel-base.class';
import { generateRandomSentence } from './utils/rendom-sentence.util';
import styles from './utils/styles.constants';
import { WithOptionPanelComponent } from './utils/with-option-panel.component';

Expand Down Expand Up @@ -56,7 +57,7 @@ import { WithOptionPanelComponent } from './utils/with-option-panel.component';
<button class="reset TooltipClose" rdxTooltipClose aria-label="Close">
<lucide-angular [img]="XIcon" size="12" style="display: flex" />
</button>
Add to library
{{ tooltipHtml() }}
<div
class="TooltipArrow"
[width]="arrowWidth()"
Expand All @@ -72,6 +73,8 @@ import { WithOptionPanelComponent } from './utils/with-option-panel.component';
`
})
export class RdxTooltipEventsComponent extends OptionPanelBase {
tooltipHtml = signal(generateRandomSentence());

readonly rootDirective = viewChild(RdxTooltipRootDirective);

readonly MountainSnowIcon = MountainSnow;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Component, viewChild } from '@angular/core';
import { Component, signal, viewChild } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { LucideAngularModule, MountainSnow, TriangleAlert, X } from 'lucide-angular';
import { RdxTooltipModule, RdxTooltipRootDirective } from '../index';
import { RdxTooltipContentAttributesComponent } from '../src/tooltip-content-attributes.component';
import { provideRdxCdkEventService } from '../src/utils/cdk-event.service';
import { containerAlert } from './utils/constants';
import { OptionPanelBase } from './utils/option-panel-base.class';
import { generateRandomSentence } from './utils/rendom-sentence.util';
import styles from './utils/styles.constants';
import { WithOptionPanelComponent } from './utils/with-option-panel.component';

Expand Down Expand Up @@ -53,7 +54,7 @@ import { WithOptionPanelComponent } from './utils/with-option-panel.component';
<button class="reset TooltipClose" rdxTooltipClose aria-label="Close">
<lucide-angular [img]="XIcon" size="12" style="display: flex" />
</button>
Add to library
{{ tooltipHtml() }}
<div
class="TooltipArrow"
[width]="arrowWidth()"
Expand All @@ -69,6 +70,8 @@ import { WithOptionPanelComponent } from './utils/with-option-panel.component';
`
})
export class RdxTooltipInitiallyOpenComponent extends OptionPanelBase {
tooltipHtml = signal(generateRandomSentence());

readonly rootDirective = viewChild(RdxTooltipRootDirective);

readonly MountainSnowIcon = MountainSnow;
Expand Down
Loading
Loading