chrv-components 1.12.137 → 1.12.139
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.lastKnownMousePosition$ = 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,17 @@ 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.lastKnownMousePosition$,
|
|
4081
|
+
])
|
|
4082
|
+
.pipe(map(([hostHovered, targetHovered, position]) => hostHovered ||
|
|
4083
|
+
targetHovered ||
|
|
4084
|
+
this.isInsideHost(position.x, position.y) ||
|
|
4085
|
+
this.isInsideTarget(position.x, position.y)), debounceTime$1(100),
|
|
4086
|
+
// switchMap((isInside) => timer(100).pipe(map(() => isInside))),
|
|
4087
|
+
takeUntilDestroyed(this.destroyRef))
|
|
4084
4088
|
.subscribe((isInside) => {
|
|
4085
4089
|
if (isInside && !this.isOpen()) {
|
|
4086
4090
|
this.showPopover();
|
|
@@ -4093,10 +4097,15 @@ class ChrPopoverDirective {
|
|
|
4093
4097
|
this.setupHostListeners = () => {
|
|
4094
4098
|
this.renderer.listen(this.hostElement(), 'mouseenter', (event) => {
|
|
4095
4099
|
// this.isInsidePopover$.next(true);
|
|
4096
|
-
this.isHostHovered$.next({
|
|
4097
|
-
|
|
4098
|
-
|
|
4100
|
+
// this.isHostHovered$.next({
|
|
4101
|
+
// hover: true,
|
|
4102
|
+
// position: { x: event.clientX, y: event.clientY },
|
|
4103
|
+
// });
|
|
4104
|
+
this.lastKnownMousePosition$.next({
|
|
4105
|
+
x: event.clientX,
|
|
4106
|
+
y: event.clientY,
|
|
4099
4107
|
});
|
|
4108
|
+
this.isHostHovered$.next(true);
|
|
4100
4109
|
// if (!this.isOpen()) {
|
|
4101
4110
|
// this.showPopover();
|
|
4102
4111
|
// }
|
|
@@ -4112,20 +4121,30 @@ class ChrPopoverDirective {
|
|
|
4112
4121
|
// if (this.isPointerInsideElements(event)) {
|
|
4113
4122
|
// return;
|
|
4114
4123
|
// }
|
|
4115
|
-
this.isHostHovered$.next({
|
|
4116
|
-
|
|
4117
|
-
|
|
4124
|
+
// this.isHostHovered$.next({
|
|
4125
|
+
// hover: false,
|
|
4126
|
+
// position: { x: event.clientX, y: event.clientY },
|
|
4127
|
+
// });
|
|
4128
|
+
this.lastKnownMousePosition$.next({
|
|
4129
|
+
x: event.clientX,
|
|
4130
|
+
y: event.clientY,
|
|
4118
4131
|
});
|
|
4132
|
+
this.isHostHovered$.next(false);
|
|
4119
4133
|
});
|
|
4120
4134
|
};
|
|
4121
4135
|
this.setupTargetListeners = () => {
|
|
4122
4136
|
this.renderer.listen(this.targetElement(), 'mouseenter', (event) => {
|
|
4123
4137
|
// this.isInsideTarget.set(true);
|
|
4124
4138
|
// this.shopPopover();
|
|
4125
|
-
this.isTargetHovered$.next({
|
|
4126
|
-
|
|
4127
|
-
|
|
4139
|
+
// this.isTargetHovered$.next({
|
|
4140
|
+
// hover: true,
|
|
4141
|
+
// position: { x: event.clientX, y: event.clientY },
|
|
4142
|
+
// });
|
|
4143
|
+
this.lastKnownMousePosition$.next({
|
|
4144
|
+
x: event.clientX,
|
|
4145
|
+
y: event.clientY,
|
|
4128
4146
|
});
|
|
4147
|
+
this.isTargetHovered$.next(true);
|
|
4129
4148
|
// this.isInsidePopover$.next(true);
|
|
4130
4149
|
});
|
|
4131
4150
|
this.renderer.listen(this.targetElement(), 'mouseleave', (event) => {
|
|
@@ -4134,10 +4153,15 @@ class ChrPopoverDirective {
|
|
|
4134
4153
|
// if (this.isPointerInsideElements(event)) {
|
|
4135
4154
|
// return;
|
|
4136
4155
|
// }
|
|
4137
|
-
this.isTargetHovered$.next({
|
|
4138
|
-
|
|
4139
|
-
|
|
4156
|
+
// this.isTargetHovered$.next({
|
|
4157
|
+
// hover: false,
|
|
4158
|
+
// position: { x: event.clientX, y: event.clientY },
|
|
4159
|
+
// });
|
|
4160
|
+
this.lastKnownMousePosition$.next({
|
|
4161
|
+
x: event.clientX,
|
|
4162
|
+
y: event.clientY,
|
|
4140
4163
|
});
|
|
4164
|
+
this.isTargetHovered$.next(false);
|
|
4141
4165
|
// setTimeout(() => {
|
|
4142
4166
|
// if (!this.isInsideHost() && !this.isInsideTargetBoundingBox(event))
|
|
4143
4167
|
// this.hidePopover();
|
|
@@ -5478,7 +5502,7 @@ class LegacyToastService {
|
|
|
5478
5502
|
this.currentToastSubject.next(null);
|
|
5479
5503
|
}),
|
|
5480
5504
|
//Small delay between toasts
|
|
5481
|
-
switchMap
|
|
5505
|
+
switchMap(() => timer(500)));
|
|
5482
5506
|
}))
|
|
5483
5507
|
.subscribe();
|
|
5484
5508
|
}
|