UNPKG

ngx-bootstrap

Version:
1 lines 113 kB
{"version":3,"file":"ngx-bootstrap-typeahead.mjs","sources":["../../../../src/typeahead/latin-map.ts","../../../../src/typeahead/typeahead-options.class.ts","../../../../src/typeahead/typeahead-match.class.ts","../../../../src/typeahead/typeahead-utils.ts","../../../../src/typeahead/typeahead-animations.ts","../../../../src/typeahead/typeahead-container.component.ts","../../../../src/typeahead/typeahead-container.component.html","../../../../src/typeahead/typeahead.config.ts","../../../../src/typeahead/typeahead.directive.ts","../../../../src/typeahead/typeahead.module.ts","../../../../src/typeahead/ngx-bootstrap-typeahead.ts"],"sourcesContent":["export const latinMap: { [key: string]: string } = {\n 'Á': 'A',\n 'Ă': 'A',\n 'Ắ': 'A',\n 'Ặ': 'A',\n 'Ằ': 'A',\n 'Ẳ': 'A',\n 'Ẵ': 'A',\n 'Ǎ': 'A',\n 'Â': 'A',\n 'Ấ': 'A',\n 'Ậ': 'A',\n 'Ầ': 'A',\n 'Ẩ': 'A',\n 'Ẫ': 'A',\n 'Ä': 'A',\n 'Ǟ': 'A',\n 'Ȧ': 'A',\n 'Ǡ': 'A',\n 'Ạ': 'A',\n 'Ȁ': 'A',\n 'À': 'A',\n 'Ả': 'A',\n 'Ȃ': 'A',\n 'Ā': 'A',\n 'Ą': 'A',\n 'Å': 'A',\n 'Ǻ': 'A',\n 'Ḁ': 'A',\n 'Ⱥ': 'A',\n 'Ã': 'A',\n 'Ꜳ': 'AA',\n 'Æ': 'AE',\n 'Ǽ': 'AE',\n 'Ǣ': 'AE',\n 'Ꜵ': 'AO',\n 'Ꜷ': 'AU',\n 'Ꜹ': 'AV',\n 'Ꜻ': 'AV',\n 'Ꜽ': 'AY',\n 'Ḃ': 'B',\n 'Ḅ': 'B',\n 'Ɓ': 'B',\n 'Ḇ': 'B',\n 'Ƀ': 'B',\n 'Ƃ': 'B',\n 'Ć': 'C',\n 'Č': 'C',\n 'Ç': 'C',\n 'Ḉ': 'C',\n 'Ĉ': 'C',\n 'Ċ': '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'ṻ': 'u',\n 'ų': 'u',\n 'ᶙ': 'u',\n 'ů': 'u',\n 'ũ': 'u',\n 'ṹ': 'u',\n 'ṵ': 'u',\n 'ᵫ': 'ue',\n 'ꝸ': 'um',\n 'ⱴ': 'v',\n 'ꝟ': 'v',\n 'ṿ': 'v',\n 'ʋ': 'v',\n 'ᶌ': 'v',\n 'ⱱ': 'v',\n 'ṽ': 'v',\n 'ꝡ': 'vy',\n 'ẃ': 'w',\n 'ŵ': 'w',\n 'ẅ': 'w',\n 'ẇ': 'w',\n 'ẉ': 'w',\n 'ẁ': 'w',\n 'ⱳ': 'w',\n 'ẘ': 'w',\n 'ẍ': 'x',\n 'ẋ': 'x',\n 'ᶍ': 'x',\n 'ý': 'y',\n 'ŷ': 'y',\n 'ÿ': 'y',\n 'ẏ': 'y',\n 'ỵ': 'y',\n 'ỳ': 'y',\n 'ƴ': 'y',\n 'ỷ': 'y',\n 'ỿ': 'y',\n 'ȳ': 'y',\n 'ẙ': 'y',\n 'ɏ': 'y',\n 'ỹ': 'y',\n 'ź': 'z',\n 'ž': 'z',\n 'ẑ': 'z',\n 'ʑ': 'z',\n 'ⱬ': 'z',\n 'ż': 'z',\n 'ẓ': 'z',\n 'ȥ': 'z',\n 'ẕ': 'z',\n 'ᵶ': 'z',\n 'ᶎ': 'z',\n 'ʐ': 'z',\n 'ƶ': 'z',\n 'ɀ': 'z',\n 'ff': 'ff',\n 'ffi': 'ffi',\n 'ffl': 'ffl',\n 'fi': 'fi',\n 'fl': 'fl',\n 'ij': 'ij',\n 'œ': 'oe',\n 'st': 'st',\n 'ₐ': 'a',\n 'ₑ': 'e',\n 'ᵢ': 'i',\n 'ⱼ': 'j',\n 'ₒ': 'o',\n 'ᵣ': 'r',\n 'ᵤ': 'u',\n 'ᵥ': 'v',\n 'ₓ': 'x'\n};\n","import { TypeaheadDirective } from './typeahead.directive';\n\nexport class TypeaheadOptions {\n placement: string;\n animation: boolean;\n typeaheadRef: TypeaheadDirective;\n\n constructor(options: TypeaheadOptions) {\n this.placement = options.placement;\n this.animation = options.animation;\n this.typeaheadRef = options.typeaheadRef;\n }\n}\n","// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class TypeaheadMatch<ItemType = any> {\n readonly value: string;\n\n readonly item: ItemType;\n protected header: boolean;\n\n constructor(item: ItemType, value = item as string, header = false) {\n this.item = item;\n this.value = value;\n this.header = header;\n }\n\n isHeader(): boolean {\n return this.header;\n }\n\n toString(): string {\n return this.value;\n }\n}\n","import { latinMap } from './latin-map';\n\nexport function latinize(str: string): string {\n if (!str) {\n return '';\n }\n\n return str.replace(/[^A-Za-z0-9[\\] ]/g, function(a: string): string {\n return latinMap[a] || a;\n });\n}\n\nexport function escapeRegexp(queryToEscape: string): string {\n // Regex: capture the whole query string and replace it with the string\n // that will be used to match the results, for example if the capture is\n // 'a' the result will be \\a\n return queryToEscape.replace(/([.?*+^$[\\]\\\\(){}|-])/g, '\\\\$1');\n}\n\nexport function tokenize(str: string,\n wordRegexDelimiters = ' ',\n phraseRegexDelimiters = '', delimitersForMultipleSearch?: string): Array<string> {\n\n let result: string[] = [];\n if (!delimitersForMultipleSearch) {\n result = tokenizeWordsAndPhrases(str, wordRegexDelimiters, phraseRegexDelimiters);\n } else {\n const multipleSearchRegexStr = `([${delimitersForMultipleSearch}]+)`;\n const delimitedTokens = str.split(new RegExp(multipleSearchRegexStr, 'g'));\n const lastToken = delimitedTokens[delimitedTokens.length - 1];\n if (lastToken > '') {\n if (wordRegexDelimiters && phraseRegexDelimiters) {\n result = tokenizeWordsAndPhrases(lastToken, wordRegexDelimiters, phraseRegexDelimiters);\n } else {\n result.push(lastToken);\n }\n }\n }\n\n return result;\n}\n\nfunction tokenizeWordsAndPhrases(str: string, wordRegexDelimiters: string, phraseRegexDelimiters: string): Array<string> {\n const result: string[] = [];\n const regexStr = `(?:[${phraseRegexDelimiters}])([^${phraseRegexDelimiters}]+)` +\n `(?:[${phraseRegexDelimiters}])|([^${wordRegexDelimiters}]+)`;\n const preTokenized: string[] = str.split(new RegExp(regexStr, 'g'));\n const preTokenizedLength: number = preTokenized.length;\n let token: string;\n const replacePhraseDelimiters = new RegExp(`[${phraseRegexDelimiters}]+`, 'g');\n\n for (let i = 0; i < preTokenizedLength; i += 1) {\n token = preTokenized[i];\n if (token && token.length && token !== wordRegexDelimiters) {\n result.push(token.replace(replacePhraseDelimiters, ''));\n }\n }\n\n return result;\n}\n\n// eslint-disable-next-line\nexport function getValueFromObject(object: string | Record<string | number, any>, option?: string): string {\n if (!option || typeof object !== 'object') {\n return object.toString();\n }\n\n if (option.endsWith('()')) {\n const functionName = option.slice(0, option.length - 2);\n\n return (object[functionName] as () => string)().toString();\n }\n\n const properties: string = option\n .replace(/\\[(\\w+)\\]/g, '.$1')\n .replace(/^\\./, '');\n const propertiesArray: string[] = properties.split('.');\n\n for (const property of propertiesArray) {\n if (property in (object as Record<string, unknown>)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n object = object[property];\n }\n }\n if (!object) {\n return '';\n }\n\n return object.toString();\n}\n","import {\n animate,\n style,\n AnimationTriggerMetadata,\n state,\n transition,\n trigger\n} from '@angular/animations';\n\nexport const TYPEAHEAD_ANIMATION_TIMING = '220ms cubic-bezier(0, 0, 0.2, 1)';\n\nexport const typeaheadAnimation: AnimationTriggerMetadata =\n trigger('typeaheadAnimation', [\n state('animated-down', style({ height: '*', overflow: 'hidden'})),\n transition('* => animated-down', [\n style({ height: 0, overflow: 'hidden' }),\n animate(TYPEAHEAD_ANIMATION_TIMING)\n ]),\n state('animated-up', style({ height: '*', overflow: 'hidden'})),\n transition('* => animated-up', [\n style({ height: '*', overflow: 'hidden' }),\n animate(TYPEAHEAD_ANIMATION_TIMING)\n ]),\n transition('* => unanimated', animate('0s'))\n ]);\n","import {\n ChangeDetectorRef,\n Component,\n ElementRef,\n HostListener,\n OnDestroy,\n QueryList,\n Renderer2,\n TemplateRef,\n ViewChild,\n ViewChildren,\n Output,\n EventEmitter\n} from '@angular/core';\n\nimport { Utils } from 'ngx-bootstrap/utils';\nimport { PositioningService } from 'ngx-bootstrap/positioning';\nimport { Subscription } from 'rxjs';\n\nimport { latinize } from './typeahead-utils';\nimport { TypeaheadMatch } from './typeahead-match.class';\nimport { TypeaheadDirective } from './typeahead.directive';\nimport { typeaheadAnimation } from './typeahead-animations';\nimport { TypeaheadOptionItemContext, TypeaheadOptionListContext, TypeaheadTemplateMethods } from './models';\nimport { NgTemplateOutlet, NgFor, NgIf } from '@angular/common';\n\nlet nextWindowId = 0;\n\n@Component({\n selector: 'typeahead-container',\n templateUrl: './typeahead-container.component.html',\n host: {\n class: 'dropdown open bottom dropdown-menu',\n '[style.height]': `needScrollbar ? guiHeight: 'auto'`,\n '[style.visibility]': `'inherit'`,\n '[class.dropup]': 'dropup',\n style: 'position: absolute;display: block;',\n '[attr.role]': `'listbox'`\n },\n styles: [\n `\n :host.dropdown {\n z-index: 1000;\n }\n\n :host.dropdown-menu, .dropdown-menu {\n overflow-y: auto;\n height: 100px;\n }\n `\n ],\n animations: [typeaheadAnimation],\n standalone: true,\n imports: [NgTemplateOutlet, NgFor, NgIf],\n providers: [PositioningService]\n})\n\nexport class TypeaheadContainerComponent implements OnDestroy {\n // eslint-disable-next-line @angular-eslint/no-output-rename\n @Output('activeChange') activeChangeEvent = new EventEmitter();\n\n parent?: TypeaheadDirective;\n query?: string[] | string;\n isFocused = false;\n top?: string;\n left?: string;\n display?: string;\n placemen?: string;\n dropup?: boolean;\n guiHeight?: string;\n needScrollbar?: boolean;\n animationState?: string;\n positionServiceSubscription = new Subscription();\n height = 0;\n popupId = `ngb-typeahead-${nextWindowId++}`;\n\n get typeaheadTemplateMethods(): TypeaheadTemplateMethods {\n return {\n selectMatch: this.selectMatch.bind(this),\n selectActive: this.selectActive.bind(this),\n isActive: this.isActive.bind(this)\n };\n }\n\n protected _active?: TypeaheadMatch;\n protected _matches: TypeaheadMatch[] = [];\n\n @ViewChild('ulElement', { static: false })\n private ulElement?: ElementRef;\n\n @ViewChildren('liElements')\n private liElements?: QueryList<ElementRef>;\n\n constructor(\n private positionService: PositioningService,\n private renderer: Renderer2,\n public element: ElementRef,\n private changeDetectorRef: ChangeDetectorRef\n ) {\n this.renderer.setAttribute(this.element.nativeElement, 'id', this.popupId);\n this.positionServiceSubscription.add(this.positionService.event$?.subscribe(\n () => {\n if (this.isAnimated) {\n this.animationState = this.isTopPosition ? 'animated-up' : 'animated-down';\n this.changeDetectorRef.detectChanges();\n\n return;\n }\n\n this.animationState = 'unanimated';\n this.changeDetectorRef.detectChanges();\n }\n ));\n }\n\n get active(): TypeaheadMatch | undefined {\n return this._active;\n }\n\n set active(active: TypeaheadMatch | undefined) {\n this._active = active;\n this.activeChanged();\n }\n\n get matches(): TypeaheadMatch[] {\n return this._matches;\n }\n\n set matches(value: TypeaheadMatch[]) {\n this.positionService.setOptions({\n modifiers: { flip: { enabled: this.adaptivePosition } },\n allowedPositions: ['top', 'bottom']\n });\n\n this._matches = value;\n\n this.needScrollbar = this.typeaheadScrollable && this.typeaheadOptionsInScrollableView < this.matches.length;\n\n if (this.typeaheadScrollable) {\n setTimeout(() => {\n this.setScrollableMode();\n });\n }\n\n if (this.typeaheadIsFirstItemActive && this._matches.length > 0) {\n this.setActive(this._matches[0]);\n\n if (this._active?.isHeader()) {\n this.nextActiveMatch();\n }\n }\n\n if (this._active && !this.typeaheadIsFirstItemActive) {\n const concurrency = this._matches.find(match => match.value === this._active?.value);\n\n if (concurrency) {\n this.selectActive(concurrency);\n\n return;\n }\n\n this.active = void 0;\n }\n }\n\n get isTopPosition(): boolean {\n return this.element.nativeElement.classList.contains('top');\n }\n\n get optionsListTemplate(): TemplateRef<TypeaheadOptionListContext> | undefined {\n return this.parent ? this.parent.optionsListTemplate : undefined;\n }\n\n get isAnimated(): boolean {\n return this.parent ? this.parent.isAnimated : false;\n }\n\n get adaptivePosition(): boolean {\n return this.parent ? this.parent.adaptivePosition : false;\n }\n\n get typeaheadScrollable(): boolean {\n return this.parent ? this.parent.typeaheadScrollable : false;\n }\n\n get typeaheadOptionsInScrollableView(): number {\n return this.parent ? this.parent.typeaheadOptionsInScrollableView : 5;\n }\n\n get typeaheadIsFirstItemActive(): boolean {\n return this.parent ? this.parent.typeaheadIsFirstItemActive : true;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get itemTemplate(): TemplateRef<TypeaheadOptionItemContext> | undefined {\n return this.parent ? this.parent.typeaheadItemTemplate : undefined;\n }\n\n get canSelectItemsOnBlur(): boolean {\n return !!this.parent?.selectItemOnBlur;\n }\n\n selectActiveMatch(isActiveItemChanged?: boolean): void {\n if (this._active && this.parent?.typeaheadSelectFirstItem) {\n this.selectMatch(this._active);\n }\n\n if (!this.parent?.typeaheadSelectFirstItem && isActiveItemChanged) {\n this.selectMatch(this._active);\n }\n }\n\n activeChanged(): void {\n if (!this._active) {\n return;\n }\n const index = this.matches.indexOf(this._active);\n this.activeChangeEvent.emit(`${this.popupId}-${index}`);\n }\n\n prevActiveMatch(): void {\n if (!this._active) {\n return;\n }\n\n const index = this.matches.indexOf(this._active);\n this.setActive(this.matches[\n index - 1 < 0 ? this.matches.length - 1 : index - 1\n ]);\n\n if (this._active.isHeader()) {\n this.prevActiveMatch();\n }\n\n if (this.typeaheadScrollable) {\n this.scrollPrevious(index);\n }\n }\n\n nextActiveMatch(): void {\n const index = this._active ? this.matches.indexOf(this._active) : -1;\n this.setActive(this.matches[\n index + 1 > this.matches.length - 1 ? 0 : index + 1\n ]);\n\n if (this._active?.isHeader()) {\n this.nextActiveMatch();\n }\n\n if (this.typeaheadScrollable) {\n this.scrollNext(index);\n }\n }\n\n selectActive(value: TypeaheadMatch): void {\n this.isFocused = true;\n this.setActive(value);\n }\n\n highlight(match: TypeaheadMatch, query: string[] | string): string {\n let itemStr: string = match.value;\n let itemStrHelper: string = (this.parent && this.parent.typeaheadLatinize\n ? latinize(itemStr)\n : itemStr).toLowerCase();\n let startIdx: number;\n let tokenLen: number;\n // Replaces the capture string with the same string inside of a \"strong\" tag\n if (typeof query === 'object') {\n const queryLen: number = query.length;\n for (let i = 0; i < queryLen; i += 1) {\n // query[i] is already latinized and lower case\n startIdx = itemStrHelper.indexOf(query[i]);\n tokenLen = query[i].length;\n if (startIdx >= 0 && tokenLen > 0) {\n itemStr =\n `${itemStr.substring(0, startIdx)}<strong>${itemStr.substring(startIdx, startIdx + tokenLen)}</strong>` +\n `${itemStr.substring(startIdx + tokenLen)}`;\n itemStrHelper =\n `${itemStrHelper.substring(0, startIdx)}????????${'??'.repeat(tokenLen)}??????????` +\n `${itemStrHelper.substring(startIdx + tokenLen)}`;\n }\n }\n } else if (query) {\n // query is already latinized and lower case\n startIdx = itemStrHelper.indexOf(query);\n tokenLen = query.length;\n if (startIdx >= 0 && tokenLen > 0) {\n itemStr =\n `${itemStr.substring(0, startIdx)}<strong>${itemStr.substring(startIdx, startIdx + tokenLen)}</strong>` +\n `${itemStr.substring(startIdx + tokenLen)}`;\n }\n }\n\n return itemStr;\n }\n\n @HostListener('mouseleave')\n @HostListener('blur')\n focusLost(): void {\n this.isFocused = false;\n if (!this.canSelectItemsOnBlur) {\n this.setActive(void 0);\n }\n }\n\n isActive(value: TypeaheadMatch): boolean {\n return this.active === value;\n }\n\n selectMatch(value?: TypeaheadMatch, event?: Event): boolean {\n if (event) {\n event.stopPropagation();\n event.preventDefault();\n }\n this.parent?.changeModel(value);\n setTimeout(() => this.parent?.typeaheadOnSelect.emit(value), 0);\n\n return false;\n }\n\n setScrollableMode(): void {\n if (!this.ulElement) {\n this.ulElement = this.element;\n }\n\n if (this.liElements?.first) {\n const ulStyles = Utils.getStyles(this.ulElement.nativeElement);\n const liStyles = Utils.getStyles(this.liElements.first.nativeElement);\n const ulPaddingBottom = parseFloat((ulStyles['padding-bottom'] ? ulStyles['padding-bottom'] : '')\n .replace('px', ''));\n const ulPaddingTop = parseFloat((ulStyles['padding-top'] ? ulStyles['padding-top'] : '0')\n .replace('px', ''));\n const optionHeight = parseFloat((liStyles.height ? liStyles.height : '0')\n .replace('px', ''));\n const height = this.typeaheadOptionsInScrollableView * optionHeight;\n this.guiHeight = `${height + ulPaddingTop + ulPaddingBottom}px`;\n }\n\n this.renderer.setStyle(this.element.nativeElement, 'visibility', 'visible');\n }\n\n scrollPrevious(index: number): void {\n if (index === 0) {\n this.scrollToBottom();\n\n return;\n }\n if (this.liElements && this.ulElement) {\n const liElement = this.liElements.toArray()[index - 1];\n if (liElement && !this.isScrolledIntoView(liElement.nativeElement)) {\n this.ulElement.nativeElement.scrollTop = liElement.nativeElement.offsetTop;\n }\n }\n }\n\n scrollNext(index: number): void {\n if (index + 1 > this.matches.length - 1) {\n this.scrollToTop();\n\n return;\n }\n if (this.liElements && this.ulElement) {\n const liElement = this.liElements.toArray()[index + 1];\n if (liElement && !this.isScrolledIntoView(liElement.nativeElement)) {\n this.ulElement.nativeElement.scrollTop =\n liElement.nativeElement.offsetTop -\n Number(this.ulElement.nativeElement.offsetHeight) +\n Number(liElement.nativeElement.offsetHeight);\n }\n }\n }\n\n ngOnDestroy(): void {\n this.positionServiceSubscription.unsubscribe();\n }\n\n protected setActive(value?: TypeaheadMatch): void {\n this._active = value;\n let preview;\n if (!(this._active == null || this._active.isHeader())) {\n preview = value;\n }\n this.parent?.typeaheadOnPreview.emit(preview);\n }\n\n private isScrolledIntoView(elem: HTMLElement): boolean {\n if (!this.ulElement) {\n return false;\n }\n const containerViewTop: number = this.ulElement.nativeElement.scrollTop;\n const containerViewBottom = containerViewTop + Number(this.ulElement.nativeElement.offsetHeight);\n const elemTop = elem.offsetTop;\n const elemBottom = elemTop + elem.offsetHeight;\n\n return ((elemBottom <= containerViewBottom) && (elemTop >= containerViewTop));\n }\n\n private scrollToBottom(): void {\n if (!this.ulElement?.nativeElement) {\n return;\n }\n this.ulElement.nativeElement.scrollTop = this.ulElement.nativeElement.scrollHeight;\n }\n\n private scrollToTop(): void {\n if (!this.ulElement?.nativeElement) {\n return;\n }\n this.ulElement.nativeElement.scrollTop = 0;\n }\n}\n","<!-- inject options list template -->\n<ng-template [ngTemplateOutlet]=\"optionsListTemplate || bs4Template\"\n [ngTemplateOutletContext]=\"{\n matches: matches,\n itemTemplate: itemTemplate || bsItemTemplate,\n query: query,\n $implicit: typeaheadTemplateMethods\n }\">\n</ng-template>\n\n<!-- default options item template -->\n<ng-template #bsItemTemplate let-match=\"match\" let-query=\"query\">\n <span [innerHtml]=\"highlight(match, query)\"></span>\n</ng-template>\n\n<!-- Bootstrap 4 options list template -->\n<ng-template #bs4Template>\n <ng-template ngFor let-match let-i=\"index\" [ngForOf]=\"matches\">\n <h6 *ngIf=\"match.isHeader()\" class=\"dropdown-header\">{{ match }}</h6>\n <ng-template [ngIf]=\"!match.isHeader()\">\n <button #liElements\n [id]=\"popupId + '-' + i\"\n role=\"option\"\n [@typeaheadAnimation]=\"animationState\"\n class=\"dropdown-item\"\n (click)=\"selectMatch(match, $event)\"\n (mouseenter)=\"selectActive(match)\"\n [class.active]=\"isActive(match)\">\n <ng-template [ngTemplateOutlet]=\"itemTemplate || bsItemTemplate\"\n [ngTemplateOutletContext]=\"{item: match.item, index: i, match: match, query: query}\">\n </ng-template>\n </button>\n </ng-template>\n </ng-template>\n</ng-template>\n","import { Injectable } from '@angular/core';\n\n/** Default values provider for typeahead */\n@Injectable({ providedIn: 'root' })\nexport class TypeaheadConfig {\n /** sets use adaptive position */\n adaptivePosition = false;\n /** turn on/off animation */\n isAnimated = false;\n /** used to hide results on blur */\n hideResultsOnBlur = true;\n /** if true, typeahead will cancel async request on blur */\n cancelRequestOnFocusLost = false;\n /** used to choose the first item in typeahead container */\n selectFirstItem = true;\n /** used to active/inactive the first item in typeahead container */\n isFirstItemActive = true;\n /** used to choose set minimal no of characters that needs to\n * be entered before typeahead kicks-in\n */\n minLength = 1;\n /**\n * used to choose item on blur event\n */\n selectItemOnBlur = false;\n}\n","import {\n ChangeDetectorRef,\n Directive,\n ElementRef,\n EventEmitter,\n HostListener,\n Input,\n OnDestroy,\n OnInit,\n Output,\n Renderer2,\n TemplateRef,\n ViewContainerRef\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { ComponentLoader, ComponentLoaderFactory } from 'ngx-bootstrap/component-loader';\n\nimport { EMPTY, from, isObservable, Observable, Subscription } from 'rxjs';\nimport { debounceTime, filter, mergeMap, switchMap, tap, toArray } from 'rxjs/operators';\nimport { TypeaheadOptionItemContext, TypeaheadOptionListContext } from './models';\n\nimport { TypeaheadContainerComponent } from './typeahead-container.component';\nimport { TypeaheadMatch } from './typeahead-match.class';\nimport { TypeaheadOrder } from './typeahead-order.class';\nimport { getValueFromObject, latinize, tokenize } from './typeahead-utils';\nimport { TypeaheadConfig } from './typeahead.config';\nimport { PositioningService } from 'ngx-bootstrap/positioning';\n\n// eslint-disable-next-line\ntype TypeaheadOption = string | Record<string | number, any>;\ntype TypeaheadOptionArr = TypeaheadOption[] | Observable<TypeaheadOption>;\n\n@Directive({\n selector: '[typeahead]',\n exportAs: 'bs-typeahead',\n host: {\n '[attr.aria-activedescendant]': 'activeDescendant',\n '[attr.aria-owns]': 'isOpen ? this._container.popupId : null',\n '[attr.aria-expanded]': 'isOpen',\n '[attr.aria-autocomplete]': 'list'\n },\n standalone: true,\n providers: [ComponentLoaderFactory, PositioningService]\n})\nexport class TypeaheadDirective implements OnInit, OnDestroy {\n /** options source, can be Array of strings, objects or\n * an Observable for external matching process\n */\n @Input() typeahead?: TypeaheadOptionArr;\n /** minimal no of characters that needs to be entered before\n * typeahead kicks-in. When set to 0, typeahead shows on focus with full\n * list of options (limited as normal by typeaheadOptionsLimit)\n */\n @Input() typeaheadMinLength = 1;\n /** sets use adaptive position */\n @Input() adaptivePosition = false;\n /** turn on/off animation */\n @Input() isAnimated = false;\n /** minimal wait time after last character typed before typeahead kicks-in */\n @Input() typeaheadWaitMs = 0;\n /** maximum length of options items list. The default value is 20 */\n @Input() typeaheadOptionsLimit?: number;\n /** when options source is an array of objects, the name of field\n * that contains the options value, we use array item as option in case\n * of this field is missing. Supports nested properties and methods.\n */\n @Input() typeaheadOptionField?: string;\n /** when options source is an array of objects, the name of field that\n * contains the group value, matches are grouped by this field when set.\n */\n @Input() typeaheadGroupField?: string;\n /** Used to specify a custom order of matches. When options source is an array of objects\n * a field for sorting has to be set up. In case of options source is an array of string,\n * a field for sorting is absent. The ordering direction could be changed to ascending or descending.\n */\n @Input() typeaheadOrderBy?: TypeaheadOrder;\n /** should be used only in case of typeahead attribute is Observable of array.\n * If true - loading of options will be async, otherwise - sync.\n * true make sense if options array is large.\n */\n @Input() typeaheadAsync?: boolean;\n /** match latin symbols.\n * If true the word súper would match super and vice versa.\n */\n @Input() typeaheadLatinize = true;\n /** Can be use to search words by inserting a single white space between each characters\n * for example 'C a l i f o r n i a' will match 'California'.\n */\n @Input() typeaheadSingleWords = true;\n /** should be used only in case typeaheadSingleWords attribute is true.\n * Sets the word delimiter to break words. Defaults to space.\n */\n @Input() typeaheadWordDelimiters = ' ';\n /** Can be used to conduct a search of multiple items and have suggestion not for the\n * whole value of the input but for the value that comes after a delimiter provided via\n * typeaheadMultipleSearchDelimiters attribute. This option can only be used together with\n * typeaheadSingleWords option if typeaheadWordDelimiters and typeaheadPhraseDelimiters\n * are different from typeaheadMultipleSearchDelimiters to avoid conflict in determining\n * when to delimit multiple searches and when a single word.\n */\n @Input() typeaheadMultipleSearch?: boolean;\n /** should be used only in case typeaheadMultipleSearch attribute is true.\n * Sets the multiple search delimiter to know when to start a new search. Defaults to comma.\n * If space needs to be used, then explicitly set typeaheadWordDelimiters to something else than space\n * because space is used by default OR set typeaheadSingleWords attribute to false if you don't need\n * to use it together with multiple search.\n */\n @Input() typeaheadMultipleSearchDelimiters = ',';\n /** should be used only in case typeaheadSingleWords attribute is true.\n * Sets the word delimiter to match exact phrase.\n * Defaults to simple and double quotes.\n */\n @Input() typeaheadPhraseDelimiters = '\\'\"';\n /** used to specify a custom item template.\n * Template variables exposed are called item and index;\n */\n @Input() typeaheadItemTemplate?: TemplateRef<TypeaheadOptionItemContext>;\n /** used to specify a custom options list template.\n * Template variables: matches, itemTemplate, query\n */\n @Input() optionsListTemplate?: TemplateRef<TypeaheadOptionListContext>;\n /** specifies if typeahead is scrollable */\n @Input() typeaheadScrollable = false;\n /** specifies number of options to show in scroll view */\n @Input() typeaheadOptionsInScrollableView = 5;\n /** used to hide result on blur */\n @Input() typeaheadHideResultsOnBlur?: boolean;\n /** fired when an options list was opened and the user clicked Tab\n * If a value equal true, it will be chosen first or active item in the list\n * If value equal false, it will be chosen an active item in the list or nothing\n */\n @Input() typeaheadSelectFirstItem = true;\n /** makes active first item in a list */\n @Input() typeaheadIsFirstItemActive = true;\n /** fired when 'busy' state of this component was changed,\n * fired on async mode only, returns boolean\n */\n @Output() typeaheadLoading = new EventEmitter<boolean>();\n /** fired on every key event and returns true\n * in case of matches are not detected\n */\n @Output() typeaheadNoResults = new EventEmitter<boolean>();\n /** fired when option was selected, return object with data of this option. */\n @Output() typeaheadOnSelect = new EventEmitter<TypeaheadMatch>();\n /** fired when option was previewed, return object with data of this option. */\n @Output() typeaheadOnPreview = new EventEmitter<TypeaheadMatch>();\n /** fired when blur event occurs. returns the active item */\n @Output() typeaheadOnBlur = new EventEmitter<TypeaheadMatch | undefined>();\n\n /**\n * A selector specifying the element the typeahead should be appended to.\n */\n @Input() container?: string;\n\n /** This attribute indicates that the dropdown should be opened upwards */\n @Input() dropup = false;\n\n // not yet implemented\n /** if false restrict model values to the ones selected from the popup only will be provided */\n // @Input() protected typeaheadEditable:boolean;\n /** if false the first match automatically will not be focused as you type */\n // @Input() protected typeaheadFocusFirst:boolean;\n /** format the ng-model result after selection */\n // @Input() protected typeaheadInputFormatter:any;\n /** if true automatically select an item when there is one option that exactly matches the user input */\n // @Input() protected typeaheadSelectOnExact:boolean;\n /** if true select the currently highlighted match on blur */\n // @Input() protected typeaheadSelectOnBlur:boolean;\n /** if false don't focus the input element the typeahead directive is associated with on selection */\n // @Input() protected typeaheadFocusOnSelect:boolean;\n\n activeDescendant?: string;\n isOpen = false;\n list = 'list';\n _container?: TypeaheadContainerComponent;\n isActiveItemChanged = false;\n isFocused = false;\n cancelRequestOnFocusLost = false;\n selectItemOnBlur = false;\n protected keyUpEventEmitter = new EventEmitter<string>();\n protected placement = 'bottom left';\n protected _matches: TypeaheadMatch[] = [];\n\n private _typeahead: ComponentLoader<TypeaheadContainerComponent>;\n private _subscriptions: Subscription[] = [];\n private _allEnteredValue?: string;\n private _outsideClickListener: () => void = () => void 0;\n\n constructor(\n cis: ComponentLoaderFactory,\n config: TypeaheadConfig,\n private changeDetection: ChangeDetectorRef,\n private element: ElementRef,\n private ngControl: NgControl,\n private renderer: Renderer2,\n viewContainerRef: ViewContainerRef\n ) {\n this._typeahead = cis\n .createLoader<TypeaheadContainerComponent>(element, viewContainerRef, renderer)\n .provide({ provide: TypeaheadConfig, useValue: config });\n\n Object.assign(this, {\n typeaheadHideResultsOnBlur: config.hideResultsOnBlur,\n cancelRequestOnFocusLost: config.cancelRequestOnFocusLost,\n typeaheadSelectFirstItem: config.selectFirstItem,\n typeaheadIsFirstItemActive: config.isFirstItemActive,\n typeaheadMinLength: config.minLength,\n adaptivePosition: config.adaptivePosition,\n isAnimated: config.isAnimated,\n selectItemOnBlur: config.selectItemOnBlur\n });\n }\n\n get matches(): TypeaheadMatch[] {\n return this._matches;\n }\n\n ngOnInit(): void {\n this.typeaheadOptionsLimit = this.typeaheadOptionsLimit || 20;\n\n this.typeaheadMinLength = this.typeaheadMinLength === void 0 ? 1 : this.typeaheadMinLength;\n\n // async should be false in case of array\n if (this.typeaheadAsync === undefined && !isObservable(this.typeahead)) {\n this.typeaheadAsync = false;\n }\n\n if (isObservable(this.typeahead)) {\n this.typeaheadAsync = true;\n }\n\n if (this.typeaheadAsync) {\n this.asyncActions();\n } else {\n this.syncActions();\n }\n\n this.checkDelimitersConflict();\n }\n\n @HostListener('input', ['$event'])\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onInput(e: any): void {\n // For `<input>`s, use the `value` property. For others that don't have a\n // `value` (such as `<span contenteditable=\"true\">`), use either\n // `textContent` or `innerText` (depending on which one is supported, i.e.\n // Firefox or IE).\n const value =\n e.target.value !== undefined\n ? e.target.value\n : e.target.textContent !== undefined\n ? e.target.textContent\n : e.target.innerText;\n\n if (value != null && value.trim().length >= this.typeaheadMinLength) {\n this.typeaheadLoading.emit(true);\n this.keyUpEventEmitter.emit(e.target.value);\n } else {\n this.typeaheadLoading.emit(false);\n this.typeaheadNoResults.emit(false);\n this.hide();\n }\n }\n\n @HostListener('keyup', ['$event'])\n onChange(event: KeyboardEvent): void {\n if (this._container) {\n // esc\n if (event.keyCode === 27 || event.key === 'Escape') {\n this.hide();\n\n return;\n }\n\n // up\n if (event.keyCode === 38 || event.key === 'ArrowUp') {\n this.isActiveItemChanged = true;\n this._container.prevActiveMatch();\n\n return;\n }\n\n // down\n if (event.keyCode === 40 || event.key === 'ArrowDown') {\n this.isActiveItemChanged = true;\n this._container.nextActiveMatch();\n\n return;\n }\n\n // enter\n if (event.keyCode === 13 || event.key === 'Enter') {\n this._container.selectActiveMatch();\n\n return;\n }\n }\n }\n\n @HostListener('click')\n @HostListener('focus')\n onFocus(): void {\n this.isFocused = true;\n // add setTimeout to fix issue #5251\n // to get and emit updated value if it's changed on focus\n setTimeout(() => {\n if (this.typeaheadMinLength === 0) {\n this.typeaheadLoading.emit(true);\n this.keyUpEventEmitter.emit(this.element.nativeElement.value || '');\n }\n }, 0);\n }\n\n @HostListener('blur')\n onBlur(): void {\n this.isFocused = false;\n if (this._container && !this._container.isFocused) {\n this.typeaheadOnBlur.emit(this._container.active);\n }\n\n if (!this.container && this._matches?.length === 0) {\n this.typeaheadOnBlur.emit(\n new TypeaheadMatch(this.element.nativeElement.value, this.element.nativeElement.value, false)\n );\n }\n }\n\n @HostListener('keydown', ['$event'])\n onKeydown(event: KeyboardEvent): void {\n // no container - no problems\n if (!this._container) {\n return;\n }\n\n if (event.keyCode === 9 || event.key === 'Tab') {\n this.onBlur();\n }\n\n if (event.keyCode === 9 || event.key === 'Tab' || event.keyCode === 13 || event.key === 'Enter') {\n event.preventDefault();\n if (this.typeaheadSelectFirstItem) {\n this._container.selectActiveMatch();\n\n return;\n }\n\n if (!this.typeaheadSelectFirstItem) {\n this._container.selectActiveMatch(this.isActiveItemChanged);\n this.isActiveItemChanged = false;\n this.hide();\n }\n }\n }\n\n changeModel(match?: TypeaheadMatch): void {\n if (!match) {\n return;\n }\n let valueStr: string;\n if (this.typeaheadMultipleSearch && this._allEnteredValue) {\n const tokens = this._allEnteredValue.split(new RegExp(`([${this.typeaheadMultipleSearchDelimiters}]+)`));\n this._allEnteredValue = tokens\n .slice(0, tokens.length - 1)\n .concat(match.value)\n .join('');\n valueStr = this._allEnteredValue;\n } else {\n valueStr = match.value;\n }\n this.ngControl.viewToModelUpdate(valueStr);\n this.ngControl.control?.setValue(valueStr);\n this.changeDetection.markForCheck();\n this.hide();\n }\n\n show(): void {\n this._typeahead\n .attach(TypeaheadContainerComponent)\n .to(this.container)\n .position({ attachment: `${this.dropup ? 'top' : 'bottom'} left` })\n .show({\n typeaheadRef: this,\n placement: this.placement,\n animation: false,\n dropup: this.dropup\n });\n\n this._outsideClickListener = this.renderer.listen('document', 'click', (event: MouseEvent) => {\n if (this.typeaheadMinLength === 0 && this.element.nativeElement.contains(event.target)) {\n return;\n }\n if (!this.typeaheadHideResultsOnBlur || this.element.nativeElement.contains(event.target)) {\n return;\n }\n this.onOutsideClick();\n });\n\n if (!this._typeahead.instance || !this.ngControl.control) {\n return;\n }\n\n this._container = this._typeahead.instance;\n this._container.parent = this;\n // This improves the speed as it won't have to be done for each list item\n\n const normalizedQuery = (\n this.typeaheadLatinize ? latinize(this.ngControl.control.value) : this.ngControl.control.value\n )\n .toString()\n .toLowerCase();\n\n this._container.query = this.tokenizeQuery(normalizedQuery);\n\n this._container.matches = this._matches;\n this.element.nativeElement.focus();\n\n this._container.activeChangeEvent.subscribe((activeId: string) => {\n this.activeDescendant = activeId;\n this.changeDetection.markForCheck();\n });\n this.isOpen = true;\n }\n\n hide(): void {\n if (this._typeahead.isShown) {\n this._typeahead.hide();\n this._outsideClickListener();\n this._container = void 0;\n this.isOpen = false;\n this.changeDetection.markForCheck();\n }\n this.typeaheadOnPreview.emit();\n }\n\n onOutsideClick(): void {\n if (this._container && !this._container.isFocused) {\n this.hide();\n }\n }\n\n ngOnDestroy() {\n // clean up subscriptions\n for (const sub of this._subscriptions) {\n sub.unsubscribe();\n }\n this._typeahead.dispose();\n }\n\n protected asyncActions(): void {\n this._subscriptions.push(\n this.keyUpEventEmitter\n .pipe(\n debounceTime<string>(this.typeaheadWaitMs),\n tap((value) => (this._allEnteredValue = value)),\n switchMap(() => {\n if (!this.typeahead) {\n return EMPTY;\n }\n return this.typeahead;\n })\n )\n .subscribe((matches) => {\n this.finalizeAsyncCall(matches);\n })\n );\n }\n\n protected syncActions(): void {\n this._subscriptions.push(\n this.keyUpEventEmitter\n .pipe(\n debounceTime<string>(this.typeaheadWaitMs),\n mergeMap((value: string) => {\n this._allEnteredValue = value;\n const normalizedQuery = this.normalizeQuery(value);\n\n if (!this.typeahead) {\n return EMPTY;\n }\n\n const typeahead = isObservable(this.typeahead) ? this.typeahead : from(this.typeahead);\n\n return typeahead.pipe(\n filter((option: TypeaheadOptio