@dev-tcloud/tcloud-ui 5.3.5-beta.1 → 5.3.5-beta.3
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.
|
@@ -4656,11 +4656,6 @@ class TCloudUiTooltipDirective {
|
|
|
4656
4656
|
if (tooltip) {
|
|
4657
4657
|
this.info_text = typeof tooltip === 'object' ? '' : tooltip;
|
|
4658
4658
|
if (this.tooltipVisible && this.tooltipElement) {
|
|
4659
|
-
// Se não há texto válido, remove o tooltip
|
|
4660
|
-
if (!this.isValidTooltipText(this.info_text)) {
|
|
4661
|
-
this.removeTooltip();
|
|
4662
|
-
return;
|
|
4663
|
-
}
|
|
4664
4659
|
// Atualiza o conteúdo do tooltip diretamente
|
|
4665
4660
|
this.tooltipElement.innerHTML = this.info_text;
|
|
4666
4661
|
// Reaplica a posição calculada anteriormente para manter a centralização
|
|
@@ -4684,7 +4679,7 @@ class TCloudUiTooltipDirective {
|
|
|
4684
4679
|
this._direction = 'top';
|
|
4685
4680
|
}
|
|
4686
4681
|
onDocumentClick(event) {
|
|
4687
|
-
if (this.tooltipMode === 'click' && this.tooltipVisible && this.
|
|
4682
|
+
if (this.tooltipMode === 'click' && this.tooltipVisible && this.info_text) {
|
|
4688
4683
|
const clickedInside = this.el.nativeElement.contains(event.target) || (this.tooltipElement?.contains(event.target));
|
|
4689
4684
|
if (!clickedInside) {
|
|
4690
4685
|
this.removeTooltip();
|
|
@@ -4692,7 +4687,7 @@ class TCloudUiTooltipDirective {
|
|
|
4692
4687
|
}
|
|
4693
4688
|
}
|
|
4694
4689
|
onMouseOver(event) {
|
|
4695
|
-
if (this.tooltipMode === 'hover' && !this.tooltipVisible && this.
|
|
4690
|
+
if (this.tooltipMode === 'hover' && !this.tooltipVisible && this.info_text) {
|
|
4696
4691
|
this.createTooltip(event);
|
|
4697
4692
|
this.tooltipVisible = true;
|
|
4698
4693
|
}
|
|
@@ -4710,15 +4705,12 @@ class TCloudUiTooltipDirective {
|
|
|
4710
4705
|
if (this.tooltipVisible) {
|
|
4711
4706
|
this.removeTooltip();
|
|
4712
4707
|
}
|
|
4713
|
-
else
|
|
4708
|
+
else {
|
|
4714
4709
|
this.createTooltip(event);
|
|
4715
4710
|
}
|
|
4716
4711
|
this.tooltipVisible = !this.tooltipVisible;
|
|
4717
4712
|
}
|
|
4718
4713
|
}
|
|
4719
|
-
isValidTooltipText(text) {
|
|
4720
|
-
return !!(text && text.trim().length > 0);
|
|
4721
|
-
}
|
|
4722
4714
|
createTooltip(event) {
|
|
4723
4715
|
const scrollTop = window?.scrollY || window?.pageYOffset;
|
|
4724
4716
|
const tooltip = this.renderer.createElement('div');
|