chrv-components 1.12.141 → 1.12.143
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
|
|
@@ -4023,8 +4023,8 @@ class ChrPopoverDirective {
|
|
|
4023
4023
|
this.isHostHovered$ = new BehaviorSubject(false);
|
|
4024
4024
|
this.isTargetHovered$ = new BehaviorSubject(false);
|
|
4025
4025
|
this.lastKnownMousePosition$ = new BehaviorSubject({
|
|
4026
|
-
x:
|
|
4027
|
-
y:
|
|
4026
|
+
x: -1,
|
|
4027
|
+
y: -1,
|
|
4028
4028
|
});
|
|
4029
4029
|
// private readonly isInsidePopover$ = new BehaviorSubject<boolean>(false);
|
|
4030
4030
|
this.destroyRef = inject(DestroyRef);
|
|
@@ -4052,6 +4052,12 @@ class ChrPopoverDirective {
|
|
|
4052
4052
|
return mayBeTemplate;
|
|
4053
4053
|
}, /* @ts-ignore */
|
|
4054
4054
|
...(ngDevMode ? [{ debugName: "targetElementId" }] : /* istanbul ignore next */ []));
|
|
4055
|
+
this.updateLastKnownMousePosition = (event) => {
|
|
4056
|
+
this.lastKnownMousePosition$.next({
|
|
4057
|
+
x: event.clientX,
|
|
4058
|
+
y: event.clientY,
|
|
4059
|
+
});
|
|
4060
|
+
};
|
|
4055
4061
|
// private isInsideHostBoundingBox = (event: MouseEvent) => {
|
|
4056
4062
|
// const hostRect = this.hostElement().getBoundingClientRect();
|
|
4057
4063
|
// return this.isInsideRect(event, hostRect);
|
|
@@ -4082,12 +4088,12 @@ class ChrPopoverDirective {
|
|
|
4082
4088
|
.pipe(map(([hostHovered, targetHovered, position]) => hostHovered ||
|
|
4083
4089
|
targetHovered ||
|
|
4084
4090
|
this.isInsideHost(position.x, position.y) ||
|
|
4085
|
-
this.isInsideTarget(position.x, position.y)), distinctUntilChanged(), takeUntilDestroyed(this.destroyRef))
|
|
4091
|
+
this.isInsideTarget(position.x, position.y)), distinctUntilChanged(), debounceTime$1(100), takeUntilDestroyed(this.destroyRef))
|
|
4086
4092
|
.subscribe((isInside) => {
|
|
4087
4093
|
if (isInside && !this.isOpen()) {
|
|
4088
4094
|
this.showPopover();
|
|
4089
4095
|
}
|
|
4090
|
-
else {
|
|
4096
|
+
else if (this.isOpen()) {
|
|
4091
4097
|
this.hidePopover();
|
|
4092
4098
|
}
|
|
4093
4099
|
});
|
|
@@ -4099,10 +4105,10 @@ class ChrPopoverDirective {
|
|
|
4099
4105
|
// hover: true,
|
|
4100
4106
|
// position: { x: event.clientX, y: event.clientY },
|
|
4101
4107
|
// });
|
|
4102
|
-
this.lastKnownMousePosition$.next({
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
});
|
|
4108
|
+
// this.lastKnownMousePosition$.next({
|
|
4109
|
+
// x: event.clientX,
|
|
4110
|
+
// y: event.clientY,
|
|
4111
|
+
// });
|
|
4106
4112
|
this.isHostHovered$.next(true);
|
|
4107
4113
|
// if (!this.isOpen()) {
|
|
4108
4114
|
// this.showPopover();
|
|
@@ -4123,10 +4129,10 @@ class ChrPopoverDirective {
|
|
|
4123
4129
|
// hover: false,
|
|
4124
4130
|
// position: { x: event.clientX, y: event.clientY },
|
|
4125
4131
|
// });
|
|
4126
|
-
this.lastKnownMousePosition$.next({
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
});
|
|
4132
|
+
// this.lastKnownMousePosition$.next({
|
|
4133
|
+
// x: event.clientX,
|
|
4134
|
+
// y: event.clientY,
|
|
4135
|
+
// });
|
|
4130
4136
|
this.isHostHovered$.next(false);
|
|
4131
4137
|
});
|
|
4132
4138
|
};
|
|
@@ -4138,10 +4144,10 @@ class ChrPopoverDirective {
|
|
|
4138
4144
|
// hover: true,
|
|
4139
4145
|
// position: { x: event.clientX, y: event.clientY },
|
|
4140
4146
|
// });
|
|
4141
|
-
this.lastKnownMousePosition$.next({
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
});
|
|
4147
|
+
// this.lastKnownMousePosition$.next({
|
|
4148
|
+
// x: event.clientX,
|
|
4149
|
+
// y: event.clientY,
|
|
4150
|
+
// });
|
|
4145
4151
|
this.isTargetHovered$.next(true);
|
|
4146
4152
|
// this.isInsidePopover$.next(true);
|
|
4147
4153
|
});
|
|
@@ -4155,10 +4161,10 @@ class ChrPopoverDirective {
|
|
|
4155
4161
|
// hover: false,
|
|
4156
4162
|
// position: { x: event.clientX, y: event.clientY },
|
|
4157
4163
|
// });
|
|
4158
|
-
this.lastKnownMousePosition$.next({
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
});
|
|
4164
|
+
// this.lastKnownMousePosition$.next({
|
|
4165
|
+
// x: event.clientX,
|
|
4166
|
+
// y: event.clientY,
|
|
4167
|
+
// });
|
|
4162
4168
|
this.isTargetHovered$.next(false);
|
|
4163
4169
|
// setTimeout(() => {
|
|
4164
4170
|
// if (!this.isInsideHost() && !this.isInsideTargetBoundingBox(event))
|
|
@@ -4185,10 +4191,14 @@ class ChrPopoverDirective {
|
|
|
4185
4191
|
return (x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom);
|
|
4186
4192
|
};
|
|
4187
4193
|
this.isInsideHost = (x, y) => {
|
|
4194
|
+
if (x < 0 || y < 0)
|
|
4195
|
+
return false;
|
|
4188
4196
|
const rect = this.hostElement().getBoundingClientRect();
|
|
4189
4197
|
return this.isInsideRect(x, y, rect);
|
|
4190
4198
|
};
|
|
4191
4199
|
this.isInsideTarget = (x, y) => {
|
|
4200
|
+
if (x < 0 || y < 0)
|
|
4201
|
+
return false;
|
|
4192
4202
|
const rect = this.targetElement().getBoundingClientRect();
|
|
4193
4203
|
return this.isInsideRect(x, y, rect);
|
|
4194
4204
|
};
|
|
@@ -4229,7 +4239,7 @@ class ChrPopoverDirective {
|
|
|
4229
4239
|
this.renderer.setStyle(this.targetElement(), 'border', 'none');
|
|
4230
4240
|
}
|
|
4231
4241
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ChrPopoverDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4232
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.8", type: ChrPopoverDirective, isStandalone: true, selector: "[chrPopover]", inputs: { chrPopover: { classPropertyName: "chrPopover", publicName: "chrPopover", isSignal: true, isRequired: true, transformFunction: null }, chrPopoverPosition: { classPropertyName: "chrPopoverPosition", publicName: "chrPopoverPosition", isSignal: true, isRequired: false, transformFunction: null }, chrPopoverData: { classPropertyName: "chrPopoverData", publicName: "chrPopoverData", isSignal: true, isRequired: false, transformFunction: null }, chrPopoverOnHover: { classPropertyName: "chrPopoverOnHover", publicName: "chrPopoverOnHover", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keyup.escape": "hidePopover()" } }, ngImport: i0 }); }
|
|
4242
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.8", type: ChrPopoverDirective, isStandalone: true, selector: "[chrPopover]", inputs: { chrPopover: { classPropertyName: "chrPopover", publicName: "chrPopover", isSignal: true, isRequired: true, transformFunction: null }, chrPopoverPosition: { classPropertyName: "chrPopoverPosition", publicName: "chrPopoverPosition", isSignal: true, isRequired: false, transformFunction: null }, chrPopoverData: { classPropertyName: "chrPopoverData", publicName: "chrPopoverData", isSignal: true, isRequired: false, transformFunction: null }, chrPopoverOnHover: { classPropertyName: "chrPopoverOnHover", publicName: "chrPopoverOnHover", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keyup.escape": "hidePopover()", "document:mousemove": "updateLastKnownMousePosition($event)" } }, ngImport: i0 }); }
|
|
4233
4243
|
}
|
|
4234
4244
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ChrPopoverDirective, decorators: [{
|
|
4235
4245
|
type: Directive,
|
|
@@ -4237,6 +4247,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
4237
4247
|
selector: '[chrPopover]',
|
|
4238
4248
|
host: {
|
|
4239
4249
|
'(keyup.escape)': 'hidePopover()',
|
|
4250
|
+
'(document:mousemove)': 'updateLastKnownMousePosition($event)',
|
|
4240
4251
|
},
|
|
4241
4252
|
}]
|
|
4242
4253
|
}], propDecorators: { chrPopover: [{ type: i0.Input, args: [{ isSignal: true, alias: "chrPopover", required: true }] }], chrPopoverPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "chrPopoverPosition", required: false }] }], chrPopoverData: [{ type: i0.Input, args: [{ isSignal: true, alias: "chrPopoverData", required: false }] }], chrPopoverOnHover: [{ type: i0.Input, args: [{ isSignal: true, alias: "chrPopoverOnHover", required: false }] }] } });
|