{"version":3,"file":"tableau-ui-angular-autocomplete.mjs","sources":["../../../projects/component-library/autocomplete/src/autocomplete.component.ts","../../../projects/component-library/autocomplete/src/autocomplete.component.html","../../../projects/component-library/autocomplete/src/autocomplete.directive.ts","../../../projects/component-library/autocomplete/src/tableau-ui-autocomplete.module.ts","../../../projects/component-library/autocomplete/src/tableau-ui-angular-autocomplete.ts"],"sourcesContent":["import type { Signal, TemplateRef, WritableSignal } from '@angular/core';\nimport { ChangeDetectionStrategy, Component, contentChild, contentChildren, ElementRef, inject, model, signal, viewChild } from '@angular/core';\n\nimport type { Subscription } from 'rxjs';\nimport { fromEvent, map, Subject } from 'rxjs';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport type { IOptionGridContext } from 'tableau-ui-angular/common';\nimport { OptionComponent, PrefixComponent, SuffixComponent } from 'tableau-ui-angular/common';\nimport type { DialogRef } from 'tableau-ui-angular/dialog';\nimport { DialogService, LocalStackOptions } from 'tableau-ui-angular/dialog';\nimport { generateRandomString } from 'tableau-ui-angular/utils';\nimport type { Primitive } from 'tableau-ui-angular/types';\n\n@Component({\n  selector: 'tab-autocomplete',\n  standalone: false,\n  templateUrl: './autocomplete.component.html',\n  styleUrl: './autocomplete.component.scss',\n  changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AutoCompleteComponent<T extends Primitive> {\n  private readonly dialogService = inject(DialogService);\n  private readonly elementRef = inject(ElementRef);\n\n  protected readonly dropdownId: string;\n\n  public readonly selectValue$ = new Subject<OptionComponent<T>>();\n  /**\n   * The CSS text to apply to the dropdown container\n   * @remarks\n   * Use this to apply height, maxHeight, etc. to the dropdown container\n   * @default '{}'\n   */\n  readonly $dropdownContainerCss = model<Record<string, string>>(\n    {},\n    {\n      alias: 'dropdownContainerCss',\n    },\n  );\n  /**\n   * The CSS text to apply to the options container in the dropdown\n   * @remarks\n   * Use this to apply height, maxHeight, etc. to the dropdown\n   * This is applied to the options container, excluding the prefix & suffix\n   *\n   * @default \"{ maxHeight: '300px', height: 'fit-content'}\"\n   */\n  readonly $dropdownOptionsContainerCss = model<Record<string, string>>(\n    {\n      maxHeight: '300px',\n      height: 'fit-content',\n    },\n    {\n      alias: 'dropdownOptionsContainerCss',\n    },\n  );\n  /**\n   * The template context to use for the dropdown options\n   * @remarks\n   * Use this to display the 'icon', 'text', and 'hint' properties of the options conditionally\n   */\n  readonly $dropdownValueTemplateContext = model<IOptionGridContext>(\n    {\n      renderIcon: true,\n      renderText: true,\n      renderHint: true,\n    },\n    {\n      alias: 'dropdownValueTemplateContext',\n    },\n  );\n\n  protected readonly $options = contentChildren<OptionComponent<T>>(OptionComponent);\n  // nullable Signal type needs to be set explicitly -> ng-packagr strips nullability\n  protected readonly $dropdownPrefix: Signal<PrefixComponent | undefined> = contentChild<PrefixComponent>(PrefixComponent);\n  // nullable Signal type needs to be set explicitly -> ng-packagr strips nullability\n  protected readonly $dropdownSuffix: Signal<SuffixComponent | undefined> = contentChild<SuffixComponent>(SuffixComponent);\n  // nullable Signal type needs to be set explicitly -> ng-packagr strips nullability\n  protected readonly $dropdownTemplate: Signal<TemplateRef<null> | undefined> = viewChild<TemplateRef<null>>('dropdownTemplate');\n\n  constructor() {\n    const id = generateRandomString();\n    this.dropdownId = `dropdown-${id}`;\n    toObservable(this.$options).subscribe(() => {\n      this.$highlightedOption.set(undefined);\n    });\n  }\n\n  // nullable Signal type needs to be set explicitly -> ng-packagr strips nullability\n  private readonly $openDialog: WritableSignal<{ ref: DialogRef; el: HTMLInputElement } | undefined> = signal<{ ref: DialogRef; el: HTMLInputElement } | undefined>(undefined);\n  openDropdown(parentControl: HTMLInputElement) {\n    if (parentControl.hasAttribute('disabled') && parentControl.getAttribute('disabled') !== 'false') {\n      return undefined;\n    }\n    if (this.$openDialog()) {\n      if (this.$openDialog()?.el === parentControl) {\n        return this.$openDialog()?.ref;\n      }\n      this.$openDialog()?.ref.close();\n    }\n\n    const inputRect = parentControl.getBoundingClientRect();\n\n    const ref = this.dialogService.openTemplateDialog(\n      this.$dropdownTemplate()!,\n      {\n        //top: inputRect.bottom + 'px',\n        top(actualWidth, actualHeight) {\n          if (inputRect.bottom + actualHeight > window.innerHeight && inputRect.top - actualHeight > 0) {\n            return inputRect.top - actualHeight + 'px';\n          }\n          return inputRect.bottom + 'px';\n        },\n        left: inputRect.left + 'px',\n        width: inputRect.width + 'px',\n        closeOnEscape: true,\n        closeOnBackdropClick: true,\n        backdropCss: {\n          pointerEvents: 'none',\n        },\n      },\n      null,\n      new LocalStackOptions(parentControl),\n    );\n\n    this.registerKeyNavigation();\n    ref.closed$.subscribe(() => {\n      this.unregisterKeyNavigation();\n      if (this.$openDialog()?.ref === ref) {\n        this.$openDialog.set(undefined);\n      }\n    });\n    this.$openDialog.set({ ref, el: parentControl });\n    return ref;\n  }\n  closeDropdown() {\n    this.$openDialog()?.ref.close();\n  }\n\n  // nullable Signal type needs to be set explicitly -> ng-packagr strips nullability\n  protected readonly $highlightedOption: WritableSignal<OptionComponent<T> | undefined> = signal<OptionComponent<T> | undefined>(undefined);\n\n  protected optionMouseDown(event: MouseEvent) {\n    event.preventDefault();\n    event.stopPropagation();\n  }\n\n  private optionKeyNavSubscription: Subscription | undefined;\n  private registerKeyNavigation() {\n    this.unregisterKeyNavigation();\n    this.optionKeyNavSubscription = fromEvent(document, 'keydown')\n      .pipe(map(e => e as KeyboardEvent))\n      .subscribe((e: KeyboardEvent) => {\n        this.onKeyDown(e);\n      });\n  }\n  private unregisterKeyNavigation() {\n    if (this.optionKeyNavSubscription) {\n      this.optionKeyNavSubscription.unsubscribe();\n      this.optionKeyNavSubscription = undefined;\n    }\n  }\n  /**\n   *\n   * @param e Handles KeyDown event for:\n   * - host element\n   * - global keydown event when dropdown is open\n   * @returns\n   */\n  private onKeyDown(e: KeyboardEvent) {\n    if (e.key === 'Enter') {\n      // if dropdown is not open\n      if (this.$openDialog()) {\n        // if dropdown is open\n        // if an option is highlighted, select it\n        if (this.$highlightedOption()) {\n          this.selectValue$.next(this.$highlightedOption()!);\n        } else {\n          // if an option is not highlighted, close the dropdown\n          this.$openDialog()?.ref.close();\n        }\n      }\n      e.preventDefault();\n      e.stopPropagation();\n    }\n    if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n      // if dropdown is open:\n      // - we find the currently HIGHLIGHTED option\n      // - we find the next option to highlight\n      // - if no option is found, we highlight the first/last option\n      // if dropdown is NOT open:\n      // - if this is a multiselect, ignore\n      // - if this is a single select, find the next item to select\n      // - if no item is selected, highlight the first/last item\n\n      if (!this.$openDialog()) {\n        return;\n      }\n\n      let currentIndex = -1;\n      if (this.$highlightedOption()) {\n        currentIndex = this.$options().findIndex(o => o.$value() === this.$highlightedOption()!.$value());\n      }\n      let nextIndex: number;\n      // find the next index to highlight/select\n      if (e.key === 'ArrowDown') {\n        if (currentIndex === -1) {\n          // find the first non disabled option\n          nextIndex = this.$options().findIndex(o => !o.$disabled());\n        } else {\n          // find the next option that is not disabled\n          nextIndex = this.$options().findIndex((o, i) => i > currentIndex && !o.$disabled());\n          // if no option is found, find the next option that is not disabled before the current item\n          if (nextIndex === -1) {\n            nextIndex = this.$options().findIndex((o, i) => i < currentIndex && !o.$disabled());\n          }\n        }\n      } else if (e.key === 'ArrowUp') {\n        if (currentIndex === -1) {\n          // find the last non disabled option\n          nextIndex = this.$options()\n            .slice()\n            .reverse()\n            .findIndex(o => !o.$disabled());\n          if (nextIndex !== -1) {\n            nextIndex = this.$options().length - nextIndex - 1;\n          }\n        } else {\n          const flippedCurrentIndex = this.$options().length - currentIndex - 1;\n          // find the next option that is not disabled\n          nextIndex = [...this.$options()].reverse().findIndex((o, i) => i > flippedCurrentIndex && !o.$disabled());\n          // if no option is found, find the next option that is not disabled before the current item\n          if (nextIndex === -1) {\n            nextIndex = [...this.$options()].reverse().findIndex((o, i) => i < flippedCurrentIndex && !o.$disabled());\n          }\n          if (nextIndex !== -1) {\n            nextIndex = this.$options().length - nextIndex - 1;\n          }\n        }\n      } else {\n        nextIndex = -1;\n      }\n\n      if (nextIndex !== -1) {\n        this.$highlightedOption.set(this.$options()[nextIndex]);\n\n        setTimeout(\n          () =>\n            document.querySelector(`#${this.dropdownId} .option-wrapper.highlight`)?.scrollIntoView({\n              block: 'nearest',\n            }),\n          10,\n        );\n      }\n\n      e.preventDefault();\n      e.stopPropagation();\n    }\n  }\n}\n","<ng-template #dropdownTemplate>\n  <div class=\"dropdown-container\" [id]=\"dropdownId\" [ngStyle]=\"$dropdownContainerCss()\">\n    @if ($dropdownPrefix()) {\n      <div class=\"options-prefix\">\n        <ng-content select=\"tab-prefix\" />\n      </div>\n    }\n    @if ($options().length > 0) {\n      <div class=\"option-values\" [ngStyle]=\"$dropdownOptionsContainerCss()\">\n        @for (option of $options(); track option.$value()) {\n          <!-- eslint-disable-next-line  @angular-eslint/template/interactive-supports-focus, @angular-eslint/template/click-events-have-key-events -->\n          <div\n            class=\"option-wrapper\"\n            [class.disabled]=\"option.$disabled()\"\n            [class.highlight]=\"!!$highlightedOption() && $highlightedOption()!.$value() === option.$value()\"\n            (click)=\"selectValue$.next(option)\"\n            (mousedown)=\"optionMouseDown($event)\"\n            (mouseenter)=\"$highlightedOption.set(option)\"\n          >\n            <div class=\"option-content\">\n              <ng-container [ngTemplateOutlet]=\"option.$template()\" [ngTemplateOutletContext]=\"$dropdownValueTemplateContext()\" />\n            </div>\n          </div>\n        }\n      </div>\n    }\n\n    @if ($dropdownSuffix()) {\n      <div class=\"options-suffix\">\n        <ng-content select=\"tab-suffix\" />\n      </div>\n    }\n  </div>\n</ng-template>\n","import type { OnDestroy } from '@angular/core';\nimport { Directive, effect, ElementRef, HostListener, inject, input } from '@angular/core';\nimport type { Subscription } from 'rxjs';\nimport type { AutoCompleteComponent } from './autocomplete.component';\nimport type { Primitive } from 'tableau-ui-angular/types';\n@Directive({\n  selector: 'input[tabAutoComplete]',\n  standalone: false,\n})\nexport class AutoCompleteDirective<T extends Primitive> implements OnDestroy {\n  private readonly ref = inject<ElementRef<HTMLInputElement>>(ElementRef);\n  readonly $tabAutoComplete = input.required<AutoCompleteComponent<T>>({\n    alias: 'tabAutoComplete',\n  });\n  private autoCompleteSelectedSub: Subscription | undefined = undefined;\n  private readonly autocompleteChanged = effect(() => {\n    const autoComplete = this.$tabAutoComplete();\n    if (this.autoCompleteSelectedSub) {\n      this.autoCompleteSelectedSub.unsubscribe();\n    }\n    this.autoCompleteSelectedSub = autoComplete.selectValue$.subscribe(option => {\n      const el = this.ref.nativeElement;\n      el.value = option.$value()?.toString() ?? '';\n      el.dispatchEvent(new Event('input', { bubbles: true }));\n      autoComplete.closeDropdown();\n    });\n  });\n\n  @HostListener('focusin')\n  onFocusIn() {\n    this.$tabAutoComplete().openDropdown(this.ref.nativeElement);\n  }\n\n  @HostListener('focusout')\n  onFocusOut() {\n    this.$tabAutoComplete().closeDropdown();\n  }\n\n  @HostListener('input')\n  onInput() {\n    this.$tabAutoComplete().openDropdown(this.ref.nativeElement);\n  }\n\n  @HostListener('click')\n  onClick() {\n    this.$tabAutoComplete().openDropdown(this.ref.nativeElement);\n  }\n\n  ngOnDestroy(): void {\n    this.$tabAutoComplete().closeDropdown();\n  }\n}\n","import { NgModule } from '@angular/core';\nimport { AutoCompleteComponent } from './autocomplete.component';\nimport { CommonModule } from '@angular/common';\nimport { AutoCompleteDirective } from './autocomplete.directive';\nimport { TableauUiCommonModule } from 'tableau-ui-angular/common';\nimport { TableauUiDialogModule } from 'tableau-ui-angular/dialog';\n\n@NgModule({\n  imports: [TableauUiCommonModule, CommonModule, TableauUiDialogModule],\n  declarations: [AutoCompleteComponent, AutoCompleteDirective],\n  exports: [AutoCompleteComponent, AutoCompleteDirective],\n})\nexport class TableauUiAutoCompleteModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;MAoBa,qBAAqB,CAAA;AACf,IAAA,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;AACrC,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAE7B,IAAA,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