{"version":3,"file":"tableau-ui-angular-tooltip.mjs","sources":["../../../projects/component-library/tooltip/src/tooltip.component.ts","../../../projects/component-library/tooltip/src/tooltip.directive.ts","../../../projects/component-library/tooltip/src/tableau-ui-tooltip.module.ts","../../../projects/component-library/tooltip/src/tableau-ui-angular-tooltip.ts"],"sourcesContent":["import type { TemplateRef } from '@angular/core';\nimport { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { injectDialogData } from 'tableau-ui-angular/dialog';\n\n@Component({\n  selector: 'tab-tooltip',\n  standalone: false,\n  template: `\n    @if (stringTooltip !== undefined) {\n      <div class=\"string-value\">\n        {{ stringTooltip }}\n      </div>\n    } @else if (templateTooltip !== undefined) {\n      <ng-container [ngTemplateOutlet]=\"templateTooltip\" [ngTemplateOutletContext]=\"dialogData.tooltipContext\" />\n    }\n  `,\n  styles: `\n    .string-value {\n      white-space: nowrap;\n    }\n  `,\n  changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TooltipComponent<T> {\n  readonly dialogData = injectDialogData<TooltipComponentArgs<T>>();\n\n  readonly stringTooltip: string | undefined;\n  readonly templateTooltip: TemplateRef<T> | undefined;\n  constructor() {\n    if (typeof this.dialogData.tooltip === 'string') {\n      this.stringTooltip = this.dialogData.tooltip;\n      this.templateTooltip = undefined;\n    } else {\n      this.stringTooltip = undefined;\n      this.templateTooltip = this.dialogData.tooltip;\n    }\n  }\n}\nexport interface TooltipComponentArgs<T> {\n  tooltip: TemplateRef<T> | string;\n  tooltipContext: T;\n  padding: string;\n}\n","import type { TemplateRef, OnDestroy, ModelSignal } from '@angular/core';\nimport { Directive, ElementRef, HostListener, input, inject, effect, model } from '@angular/core';\nimport type { DialogRef } from 'tableau-ui-angular/dialog';\nimport { DialogService, GlobalStackOptions } from 'tableau-ui-angular/dialog';\nimport type { TooltipComponentArgs } from './tooltip.component';\nimport { TooltipComponent } from './tooltip.component';\n\n// Style contained in _tooltips.scss in the styles folder\n@Directive({\n  selector: '[tooltip]',\n  standalone: false,\n})\nexport class TooltipDirective<T> implements OnDestroy {\n  private readonly dialogService = inject(DialogService);\n\n  /**\n   * Tooltip directive to show a tooltip on hover.\n   * The tooltip can be a string or a TemplateRef.\n   * The tooltip will be positioned relative to the element it is applied to.\n   * The tooltip will be destroyed when the element is destroyed.\n   * The tooltip will be opened on mouse enter and closed on mouse leave.\n   * @default undefined\n   */\n  readonly $tooltip: ModelSignal<TemplateRef<T | undefined> | string | null | undefined> = model.required<TemplateRef<T | undefined> | string | null | undefined>({\n    alias: 'tooltip',\n  });\n  /**\n   * Context for the tooltip template.\n   * This is used to pass data to the tooltip template.\n   * If the tooltip is a string, this will be ignored.\n   * If the tooltip is a TemplateRef, this will be used as the context for the template.\n   * @default undefined\n   */\n  readonly $tooltipContext = model<T | undefined>(undefined, {\n    alias: 'tooltipContext',\n  });\n  /**\n   * Position of the tooltip relative to the element.\n   * Can be 'top', 'bottom', 'left', or 'right'.\n   * @default 'top'\n   */\n  readonly $tooltipPosition = model<'bottom' | 'left' | 'right' | 'top'>('top', {\n    alias: 'tooltipPosition',\n  });\n  /**\n   * Margin around the tooltip.\n   * This is used to position the tooltip away from the element.\n   * It can be a string representing a CSS value (e.g., '5px', '1rem', '10%').\n   * @default '5px'\n   */\n  readonly $tooltipMargin = model<string>('0.5rem', {\n    alias: 'tooltipMargin',\n  });\n\n  /**\n   * Padding inside the tooltip.\n   * This is used to add space inside the tooltip around the content.\n   * It can be a string representing a CSS value (e.g., '0.5rem', '1rem').\n   * It can also be any set of padding values like '0.5rem 1rem' for top/bottom and left/right padding.\n   * @default '0.5rem'\n   */\n  readonly $tooltipPadding = model<string>('0.5rem', {\n    alias: 'tooltipPadding',\n  });\n\n  /**\n   * Mode for the tooltip arguments.\n   * If 'individual', the tooltip will use the individual properties provided ([tooltip], `[tooltipContext]`, `[tooltipPosition]`, and `[tooltipMargin]`).\n   * If 'full', the tooltip will use the full arguments provided in `[tooltipFullArgs]`.\n   * If 'lazy', the tooltip will use lazy evaluation of arguments by calling the provided in `[tooltipLazyArgs]` function.\n   * tooltipContext`, `$tooltipPosition`, and `$tooltipMargin`.\n   * @default 'individual'\n   */\n  readonly $tooltipArgsMode = input<'full' | 'individual' | 'lazy'>('individual', {\n    alias: 'tooltipArgsMode',\n  });\n  /**\n   * Full arguments for the tooltip.\n   * This is used to pass all the arguments to the tooltip.\n   * If this is provided, it will override the individual tooltip properties.\n   * This is used to set only.\n   */\n  readonly $tooltipFullArgs = input<TooltipArgs<T> | undefined>(undefined, {\n    alias: 'tooltipFullArgs',\n  });\n\n  /**\n   * Lazy arguments for the tooltip.\n   * The passed function is called to determine if a tooltip is needed when the element is hovered.\n   * Only works if the `tooltipArgsMode` is set to 'lazy'.\n   * This is used to pass a function that returns the tooltip arguments.\n   * This is useful for cases where the tooltip arguments are not known at the time of directive initialization.\n   * If this is provided, it will override the individual tooltip properties.\n   * This is used to set only.\n   */\n  readonly $tooltipLazyArgs = input<() => TooltipArgs<T> | undefined>(undefined, {\n    alias: 'tooltipLazyArgs',\n  });\n\n  // re-create the tooltip when any of the tooltip arguments change and tooltip is open\n  private readonly tooltipArgsChanged = effect(() => {\n    this.$tooltip();\n    this.$tooltipContext();\n    this.$tooltipFullArgs();\n    this.$tooltipLazyArgs();\n    this.$tooltipArgsMode();\n    if (this.tooltipDialogRef) {\n      this.destroyTooltip();\n      this.createTooltip();\n    }\n  });\n\n  private tooltipDialogRef: DialogRef | undefined = undefined;\n  private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n  @HostListener('mouseenter', ['$event']) onMouseEnter(e: MouseEvent) {\n    if (e.buttons !== 0) {\n      return;\n    }\n    this.createTooltip();\n  }\n  @HostListener('mouseleave') onMouseLeave() {\n    this.destroyTooltip();\n  }\n  ngOnDestroy(): void {\n    this.destroyTooltip();\n  }\n\n  private createTooltip() {\n    // determine the tooltip arguments based on the mode\n    let args: TooltipArgs<T> | undefined = undefined;\n    switch (this.$tooltipArgsMode()) {\n      case 'full':\n        args = this.$tooltipFullArgs();\n        break;\n      case 'lazy':\n        {\n          const lazyArgs = this.$tooltipLazyArgs();\n          if (lazyArgs === undefined) {\n            args = undefined;\n          } else {\n            args = lazyArgs();\n          }\n        }\n        break;\n      case 'individual':\n        args = {\n          template: this.$tooltip(),\n          context: this.$tooltipContext(),\n          position: this.$tooltipPosition(),\n          margin: this.$tooltipMargin(),\n        };\n        break;\n      default:\n        throw new Error(`Unknown tooltip args mode: ${this.$tooltipArgsMode()}`);\n    }\n    if (this.tooltipDialogRef || args?.template === undefined || args?.template === null) {\n      return;\n    }\n    const marginWithUnit = /^\\d+$/.test(args.margin ?? '0.5rem') ? `${args.margin}px` : args.margin;\n    const calculateTop = (pos: 'bottom' | 'left' | 'right' | 'top', actualWidth: number, actualHeight: number, insertAfterElementRect: DOMRect, recalculateCounter = 0) => {\n      switch (pos) {\n        case 'left':\n        case 'right': {\n          // find the mid point of the element\n          const elementMidPoint = insertAfterElementRect.top + insertAfterElementRect.height / 2;\n          // calculate the top position based on the mid point and the height of the tooltip\n          const tooltipTop = elementMidPoint - actualHeight / 2;\n          return `max(${marginWithUnit}, ${tooltipTop}px)`;\n        }\n        case 'top': {\n          // find the top of the element and subtract the height of the tooltip\n          const tooltipTop = insertAfterElementRect.top - actualHeight;\n          // if we hit the top of the screen, make the tooltip appear below the element\n          if (tooltipTop < 0 && recalculateCounter < 2) {\n            return calculateTop('bottom', actualWidth, actualHeight, insertAfterElementRect, recalculateCounter + 1);\n          }\n          // subtract the margin from the top position\n          // ensure the tooltip does not go above the top of the screen\n          return `max(0px, calc(${tooltipTop}px - ${marginWithUnit}))`;\n        }\n        case 'bottom': {\n          // find the bottom of the element and add the height of the tooltip\n          const tooltipTop = insertAfterElementRect.bottom;\n          // if we hit the bottom of the screen, make the tooltip appear above the element\n          if (tooltipTop + actualHeight > window.innerHeight && recalculateCounter < 2) {\n            return calculateTop('top', actualWidth, actualHeight, insertAfterElementRect, recalculateCounter + 1);\n          }\n          // add the margin to the top position\n          // ensure the tooltip does not go below the bottom of the screen\n          return `min(${window.innerHeight - actualHeight}px, calc(${tooltipTop}px + ${marginWithUnit}))`;\n        }\n        default:\n          return '0'; // Fallback case, should not happen\n      }\n    };\n    const calculateLeft = (pos: 'bottom' | 'left' | 'right' | 'top', actualWidth: number, actualHeight: number, insertAfterElementRect: DOMRect, recalculateCounter = 0) => {\n      switch (pos) {\n        case 'top':\n        case 'bottom': {\n          // find the mid point of the element\n          const elementMidPoint = insertAfterElementRect.left + insertAfterElementRect.width / 2;\n          // calculate the left position based on the mid point and the width of the tooltip\n          const tooltipLeft = elementMidPoint - actualWidth / 2;\n          // what is the smallest left coordinate that is acceptable\n          return `min(${tooltipLeft}px, calc(${window.innerWidth - actualWidth}px - ${marginWithUnit}))`;\n        }\n        case 'left': {\n          // find the left of the element and subtract the width of the tooltip\n          const tooltipLeft = insertAfterElementRect.left - actualWidth;\n          // if we hit the left side of the screen, make the tooltip appear on the right side of the element\n          if (tooltipLeft < 0 && recalculateCounter < 2) {\n            return calculateLeft('right', actualWidth, actualHeight, insertAfterElementRect, recalculateCounter + 1);\n          }\n          // ensure the tooltip does not go off the left side of the screen\n          return `max(0px, calc(${tooltipLeft}px - ${marginWithUnit}))`;\n        }\n        case 'right': {\n          // find the right of the element and add the width of the tooltip\n          const tooltipLeft = insertAfterElementRect.right;\n          // if we hit the right side of the screen, make the tooltip appear on the left side of the element\n          if (tooltipLeft + actualWidth > window.innerWidth && recalculateCounter < 2) {\n            return calculateLeft('left', actualWidth, actualHeight, insertAfterElementRect, recalculateCounter + 1);\n          }\n          // ensure the tooltip does not go off the right side of the screen\n          return `min(${window.innerWidth - actualWidth}px, calc(${tooltipLeft}px + ${marginWithUnit}))`;\n        }\n        default:\n          return '0'; // Fallback case, should not happen\n      }\n    };\n\n    this.tooltipDialogRef = this.dialogService.openDialog(\n      TooltipComponent,\n      {\n        tooltip: args.template,\n        tooltipContext: args.context,\n        padding: args.padding,\n      } as TooltipComponentArgs<T>,\n      {\n        backdropCss: undefined,\n        skipCreatingBackdrop: true,\n        closeOnBackdropClick: false,\n        closeOnEscape: false,\n        trapFocus: false,\n        containerCss: {\n          pointerEvents: 'none',\n          backgroundColor: 'var(--twc-color-base)',\n          border: '1px solid var(--twc-color-border-light)',\n          borderRadius: '1px',\n          boxShadow: 'var(--twc-dialog-box-shadow)',\n          boxSizing: 'border-box',\n          display: 'block',\n          fontSize: '1rem',\n          lineHeight: '1.2',\n          padding: args.padding ?? '0.5rem',\n          tabindex: '-1',\n        },\n        header: undefined,\n        height: undefined,\n        width: undefined,\n        top: (actualWidth, actualHeight, insertAfterElementRect) => {\n          return calculateTop(args.position ?? 'top', actualWidth, actualHeight, insertAfterElementRect!, 0);\n        },\n        left: (actualWidth, actualHeight, insertAfterElementRect) => {\n          return calculateLeft(args.position ?? 'top', actualWidth, actualHeight, insertAfterElementRect!, 0);\n        },\n      },\n      new GlobalStackOptions(this.elementRef.nativeElement),\n    );\n  }\n\n  private destroyTooltip() {\n    if (this.tooltipDialogRef) {\n      this.tooltipDialogRef.close();\n      this.tooltipDialogRef = undefined;\n    }\n  }\n}\nexport interface TooltipArgs<T> {\n  template: TemplateRef<T | undefined> | string | null | undefined;\n  context: T | undefined;\n  position?: 'bottom' | 'left' | 'right' | 'top';\n  margin?: string;\n  padding?: string;\n}\n","import { NgModule } from '@angular/core';\nimport { TooltipDirective } from './tooltip.directive';\nimport { TableauUiDialogModule } from 'tableau-ui-angular/dialog';\nimport { CommonModule } from '@angular/common';\nimport { TooltipComponent } from './tooltip.component';\n\n@NgModule({\n  imports: [TableauUiDialogModule, CommonModule],\n  declarations: [TooltipDirective, TooltipComponent],\n  exports: [TooltipDirective],\n})\nexport class TableauUiTooltipModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;MAuBa,gBAAgB,CAAA;IAClB,UAAU,GAAG,gBAAgB,EAA2B;AAExD,IAAA,aAAa;AACb,IAAA,eAAe;AACxB,IAAA,WAAA,GAAA;QACE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