chrv-components 1.12.136 → 1.12.138
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
|
|
@@ -10,8 +10,8 @@ import { CommonModule, AsyncPipe, DatePipe, formatDate, DATE_PIPE_DEFAULT_OPTION
|
|
|
10
10
|
import * as i1$3 from '@angular/cdk/overlay';
|
|
11
11
|
import { Overlay, CdkOverlayOrigin, CdkConnectedOverlay, CdkScrollable, CDK_CONNECTED_OVERLAY_DEFAULT_CONFIG } from '@angular/cdk/overlay';
|
|
12
12
|
import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
|
|
13
|
-
import { Subject, Observable, map, BehaviorSubject, skip, debounceTime as debounceTime$1, distinctUntilChanged, skipWhile, from, mergeMap, toArray, timer, takeUntil as takeUntil$1, of, catchError, forkJoin, take, combineLatest,
|
|
14
|
-
import { debounceTime, takeUntil, finalize as finalize$1, concatMap, switchMap
|
|
13
|
+
import { Subject, Observable, map, BehaviorSubject, skip, debounceTime as debounceTime$1, distinctUntilChanged, skipWhile, from, mergeMap, toArray, timer, takeUntil as takeUntil$1, of, catchError, forkJoin, take, combineLatest, finalize, tap, interval } from 'rxjs';
|
|
14
|
+
import { debounceTime, takeUntil, finalize as finalize$1, concatMap, switchMap, tap as tap$1, catchError as catchError$1 } from 'rxjs/operators';
|
|
15
15
|
import * as i1$2 from '@angular/forms';
|
|
16
16
|
import { NG_VALIDATORS, Validators, NgControl, ReactiveFormsModule, FormsModule, FormBuilder, FormControl } from '@angular/forms';
|
|
17
17
|
import { isValid, isBefore, formatDate as formatDate$1 } from 'date-fns';
|
|
@@ -4020,13 +4020,11 @@ class ChrPopoverDirective {
|
|
|
4020
4020
|
this.viewContainerRef = inject(ViewContainerRef);
|
|
4021
4021
|
this.hostElement = computed(() => this.hostElementRef.nativeElement, /* @ts-ignore */
|
|
4022
4022
|
...(ngDevMode ? [{ debugName: "hostElement" }] : /* istanbul ignore next */ []));
|
|
4023
|
-
this.isHostHovered$ = new BehaviorSubject(
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
hover: false,
|
|
4029
|
-
position: { x: 0, y: 0 },
|
|
4023
|
+
this.isHostHovered$ = new BehaviorSubject(false);
|
|
4024
|
+
this.isTargetHovered$ = new BehaviorSubject(false);
|
|
4025
|
+
this.lastKnowMousePosition$ = new BehaviorSubject({
|
|
4026
|
+
x: 0,
|
|
4027
|
+
y: 0,
|
|
4030
4028
|
});
|
|
4031
4029
|
// private readonly isInsidePopover$ = new BehaviorSubject<boolean>(false);
|
|
4032
4030
|
this.destroyRef = inject(DestroyRef);
|
|
@@ -4076,11 +4074,16 @@ class ChrPopoverDirective {
|
|
|
4076
4074
|
// });
|
|
4077
4075
|
// };
|
|
4078
4076
|
this.setupSubject = () => {
|
|
4079
|
-
combineLatest([
|
|
4080
|
-
.
|
|
4081
|
-
|
|
4082
|
-
this.
|
|
4083
|
-
|
|
4077
|
+
combineLatest([
|
|
4078
|
+
this.isHostHovered$,
|
|
4079
|
+
this.isTargetHovered$,
|
|
4080
|
+
this.lastKnowMousePosition$,
|
|
4081
|
+
])
|
|
4082
|
+
.pipe(debounceTime$1(100), map(([hostHovered, targetHovered, position]) => hostHovered ||
|
|
4083
|
+
targetHovered ||
|
|
4084
|
+
this.isInsideHost(position.x, position.y)),
|
|
4085
|
+
// switchMap((isInside) => timer(100).pipe(map(() => isInside))),
|
|
4086
|
+
takeUntilDestroyed(this.destroyRef))
|
|
4084
4087
|
.subscribe((isInside) => {
|
|
4085
4088
|
if (isInside && !this.isOpen()) {
|
|
4086
4089
|
this.showPopover();
|
|
@@ -4093,10 +4096,15 @@ class ChrPopoverDirective {
|
|
|
4093
4096
|
this.setupHostListeners = () => {
|
|
4094
4097
|
this.renderer.listen(this.hostElement(), 'mouseenter', (event) => {
|
|
4095
4098
|
// this.isInsidePopover$.next(true);
|
|
4096
|
-
this.isHostHovered$.next({
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
+
// this.isHostHovered$.next({
|
|
4100
|
+
// hover: true,
|
|
4101
|
+
// position: { x: event.clientX, y: event.clientY },
|
|
4102
|
+
// });
|
|
4103
|
+
this.lastKnowMousePosition$.next({
|
|
4104
|
+
x: event.clientX,
|
|
4105
|
+
y: event.clientY,
|
|
4099
4106
|
});
|
|
4107
|
+
this.isHostHovered$.next(true);
|
|
4100
4108
|
// if (!this.isOpen()) {
|
|
4101
4109
|
// this.showPopover();
|
|
4102
4110
|
// }
|
|
@@ -4112,20 +4120,30 @@ class ChrPopoverDirective {
|
|
|
4112
4120
|
// if (this.isPointerInsideElements(event)) {
|
|
4113
4121
|
// return;
|
|
4114
4122
|
// }
|
|
4115
|
-
this.isHostHovered$.next({
|
|
4116
|
-
|
|
4117
|
-
|
|
4123
|
+
// this.isHostHovered$.next({
|
|
4124
|
+
// hover: false,
|
|
4125
|
+
// position: { x: event.clientX, y: event.clientY },
|
|
4126
|
+
// });
|
|
4127
|
+
this.lastKnowMousePosition$.next({
|
|
4128
|
+
x: event.clientX,
|
|
4129
|
+
y: event.clientY,
|
|
4118
4130
|
});
|
|
4131
|
+
this.isHostHovered$.next(false);
|
|
4119
4132
|
});
|
|
4120
4133
|
};
|
|
4121
4134
|
this.setupTargetListeners = () => {
|
|
4122
4135
|
this.renderer.listen(this.targetElement(), 'mouseenter', (event) => {
|
|
4123
4136
|
// this.isInsideTarget.set(true);
|
|
4124
4137
|
// this.shopPopover();
|
|
4125
|
-
this.isTargetHovered$.next({
|
|
4126
|
-
|
|
4127
|
-
|
|
4138
|
+
// this.isTargetHovered$.next({
|
|
4139
|
+
// hover: true,
|
|
4140
|
+
// position: { x: event.clientX, y: event.clientY },
|
|
4141
|
+
// });
|
|
4142
|
+
this.lastKnowMousePosition$.next({
|
|
4143
|
+
x: event.clientX,
|
|
4144
|
+
y: event.clientY,
|
|
4128
4145
|
});
|
|
4146
|
+
this.isTargetHovered$.next(true);
|
|
4129
4147
|
// this.isInsidePopover$.next(true);
|
|
4130
4148
|
});
|
|
4131
4149
|
this.renderer.listen(this.targetElement(), 'mouseleave', (event) => {
|
|
@@ -4134,10 +4152,15 @@ class ChrPopoverDirective {
|
|
|
4134
4152
|
// if (this.isPointerInsideElements(event)) {
|
|
4135
4153
|
// return;
|
|
4136
4154
|
// }
|
|
4137
|
-
this.isTargetHovered$.next({
|
|
4138
|
-
|
|
4139
|
-
|
|
4155
|
+
// this.isTargetHovered$.next({
|
|
4156
|
+
// hover: false,
|
|
4157
|
+
// position: { x: event.clientX, y: event.clientY },
|
|
4158
|
+
// });
|
|
4159
|
+
this.lastKnowMousePosition$.next({
|
|
4160
|
+
x: event.clientX,
|
|
4161
|
+
y: event.clientY,
|
|
4140
4162
|
});
|
|
4163
|
+
this.isTargetHovered$.next(false);
|
|
4141
4164
|
// setTimeout(() => {
|
|
4142
4165
|
// if (!this.isInsideHost() && !this.isInsideTargetBoundingBox(event))
|
|
4143
4166
|
// this.hidePopover();
|
|
@@ -5478,7 +5501,7 @@ class LegacyToastService {
|
|
|
5478
5501
|
this.currentToastSubject.next(null);
|
|
5479
5502
|
}),
|
|
5480
5503
|
//Small delay between toasts
|
|
5481
|
-
switchMap
|
|
5504
|
+
switchMap(() => timer(500)));
|
|
5482
5505
|
}))
|
|
5483
5506
|
.subscribe();
|
|
5484
5507
|
}
|