@truenas/ui-components 0.1.20 → 0.1.22

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.
@@ -477,6 +477,9 @@ class TnIconComponent {
477
477
  // Convert to registry format for Lucide icons
478
478
  effectiveIconName = `lucide:${name}`;
479
479
  }
480
+ else if (library === 'custom' && !name.startsWith('app-')) {
481
+ effectiveIconName = `app-${name}`;
482
+ }
480
483
  // 1. Try icon registry (libraries and custom icons)
481
484
  const iconOptions = {
482
485
  size: this.size(),
@@ -7536,6 +7539,7 @@ class TnTooltipDirective {
7536
7539
  _showTimeout = null;
7537
7540
  _hideTimeout = null;
7538
7541
  _isTooltipVisible = false;
7542
+ _positionSub = null;
7539
7543
  _ariaDescribedBy = null;
7540
7544
  _overlay = inject(Overlay);
7541
7545
  _elementRef = inject((ElementRef));
@@ -7548,6 +7552,7 @@ class TnTooltipDirective {
7548
7552
  ngOnDestroy() {
7549
7553
  this._clearTimeouts();
7550
7554
  this.hide(0);
7555
+ this._positionSub?.unsubscribe();
7551
7556
  if (this._overlayRef) {
7552
7557
  this._overlayRef.dispose();
7553
7558
  this._overlayRef = null;
@@ -7615,6 +7620,33 @@ class TnTooltipDirective {
7615
7620
  scrollStrategy: this._overlay.scrollStrategies.reposition({ scrollThrottle: 20 }),
7616
7621
  panelClass: ['tn-tooltip-panel', `tn-tooltip-panel-${this.position()}`, this.tooltipClass()].filter(Boolean),
7617
7622
  });
7623
+ this._positionSub = positionStrategy.positionChanges
7624
+ .subscribe((change) => {
7625
+ const panel = this._overlayRef?.overlayElement?.parentElement;
7626
+ if (!panel) {
7627
+ return;
7628
+ }
7629
+ const actual = this._resolvePosition(change.connectionPair);
7630
+ const allPositionClasses = [
7631
+ 'tn-tooltip-panel-above', 'tn-tooltip-panel-below',
7632
+ 'tn-tooltip-panel-left', 'tn-tooltip-panel-right',
7633
+ 'tn-tooltip-panel-before', 'tn-tooltip-panel-after',
7634
+ ];
7635
+ panel.classList.remove(...allPositionClasses);
7636
+ panel.classList.add(`tn-tooltip-panel-${actual}`);
7637
+ });
7638
+ }
7639
+ _resolvePosition(pair) {
7640
+ if (pair.overlayY === 'bottom') {
7641
+ return 'above';
7642
+ }
7643
+ if (pair.overlayY === 'top') {
7644
+ return 'below';
7645
+ }
7646
+ if (pair.overlayX === 'end') {
7647
+ return 'left';
7648
+ }
7649
+ return 'right';
7618
7650
  }
7619
7651
  _attachTooltip() {
7620
7652
  if (!this._overlayRef) {