@klippa/ngx-enhancy-forms 14.22.11 → 14.22.12
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.
- package/esm2020/lib/form/form-element/form-element.component.mjs +26 -5
- package/fesm2015/klippa-ngx-enhancy-forms.mjs +25 -4
- package/fesm2015/klippa-ngx-enhancy-forms.mjs.map +1 -1
- package/fesm2020/klippa-ngx-enhancy-forms.mjs +25 -4
- package/fesm2020/klippa-ngx-enhancy-forms.mjs.map +1 -1
- package/lib/form/form-element/form-element.component.d.ts +1 -0
- package/package.json +1 -1
|
@@ -597,7 +597,6 @@ class FormElementComponent {
|
|
|
597
597
|
if (isValueSet(subscription)) {
|
|
598
598
|
this.subscriptions.push(subscription);
|
|
599
599
|
}
|
|
600
|
-
[...getAllLimitingContainers(this.elRef.nativeElement), window].forEach(e => e.addEventListener('scroll', this.setErrorTooltipOffset));
|
|
601
600
|
}
|
|
602
601
|
shouldShowErrorMessages() {
|
|
603
602
|
return this.parent?.showErrorMessages !== false;
|
|
@@ -618,15 +617,33 @@ class FormElementComponent {
|
|
|
618
617
|
this.determinePopupState();
|
|
619
618
|
}
|
|
620
619
|
determinePopupState() {
|
|
620
|
+
const prevState = this.popupState;
|
|
621
621
|
if (stringIsSetAndFilled(this.getErrorToShow())) {
|
|
622
622
|
this.popupState = 'onHover';
|
|
623
|
-
return;
|
|
624
623
|
}
|
|
625
|
-
if (isValueSet(this.getWarningToShow())) {
|
|
624
|
+
else if (isValueSet(this.getWarningToShow())) {
|
|
626
625
|
this.popupState = 'lockedOpen';
|
|
626
|
+
}
|
|
627
|
+
else {
|
|
628
|
+
this.popupState = 'onHover';
|
|
629
|
+
}
|
|
630
|
+
this.setUpErrorTooltipListeners(prevState, this.popupState);
|
|
631
|
+
}
|
|
632
|
+
setUpErrorTooltipListeners(prev, current) {
|
|
633
|
+
if (prev === current) {
|
|
627
634
|
return;
|
|
628
635
|
}
|
|
629
|
-
this.
|
|
636
|
+
const containers = [...getAllLimitingContainers(this.elRef.nativeElement), window];
|
|
637
|
+
if (current === 'lockedOpen') {
|
|
638
|
+
containers.forEach(e => {
|
|
639
|
+
e.addEventListener('scroll', this.setErrorTooltipOffset);
|
|
640
|
+
});
|
|
641
|
+
}
|
|
642
|
+
else {
|
|
643
|
+
containers.forEach(e => {
|
|
644
|
+
e.removeEventListener('scroll', this.setErrorTooltipOffset);
|
|
645
|
+
});
|
|
646
|
+
}
|
|
630
647
|
}
|
|
631
648
|
unregisterControl(formControl) {
|
|
632
649
|
this.attachedControl = null;
|
|
@@ -741,7 +758,9 @@ class FormElementComponent {
|
|
|
741
758
|
return isValueSet(this.getWarningToShow());
|
|
742
759
|
}
|
|
743
760
|
closePopup() {
|
|
761
|
+
const prevState = this.popupState;
|
|
744
762
|
this.popupState = 'onHover';
|
|
763
|
+
this.setUpErrorTooltipListeners(prevState, this.popupState);
|
|
745
764
|
}
|
|
746
765
|
togglePopup() {
|
|
747
766
|
if (!this.errorMessageAsTooltip && !this.hasRightOfCaptionError()) {
|
|
@@ -750,12 +769,14 @@ class FormElementComponent {
|
|
|
750
769
|
if (this.errorFullyVisible) {
|
|
751
770
|
return;
|
|
752
771
|
}
|
|
772
|
+
const prevState = this.popupState;
|
|
753
773
|
if (this.popupState === 'lockedOpen') {
|
|
754
774
|
this.popupState = 'onHover';
|
|
755
775
|
}
|
|
756
776
|
else {
|
|
757
777
|
this.popupState = 'lockedOpen';
|
|
758
778
|
}
|
|
779
|
+
this.setUpErrorTooltipListeners(prevState, this.popupState);
|
|
759
780
|
}
|
|
760
781
|
ngOnDestroy() {
|
|
761
782
|
this.subscriptions.forEach(e => e.unsubscribe());
|