{"version":3,"file":"sebgroup-green-angular-src-v-angular-tooltip.mjs","sources":["../../../../libs/angular/src/v-angular/tooltip/tooltip.styles.ts","../../../../libs/angular/src/v-angular/tooltip/tooltip.directive.ts","../../../../libs/angular/src/v-angular/tooltip/tooltip.module.ts","../../../../libs/angular/src/v-angular/tooltip/sebgroup-green-angular-src-v-angular-tooltip.ts"],"sourcesContent":["export const tooltipBoxStyles = new Map<string, any>([\n  ['position', 'absolute'],\n  ['z-index', '1045'],\n  ['border-radius', '.25rem'],\n  ['padding', '.5rem 1rem'],\n  ['background-color', '#1a1a1a'],\n  ['color', '#fff'],\n  ['font-size', '0.875rem'],\n  ['font-weight', '400'],\n  ['line-height', '1.5'],\n  ['padding', '0.5rem'],\n  ['pointer-events', 'none'],\n])\n\nexport const tooltipArrowTopStyles = new Map<string, any>([\n  ['position', 'absolute'],\n  ['width', '0'],\n  ['height', '0'],\n  ['border', '0.5rem solid transparent'],\n  ['bottom', '-1rem'],\n  ['left', '50%'],\n  ['transform', 'translateX(-50%)'],\n  ['border-color', '#1a1a1a transparent transparent'],\n])\n\nexport const tooltipArrowBottomStyles = new Map<string, any>([\n  ['position', 'absolute'],\n  ['width', '0'],\n  ['height', '0'],\n  ['border', '0.5rem solid transparent'],\n  ['top', '-1rem'],\n  ['left', '50%'],\n  ['transform', 'translateX(-50%)'],\n  ['border-color', 'transparent transparent #1a1a1a'],\n])\n\nexport const tooltipArrowLeftStyles = new Map<string, any>([\n  ['position', 'absolute'],\n  ['width', '0'],\n  ['height', '0'],\n  ['border', '0.5rem solid transparent'],\n  ['right', '-1rem'],\n  ['top', '50%'],\n  ['transform', 'translateY(-50%)'],\n  ['border-color', 'transparent transparent transparent #1a1a1a'],\n])\n\nexport const tooltipArrowRightStyles = new Map<string, any>([\n  ['position', 'absolute'],\n  ['width', '0'],\n  ['height', '0'],\n  ['border', '0.5rem solid transparent'],\n  ['left', '-1rem'],\n  ['top', '50%'],\n  ['transform', 'translateY(-50%)'],\n  ['border-color', 'transparent #1a1a1a transparent transparent'],\n])\n\nexport const tooltipArrowStyles = {\n  top: tooltipArrowTopStyles,\n  bottom: tooltipArrowBottomStyles,\n  left: tooltipArrowLeftStyles,\n  right: tooltipArrowRightStyles,\n}\n","import {\n  AfterViewInit,\n  Directive,\n  ElementRef,\n  EventEmitter,\n  HostListener,\n  Input,\n  OnChanges,\n  OnDestroy,\n  Output,\n  Renderer2,\n  SimpleChange,\n  SimpleChanges,\n} from '@angular/core'\n\nimport { tooltipArrowStyles, tooltipBoxStyles } from './tooltip.styles'\n\nexport type Placement = 'top' | 'right' | 'bottom' | 'left'\n\ntype Position = {\n  top?: number\n  right?: number\n  bottom?: number\n  left?: number\n}\n\n/**\n * A tooltip is a text label that acts as a helper to a specific item.\n * Recommended to use value `top` or `bottom` with `placement` for responsive design.\n * Dynamic resizing and tooltip position are a work in progress.\n * https://designlibrary.sebgroup.com/components/component-tooltip\n */\n@Directive({\n    selector: '[nggvTooltip]',\n    standalone: false\n})\nexport class NggvTooltipDirective\n  implements AfterViewInit, OnChanges, OnDestroy\n{\n  /** The text that will be shown in the tooltip. */\n  @Input() nggvTooltip?: string\n  /** Special property used for selecting DOM elements during automated UI testing. */\n  @Input() thook = 'tooltip'\n  /** The side of the anchor which the tooltip will be rendered.\n   * Recommended `top` and `bottom` for responsive designs as these are more stable.\n   */\n  @Input() placement: Placement = 'top'\n  /** Initial state and subsequent updates on wether the tooltip is visible. */\n  @Input() shown = false\n  /** How far off from the text the tooltip will be rendered. */\n  @Input() offset = 10\n  /** How frequently the tooltip will be re-rendered when the page size changes. */\n  @Input() resizeThrottle = 50\n  /** Id of tooltip element. */\n  @Input() tooltipId?: string\n  /** Numeric max-width for tooltip. */\n  @Input() maxWidth = 343\n\n  /** Emits a show event triggered changing visibility state of the tooltip. */\n  @Output() nggvShow = new EventEmitter<HTMLElement>()\n  /** Emits a hide event triggered changing visibility state of the tooltip. */\n  @Output() nggvHide = new EventEmitter<HTMLElement>()\n\n  /** @internal */\n  protected timeout = 0\n\n  /** @internal */\n  protected parentElement: HTMLElement\n\n  /** @internal */\n  protected anchorElement: HTMLElement\n\n  /** @internal */\n  protected tooltipElement: HTMLElement | undefined\n\n  /** @internal */\n  protected arrowElement: HTMLElement | undefined\n\n  /** @internal Check if changes should trigger a re-render */\n  static shouldUpdate(change: SimpleChange) {\n    return (\n      change &&\n      !change.firstChange &&\n      change.previousValue !== change.currentValue\n    )\n  }\n\n  constructor(\n    private anchorElementRef: ElementRef,\n    private renderer: Renderer2,\n  ) {\n    this.anchorElement = this.anchorElementRef.nativeElement\n    this.parentElement = document.body\n  }\n\n  ngAfterViewInit() {\n    // Set a timeout to allow view to fully render before creating tooltip.\n    setTimeout(() => (this.shown ? this.show(true) : this.hide(true)))\n  }\n\n  ngOnChanges(changes: SimpleChanges): void {\n    if (\n      NggvTooltipDirective.shouldUpdate(changes.nggvTooltip) ||\n      NggvTooltipDirective.shouldUpdate(changes.placement) ||\n      NggvTooltipDirective.shouldUpdate(changes.thook)\n    ) {\n      this.shown ? this.show(true) : this.hide(true)\n    }\n\n    if (NggvTooltipDirective.shouldUpdate(changes.shown)) {\n      this.shown ? this.show() : this.hide()\n    }\n\n    if (NggvTooltipDirective.shouldUpdate(changes.offset)) {\n      this.updatePosition()\n    }\n  }\n\n  ngOnDestroy() {\n    this.hide(true)\n  }\n\n  /** @internal */\n  @HostListener('mouseenter')\n  @HostListener('focus')\n  onMouseEnter() {\n    this.show()\n  }\n\n  /** @internal */\n  @HostListener('mouseleave')\n  @HostListener('blur')\n  @HostListener('keyup.escape')\n  onMouseLeave() {\n    this.hide()\n  }\n\n  /** @internal */\n  @HostListener('window:resize')\n  resize() {\n    if (this.timeout) return\n    this.timeout = window.setTimeout(() => {\n      this.timeout = 0\n      this.updatePosition()\n    }, this.resizeThrottle)\n  }\n\n  /**\n   * Sets the visibility state of the tooltip to true and creates a new tooltip if it doesn't exist or `recreate` is set.\n   * @param recreate if set to true, destroy any existing tooltip and create a new one.\n   */\n  show(recreate = false) {\n    // Require tooltip text to create\n    if (!this.nggvTooltip || this.nggvTooltip.length === 0) return\n\n    if (recreate || !this.tooltipElement) {\n      this.hide(true)\n      this.create(this.nggvTooltip)\n    } else {\n      this.renderer.appendChild(this.parentElement, this.tooltipElement)\n    }\n\n    this.updatePosition()\n    this.shown = true\n    this.nggvShow.emit(this.tooltipElement)\n  }\n\n  /**\n   * Sets the visibility state of the tooltip to false and destroys an existing tooltip if `destroy` is set.\n   * @param destroy if set to true, destroy any existing tooltip.\n   */\n  hide(destroy = false) {\n    if (!this.tooltipElement) return\n    if (this.parentElement.contains(this.tooltipElement)) {\n      this.renderer.removeChild(this.parentElement, this.tooltipElement)\n    }\n    if (destroy) this.destroy()\n    this.shown = false\n    this.nggvHide.emit(this.tooltipElement)\n  }\n\n  /**\n   * @internal\n   * Creates a new tooltip with the set placement and a given text as its body.\n   * @param text the string to be displayed in the tooltip body.\n   */\n  create(text: string) {\n    this.tooltipElement = this.renderer.createElement('div')\n    this.renderer.addClass(this.tooltipElement, 'gds-tooltip')\n    this.renderer.setAttribute(this.tooltipElement, 'data-thook', this.thook)\n    this.renderer.setAttribute(this.tooltipElement, 'role', 'tooltip')\n    if (this.tooltipId) {\n      this.renderer.setAttribute(this.tooltipElement, 'id', this.tooltipId)\n    }\n    // set styling\n    Array.from(tooltipBoxStyles.entries()).forEach(([style, value]) => {\n      this.renderer.setStyle(this.tooltipElement, style, value)\n    })\n    const relativeMaxWidth = this.pxToRem(this.maxWidth)\n    this.renderer.setStyle(this.tooltipElement, 'max-width', relativeMaxWidth)\n    this.renderer.appendChild(\n      this.tooltipElement,\n      this.renderer.createText(text),\n    )\n\n    // add tooltip to DOM\n    this.renderer.appendChild(this.parentElement, this.tooltipElement)\n\n    this.arrowElement = this.renderer.createElement('div')\n    this.renderer.addClass(\n      this.arrowElement,\n      `gds-tooltip__arrow-${this.placement}`,\n    )\n\n    // add arrow to tooltip element\n    this.renderer.appendChild(this.tooltipElement, this.arrowElement)\n  }\n\n  /**\n   * @internal\n   * Destroys the current tooltip by un-setting variables, should only be used after detaching elements from the DOM.\n   */\n  destroy() {\n    this.tooltipElement = undefined\n    this.arrowElement = undefined\n  }\n\n  /**\n   * @internal\n   * Recalculates the position of the tooltip.\n   */\n  updatePosition() {\n    if (!this.tooltipElement || !this.arrowElement) return\n    const scrollPos =\n      window.pageYOffset ||\n      document.documentElement.scrollTop ||\n      this.parentElement.scrollTop ||\n      0\n    const anchorRect = this.anchorElement.getBoundingClientRect()\n    const tooltipRect = this.tooltipElement.getBoundingClientRect()\n    const arrowRect = this.arrowElement.getBoundingClientRect()\n\n    switch (this.placement) {\n      case 'top':\n        this.alignVertical(\n          true,\n          scrollPos,\n          anchorRect,\n          tooltipRect.width,\n          tooltipRect.height,\n          arrowRect.width,\n        )\n        break\n\n      case 'bottom':\n        this.alignVertical(\n          false,\n          scrollPos,\n          anchorRect,\n          tooltipRect.width,\n          tooltipRect.height,\n          arrowRect.width,\n        )\n        break\n\n      case 'left':\n        this.alignHorizontal(true, scrollPos, anchorRect, tooltipRect.height)\n        break\n\n      case 'right':\n        this.alignHorizontal(false, scrollPos, anchorRect, tooltipRect.height)\n        break\n\n      default:\n        return\n    }\n  }\n\n  /**\n   * @internal\n   * Calculates and set the position of the tooltip when the placement is `top` or `bottom`.\n   */\n  alignVertical(\n    above: boolean,\n    scrollPos: number,\n    anchor: DOMRect,\n    tooltipWidth: number,\n    tooltipHeight: number,\n    arrowWidth: number,\n  ) {\n    const width = this.parentElement.clientWidth\n    const anchorMidX = anchor.left + anchor.width / 2\n    const tooltip: Position = {}\n    const arrow: Position = {}\n\n    if (above)\n      tooltip.top = anchor.top - tooltipHeight - this.offset + scrollPos\n    else tooltip.top = anchor.bottom + this.offset + scrollPos\n\n    if (anchorMidX < width / 2) {\n      tooltip.left = Math.max(0, anchorMidX - tooltipWidth / 2)\n      arrow.left = anchorMidX - tooltip.left\n    } else {\n      tooltip.right = Math.max(0, width - (anchorMidX + tooltipWidth / 2))\n      arrow.right = width - anchorMidX - tooltip.right - arrowWidth\n    }\n\n    this.setStyle(tooltip, arrow)\n  }\n\n  /**\n   * @internal\n   * Calculates and set the position of the tooltip when the placement is `left` or `right`.\n   */\n  alignHorizontal(\n    before: boolean,\n    scrollPos: number,\n    anchor: DOMRect,\n    tooltipHeight: number,\n  ) {\n    const width = this.parentElement.clientWidth\n    const top = anchor.top + (anchor.height - tooltipHeight) / 2 + scrollPos\n    const tooltip: Position = { top }\n    const arrow: Position = { top: tooltipHeight / 2 }\n\n    if (before) tooltip.right = width - anchor.left + this.offset\n    else tooltip.left = anchor.right + this.offset\n\n    this.setStyle(tooltip, arrow)\n  }\n\n  /**\n   * @internal\n   * Updates the CSS properties for the tooltip position.\n   */\n  setStyle(tooltip: Position, arrow: Position) {\n    // Tooltip\n    Object.entries(tooltip).forEach(([prop, value]) => {\n      const position = this.pxToRem(value)\n      this.renderer.setStyle(this.tooltipElement, prop, position)\n    })\n\n    // Arrow\n    Object.entries(arrow).forEach(([prop, value]) => {\n      const position = this.pxToRem(value)\n      this.renderer.setStyle(this.arrowElement, prop, position)\n    })\n\n    Array.from(tooltipArrowStyles[this.placement].entries()).forEach(\n      ([style, value]) => {\n        this.renderer.setStyle(this.arrowElement, style, value)\n      },\n    )\n  }\n\n  private pxToRem(value: number): string {\n    const fontSizePx = window\n      ?.getComputedStyle(this.parentElement)\n      ?.getPropertyValue('font-size')\n    const fontSizeNumberMatch = fontSizePx?.match(/\\d{1,}/)\n    const fontSize = fontSizeNumberMatch ? +fontSizeNumberMatch[0] : 16\n    const remValue = value / fontSize\n    return `${remValue}rem`\n  }\n}\n","import { NgModule } from '@angular/core'\n\nimport { NggvI18nModule } from '@sebgroup/green-angular/src/v-angular/i18n'\nimport { NggvTooltipDirective } from './tooltip.directive'\n\n@NgModule({\n  declarations: [NggvTooltipDirective],\n  exports: [NggvTooltipDirective],\n  imports: [NggvI18nModule],\n})\nexport class NggvTooltipModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nex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