chrv-components 1.12.132 → 1.12.134
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.
|
Binary file
|
|
@@ -4071,31 +4071,17 @@ class ChrPopoverDirective {
|
|
|
4071
4071
|
});
|
|
4072
4072
|
};
|
|
4073
4073
|
this.setupSubject = () => {
|
|
4074
|
-
combineLatest([
|
|
4075
|
-
|
|
4076
|
-
this.isTargetHovered$,
|
|
4077
|
-
this.lastKnowMousePosition,
|
|
4078
|
-
])
|
|
4079
|
-
.pipe(map(([hostHovered, targetHovered, mouse]) => hostHovered.hover ||
|
|
4074
|
+
combineLatest([this.isHostHovered$, this.isTargetHovered$])
|
|
4075
|
+
.pipe(map(([hostHovered, targetHovered]) => hostHovered.hover ||
|
|
4080
4076
|
targetHovered.hover ||
|
|
4081
|
-
this.
|
|
4082
|
-
|
|
4083
|
-
return of(true);
|
|
4084
|
-
}
|
|
4085
|
-
else {
|
|
4086
|
-
return timer(100).pipe(map(() => false));
|
|
4087
|
-
}
|
|
4088
|
-
}), takeUntilDestroyed(this.destroyRef))
|
|
4077
|
+
this.isInsideHost(hostHovered.position?.x, hostHovered.position.y) ||
|
|
4078
|
+
this.isInsideTarget(targetHovered.position?.x, targetHovered.position.y)), switchMap((isInside) => timer(100).pipe(map(() => isInside))), takeUntilDestroyed(this.destroyRef))
|
|
4089
4079
|
.subscribe((isInside) => {
|
|
4090
|
-
if (isInside) {
|
|
4091
|
-
|
|
4092
|
-
this.showPopover();
|
|
4093
|
-
}
|
|
4080
|
+
if (isInside && !this.isOpen()) {
|
|
4081
|
+
this.showPopover();
|
|
4094
4082
|
}
|
|
4095
4083
|
else {
|
|
4096
|
-
|
|
4097
|
-
this.hidePopover();
|
|
4098
|
-
}
|
|
4084
|
+
this.hidePopover();
|
|
4099
4085
|
}
|
|
4100
4086
|
});
|
|
4101
4087
|
};
|
|
@@ -4171,6 +4157,14 @@ class ChrPopoverDirective {
|
|
|
4171
4157
|
this.isInsideRect = (x, y, rect) => {
|
|
4172
4158
|
return (x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom);
|
|
4173
4159
|
};
|
|
4160
|
+
this.isInsideHost = (x, y) => {
|
|
4161
|
+
const rect = this.hostElement().getBoundingClientRect();
|
|
4162
|
+
return this.isInsideRect(x, y, rect);
|
|
4163
|
+
};
|
|
4164
|
+
this.isInsideTarget = (x, y) => {
|
|
4165
|
+
const rect = this.targetElement().getBoundingClientRect();
|
|
4166
|
+
return this.isInsideRect(x, y, rect);
|
|
4167
|
+
};
|
|
4174
4168
|
this.isPointerInsideElements = (x, y) => {
|
|
4175
4169
|
// private isPointerInsideElements = (event: MouseEvent): boolean => {
|
|
4176
4170
|
const hostRect = this.hostElement().getBoundingClientRect();
|