@annalib/anna-core 37.0.24 → 37.0.26

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.
@@ -595,12 +595,17 @@ class ShowEllipsisTextOnHoverDirective {
595
595
  if (!domElement.children || (domElement.children && domElement.children.length === 0))
596
596
  return false;
597
597
  const elementRect = domElement.getBoundingClientRect();
598
- const childRect = domElement.children[0].getBoundingClientRect();
598
+ const childRectRight = this.getFirstChildElementWithWidth(domElement);
599
599
  const paddingOnRight = window.getComputedStyle(domElement).paddingRight;
600
600
  const padding = +(paddingOnRight.endsWith("px") ? paddingOnRight.slice(0, -2) : paddingOnRight);
601
601
  // If overflow happens then Child element's right side position
602
602
  // will be greater than container element's right side position.
603
- return childRect.right + padding > elementRect.right;
603
+ return childRectRight + padding > elementRect.right;
604
+ }
605
+ getFirstChildElementWithWidth(domElement) {
606
+ const children = Array.from(domElement.children);
607
+ const childWithWidth = children.find((child) => child.offsetWidth > 0);
608
+ return childWithWidth ? childWithWidth.getBoundingClientRect().right : 0;
604
609
  }
605
610
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ShowEllipsisTextOnHoverDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
606
611
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: ShowEllipsisTextOnHoverDirective, isStandalone: true, selector: "[annaCoreShowEllipsisTextOnHover]", inputs: { includeFullWidth: "includeFullWidth" }, host: { listeners: { "mouseenter": "onMouseEnter()" } }, ngImport: i0 }); }