@eagami/ui 5.62.0 → 5.62.1

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.
@@ -7377,6 +7377,7 @@ var TooltipDirective = class TooltipDirective {
7377
7377
  tooltipEl = null;
7378
7378
  placedPosition = "top";
7379
7379
  templateView = null;
7380
+ renderedContent = null;
7380
7381
  scrollable = false;
7381
7382
  showTimer = null;
7382
7383
  hideTimer = null;
@@ -7437,6 +7438,21 @@ var TooltipDirective = class TooltipDirective {
7437
7438
  if (open !== null || wasControlled) untracked(() => open ? this.show() : this.hide());
7438
7439
  wasControlled = open !== null;
7439
7440
  });
7441
+ afterRenderEffect(() => {
7442
+ const content = this.eaTooltip();
7443
+ untracked(() => {
7444
+ if (!this.tooltipEl || content === this.renderedContent) return;
7445
+ if (!content) {
7446
+ this.hide();
7447
+ return;
7448
+ }
7449
+ this.templateView?.destroy();
7450
+ this.templateView = null;
7451
+ this.tooltipEl.replaceChildren();
7452
+ this.renderContent(content);
7453
+ this.relayoutHandler();
7454
+ });
7455
+ });
7440
7456
  }
7441
7457
  controlled() {
7442
7458
  return this.tooltipOpen() !== null;
@@ -7495,12 +7511,7 @@ var TooltipDirective = class TooltipDirective {
7495
7511
  if (this.controlled()) this.renderer.addClass(this.tooltipEl, "ea-tooltip--controlled");
7496
7512
  this.renderer.setAttribute(this.tooltipEl, "role", "tooltip");
7497
7513
  this.renderer.setAttribute(this.tooltipEl, "id", this.tooltipId);
7498
- const content = this.eaTooltip();
7499
- if (content instanceof TemplateRef) {
7500
- this.templateView = this.viewContainer.createEmbeddedView(content);
7501
- this.templateView.detectChanges();
7502
- for (const node of this.templateView.rootNodes) this.renderer.appendChild(this.tooltipEl, node);
7503
- } else this.tooltipEl.textContent = content;
7514
+ this.renderContent(this.eaTooltip());
7504
7515
  const maxWidth = this.maxWidth();
7505
7516
  if (maxWidth != null) {
7506
7517
  this.renderer.setStyle(this.tooltipEl, "--ea-tooltip-max-width", `${Math.max(50, maxWidth)}px`, RendererStyleFlags2.DashCase);
@@ -7548,6 +7559,14 @@ var TooltipDirective = class TooltipDirective {
7548
7559
  this.hideTimer = null;
7549
7560
  }
7550
7561
  }
7562
+ renderContent(content) {
7563
+ this.renderedContent = content;
7564
+ if (content instanceof TemplateRef) {
7565
+ this.templateView = this.viewContainer.createEmbeddedView(content);
7566
+ this.templateView.detectChanges();
7567
+ for (const node of this.templateView.rootNodes) this.renderer.appendChild(this.tooltipEl, node);
7568
+ } else this.tooltipEl.textContent = content;
7569
+ }
7551
7570
  hide() {
7552
7571
  this.cancelPendingShow();
7553
7572
  this.cancelPendingHide();
@@ -7564,6 +7583,7 @@ var TooltipDirective = class TooltipDirective {
7564
7583
  this.scrollable = false;
7565
7584
  this.templateView?.destroy();
7566
7585
  this.templateView = null;
7586
+ this.renderedContent = null;
7567
7587
  this.removeDescribedBy();
7568
7588
  }
7569
7589
  }