UNPKG

@ng-bootstrap/ng-bootstrap

Version:
1 lines 41.2 kB
{"version":3,"file":"ng-bootstrap-ng-bootstrap-typeahead.mjs","sources":["../../../src/typeahead/highlight.ts","../../../src/typeahead/typeahead-config.ts","../../../src/typeahead/typeahead-window.ts","../../../src/typeahead/typeahead.ts","../../../src/typeahead/typeahead.module.ts","../../../src/typeahead/ng-bootstrap-ng-bootstrap-typeahead.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges, ViewEncapsulation } from '@angular/core';\nimport { regExpEscape, removeAccents, toString } from './_ngb-ngbootstrap-utilities.mjs';\n\n/**\n * A component that helps with text highlighting.\n *\n * It splits the `result` text into parts that contain the searched `term` and generates the HTML markup to simplify\n * highlighting:\n *\n * Ex. `result=\"Alaska\"` and `term=\"as\"` will produce `Al<span class=\"ngb-highlight\">as</span>ka`.\n */\n@Component({\n\tselector: 'ngb-highlight',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tencapsulation: ViewEncapsulation.None,\n\ttemplate: `\n\t\t@for (part of parts; track $index) {\n\t\t\t@if ($odd) {\n\t\t\t\t<span class=\"{{ highlightClass }}\">{{ part }}</span>\n\t\t\t} @else {\n\t\t\t\t<ng-container>{{ part }}</ng-container>\n\t\t\t}\n\t\t}\n\t`,\n\tstyleUrl: './highlight.scss',\n})\nexport class NgbHighlight implements OnChanges {\n\tparts: string[];\n\n\t/**\n\t * The CSS class for `<span>` elements wrapping the `term` inside the `result`.\n\t */\n\t@Input() highlightClass = 'ngb-highlight';\n\n\t/**\n\t * The text highlighting is added to.\n\t *\n\t * If the `term` is found inside this text, it will be highlighted.\n\t * If the `term` contains array then all the items from it will be highlighted inside the text.\n\t */\n\t@Input({ required: true }) result?: string | null;\n\n\t/**\n\t * The term or array of terms to be highlighted.\n\t * Since version `v4.2.0` term could be a `string[]`\n\t */\n\t@Input({ required: true }) term: string | readonly string[];\n\n\t/**\n\t * Boolean option to determine if the highlighting should be sensitive to accents or not.\n\t *\n\t * This feature is only available for browsers that implement the `String.normalize` function\n\t * (typically not Internet Explorer).\n\t * If you want to use this feature in a browser that does not implement `String.normalize`,\n\t * you will have to include a polyfill in your application (`unorm` for example).\n\t *\n\t * @since 9.1.0\n\t */\n\t@Input() accentSensitive = true;\n\n\tngOnChanges(changes: SimpleChanges) {\n\t\tif (!this.accentSensitive && !String.prototype.normalize) {\n\t\t\tconsole.warn(\n\t\t\t\t'The `accentSensitive` input in `ngb-highlight` cannot be set to `false` in a browser ' +\n\t\t\t\t\t'that does not implement the `String.normalize` function. ' +\n\t\t\t\t\t'You will have to include a polyfill in your application to use this feature in the current browser.',\n\t\t\t);\n\t\t\tthis.accentSensitive = true;\n\t\t}\n\t\tconst result = toString(this.result);\n\n\t\tconst terms = Array.isArray(this.term) ? this.term : [this.term];\n\t\tconst prepareTerm = (term) => (this.accentSensitive ? term : removeAccents(term));\n\t\tconst escapedTerms = terms.map((term) => regExpEscape(prepareTerm(toString(term)))).filter((term) => term);\n\t\tconst toSplit = this.accentSensitive ? result : removeAccents(result);\n\n\t\tconst parts = escapedTerms.length ? toSplit.split(new RegExp(`(${escapedTerms.join('|')})`, 'gmi')) : [result];\n\n\t\tif (this.accentSensitive) {\n\t\t\tthis.parts = parts;\n\t\t} else {\n\t\t\tlet offset = 0;\n\t\t\tthis.parts = parts.map((part) => result.substring(offset, (offset += part.length)));\n\t\t}\n\t}\n}\n","import { Injectable } from '@angular/core';\nimport { PlacementArray } from './_ngb-ngbootstrap-utilities.mjs';\nimport { Options } from '@popperjs/core';\n\n/**\n * A configuration service for the [`NgbTypeahead`](#/components/typeahead/api#NgbTypeahead) component.\n *\n * You can inject this service, typically in your root component, and customize the values of its properties in\n * order to provide default values for all the typeaheads used in the application.\n */\n@Injectable({ providedIn: 'root' })\nexport class NgbTypeaheadConfig {\n\tcontainer;\n\teditable = true;\n\tfocusFirst = true;\n\tselectOnExact = false;\n\tshowHint = false;\n\tplacement: PlacementArray = ['bottom-start', 'bottom-end', 'top-start', 'top-end'];\n\tpopperOptions = (options: Partial<Options>) => options;\n}\n","import { Component, EventEmitter, Input, OnInit, Output, TemplateRef, ViewEncapsulation } from '@angular/core';\n\nimport { toString } from './_ngb-ngbootstrap-utilities.mjs';\nimport { NgbHighlight } from './highlight';\nimport { NgTemplateOutlet } from '@angular/common';\n\n/**\n * The context for the typeahead result template in case you want to override the default one.\n */\nexport interface ResultTemplateContext {\n\t/**\n\t * Your typeahead result item.\n\t */\n\tresult: any;\n\n\t/**\n\t * Search term from the `<input>` used to get current result.\n\t */\n\tterm: string;\n\n\t/**\n\t * The function which transforms the result into a string\n\t */\n\tformatter: (result: any) => string;\n}\n\n@Component({\n\tselector: 'ngb-typeahead-window',\n\texportAs: 'ngbTypeaheadWindow',\n\timports: [NgbHighlight, NgTemplateOutlet],\n\tencapsulation: ViewEncapsulation.None,\n\thost: {\n\t\t'(mousedown)': '$event.preventDefault()',\n\t\t'[class]': '\"dropdown-menu show\" + (popupClass ? \" \" + popupClass : \"\")',\n\t\trole: 'listbox',\n\t\t'[id]': 'id',\n\t},\n\ttemplate: `\n\t\t<ng-template #rt let-result=\"result\" let-term=\"term\" let-formatter=\"formatter\">\n\t\t\t<ngb-highlight [result]=\"formatter(result)\" [term]=\"term\" />\n\t\t</ng-template>\n\t\t@for (result of results; track $index) {\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"dropdown-item\"\n\t\t\t\trole=\"option\"\n\t\t\t\t[id]=\"id + '-' + $index\"\n\t\t\t\t[class.active]=\"$index === activeIdx\"\n\t\t\t\t(mouseenter)=\"markActive($index)\"\n\t\t\t\t(click)=\"select(result)\"\n\t\t\t>\n\t\t\t\t<ng-template\n\t\t\t\t\t[ngTemplateOutlet]=\"resultTemplate || rt\"\n\t\t\t\t\t[ngTemplateOutletContext]=\"{ result: result, term: term, formatter: formatter }\"\n\t\t\t\t/>\n\t\t\t</button>\n\t\t}\n\t`,\n})\nexport class NgbTypeaheadWindow implements OnInit {\n\tactiveIdx = 0;\n\n\t/**\n\t * The id for the typeahead window. The id should be unique and the same\n\t * as the associated typeahead's id.\n\t */\n\t@Input() id: string;\n\n\t/**\n\t * Flag indicating if the first row should be active initially\n\t */\n\t@Input() focusFirst = true;\n\n\t/**\n\t * Typeahead match results to be displayed\n\t */\n\t@Input() results;\n\n\t/**\n\t * Search term used to get current results\n\t */\n\t@Input() term: string;\n\n\t/**\n\t * A function used to format a given result before display. This function should return a formatted string without any\n\t * HTML markup\n\t */\n\t@Input() formatter = toString;\n\n\t/**\n\t * A template to override a matching result default display\n\t */\n\t@Input() resultTemplate: TemplateRef<ResultTemplateContext>;\n\n\t/**\n\t * A custom class to append to the typeahead window\n\t *\n\t * @since 9.1.0\n\t */\n\t@Input() popupClass: string;\n\n\t/**\n\t * Event raised when user selects a particular result row\n\t */\n\t@Output('select') selectEvent = new EventEmitter();\n\n\t@Output('activeChange') activeChangeEvent = new EventEmitter();\n\n\thasActive() {\n\t\treturn this.activeIdx > -1 && this.activeIdx < this.results.length;\n\t}\n\n\tgetActive() {\n\t\treturn this.results[this.activeIdx];\n\t}\n\n\tmarkActive(activeIdx: number) {\n\t\tthis.activeIdx = activeIdx;\n\t\tthis._activeChanged();\n\t}\n\n\tnext() {\n\t\tif (this.activeIdx === this.results.length - 1) {\n\t\t\tthis.activeIdx = this.focusFirst ? (this.activeIdx + 1) % this.results.length : -1;\n\t\t} else {\n\t\t\tthis.activeIdx++;\n\t\t}\n\t\tthis._activeChanged();\n\t}\n\n\tprev() {\n\t\tif (this.activeIdx < 0) {\n\t\t\tthis.activeIdx = this.results.length - 1;\n\t\t} else if (this.activeIdx === 0) {\n\t\t\tthis.activeIdx = this.focusFirst ? this.results.length - 1 : -1;\n\t\t} else {\n\t\t\tthis.activeIdx--;\n\t\t}\n\t\tthis._activeChanged();\n\t}\n\n\tresetActive() {\n\t\tthis.activeIdx = this.focusFirst ? 0 : -1;\n\t\tthis._activeChanged();\n\t}\n\n\tselect(item) {\n\t\tthis.selectEvent.emit(item);\n\t}\n\n\tngOnInit() {\n\t\tthis.resetActive();\n\t}\n\n\tprivate _activeChanged() {\n\t\tthis.activeChangeEvent.emit(this.activeIdx >= 0 ? this.id + '-' + this.activeIdx : undefined);\n\t}\n}\n","import {\n\tafterEveryRender,\n\tAfterRenderRef,\n\tChangeDetectorRef,\n\tComponentRef,\n\tDirective,\n\tElementRef,\n\tEventEmitter,\n\tforwardRef,\n\tinject,\n\tInjector,\n\tInput,\n\tNgZone,\n\tOnChanges,\n\tOnDestroy,\n\tOnInit,\n\tOutput,\n\tSimpleChanges,\n\tTemplateRef,\n\tDOCUMENT,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport { BehaviorSubject, fromEvent, of, OperatorFunction, Subject, Subscription } from 'rxjs';\nimport { map, switchMap, tap } from 'rxjs/operators';\n\nimport {\n\tisDefined,\n\ttoString,\n\tLive,\n\tngbAutoClose,\n\tPopupService,\n\tngbPositioning,\n\taddPopperOffset,\n} from './_ngb-ngbootstrap-utilities.mjs';\n\nimport { NgbTypeaheadConfig } from './typeahead-config';\nimport { NgbTypeaheadWindow, ResultTemplateContext } from './typeahead-window';\n\n/**\n * An event emitted right before an item is selected from the result list.\n */\nexport interface NgbTypeaheadSelectItemEvent<T = any> {\n\t/**\n\t * The item from the result list about to be selected.\n\t */\n\titem: T;\n\n\t/**\n\t * Calling this function will prevent item selection from happening.\n\t */\n\tpreventDefault: () => void;\n}\n\nlet nextWindowId = 0;\n\n/**\n * A directive providing a simple way of creating powerful typeaheads from any text input.\n */\n@Directive({\n\tselector: 'input[ngbTypeahead]',\n\texportAs: 'ngbTypeahead',\n\thost: {\n\t\t'(blur)': 'handleBlur()',\n\t\t'[class.open]': 'isPopupOpen()',\n\t\t'(keydown)': 'handleKeyDown($event)',\n\t\t'[autocomplete]': 'autocomplete',\n\t\tautocapitalize: 'off',\n\t\tautocorrect: 'off',\n\t\trole: 'combobox',\n\t\t'[attr.aria-autocomplete]': 'showHint ? \"both\" : \"list\"',\n\t\t'[attr.aria-activedescendant]': 'activeDescendant',\n\t\t'[attr.aria-controls]': 'isPopupOpen() ? popupId : null',\n\t\t'[attr.aria-expanded]': 'isPopupOpen()',\n\t},\n\tproviders: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NgbTypeahead), multi: true }],\n})\nexport class NgbTypeahead implements ControlValueAccessor, OnInit, OnChanges, OnDestroy {\n\tprivate _nativeElement = inject(ElementRef).nativeElement as HTMLInputElement;\n\tprivate _config = inject(NgbTypeaheadConfig);\n\tprivate _live = inject(Live);\n\tprivate _document = inject(DOCUMENT);\n\tprivate _ngZone = inject(NgZone);\n\tprivate _changeDetector = inject(ChangeDetectorRef);\n\tprivate _injector = inject(Injector);\n\n\tprivate _popupService = new PopupService(NgbTypeaheadWindow);\n\tprivate _positioning = ngbPositioning();\n\n\tprivate _subscription: Subscription | null = null;\n\tprivate _closed$ = new Subject<void>();\n\tprivate _inputValueBackup: string | null = null;\n\tprivate _inputValueForSelectOnExact: string | null = null;\n\tprivate _valueChanges$ = fromEvent<Event>(this._nativeElement, 'input').pipe(\n\t\tmap(($event) => ($event.target as HTMLInputElement).value),\n\t);\n\tprivate _resubscribeTypeahead$ = new BehaviorSubject(null);\n\tprivate _windowRef: ComponentRef<NgbTypeaheadWindow> | null = null;\n\tprivate _afterRenderRef: AfterRenderRef;\n\n\t/**\n\t * The value for the `autocomplete` attribute for the `<input>` element.\n\t *\n\t * Defaults to `\"off\"` to disable the native browser autocomplete, but you can override it if necessary.\n\t *\n\t * @since 2.1.0\n\t */\n\t@Input() autocomplete = 'off';\n\n\t/**\n\t * A selector specifying the element the typeahead popup will be appended to.\n\t *\n\t * Currently only supports `\"body\"`.\n\t */\n\t@Input() container = this._config.container;\n\n\t/**\n\t * If `true`, model values will not be restricted only to items selected from the popup.\n\t */\n\t@Input() editable = this._config.editable;\n\n\t/**\n\t * If `true`, the first item in the result list will always stay focused while typing.\n\t */\n\t@Input() focusFirst = this._config.focusFirst;\n\n\t/**\n\t * The function that converts an item from the result list to a `string` to display in the `<input>` field.\n\t *\n\t * It is called when the user selects something in the popup or the model value changes, so the input needs to\n\t * be updated.\n\t */\n\t@Input() inputFormatter: (item: any) => string;\n\n\t/**\n\t * The function that converts a stream of text values from the `<input>` element to the stream of the array of items\n\t * to display in the typeahead popup.\n\t *\n\t * If the resulting observable emits a non-empty array - the popup will be shown. If it emits an empty array - the\n\t * popup will be closed.\n\t *\n\t * See the [basic example](#/components/typeahead/examples#basic) for more details.\n\t *\n\t * Note that the `this` argument is `undefined` so you need to explicitly bind it to a desired \"this\" target.\n\t */\n\t@Input() ngbTypeahead: OperatorFunction<string, readonly any[]> | null | undefined;\n\n\t/**\n\t * The function that converts an item from the result list to a `string` to display in the popup.\n\t *\n\t * Must be provided, if your `ngbTypeahead` returns something other than `Observable<string[]>`.\n\t *\n\t * Alternatively for more complex markup in the popup you should use `resultTemplate`.\n\t */\n\t@Input() resultFormatter: (item: any) => string;\n\n\t/**\n\t * The template to override the way resulting items are displayed in the popup.\n\t *\n\t * See the [ResultTemplateContext](#/components/typeahead/api#ResultTemplateContext) for the template context.\n\t *\n\t * Also see the [template for results demo](#/components/typeahead/examples#template) for more details.\n\t */\n\t@Input() resultTemplate: TemplateRef<ResultTemplateContext>;\n\n\t/**\n\t * If `true`, automatically selects the item when it is the only one that exactly matches the user input\n\t *\n\t * @since 14.2.0\n\t */\n\t@Input() selectOnExact = this._config.selectOnExact;\n\n\t/**\n\t * If `true`, will show the hint in the `<input>` when an item in the result list matches.\n\t */\n\t@Input() showHint = this._config.showHint;\n\n\t/**\n\t * The preferred placement of the typeahead, among the [possible values](#/guides/positioning#api).\n\t *\n\t * The default order of preference is `\"bottom-start bottom-end top-start top-end\"`\n\t *\n\t * Please see the [positioning overview](#/positioning) for more details.\n\t */\n\t@Input() placement = this._config.placement;\n\n\t/**\n\t * Allows to change default Popper options when positioning the typeahead.\n\t * Receives current popper options and returns modified ones.\n\t *\n\t * @since 13.1.0\n\t */\n\t@Input() popperOptions = this._config.popperOptions;\n\n\t/**\n\t * A custom class to append to the typeahead popup window\n\t *\n\t * Accepts a string containing CSS class to be applied on the `ngb-typeahead-window`.\n\t *\n\t * This can be used to provide instance-specific styling, ex. you can override popup window `z-index`\n\t *\n\t * @since 9.1.0\n\t */\n\t@Input() popupClass: string;\n\n\t/**\n\t * An event emitted right before an item is selected from the result list.\n\t *\n\t * Event payload is of type [`NgbTypeaheadSelectItemEvent`](#/components/typeahead/api#NgbTypeaheadSelectItemEvent).\n\t */\n\t@Output() selectItem = new EventEmitter<NgbTypeaheadSelectItemEvent>();\n\n\tactiveDescendant: string | null = null;\n\tpopupId = `ngb-typeahead-${nextWindowId++}`;\n\n\tprivate _onTouched = () => {};\n\tprivate _onChange = (_: any) => {};\n\n\tngOnInit(): void {\n\t\tthis._subscribeToUserInput();\n\t}\n\n\tngOnChanges({ ngbTypeahead }: SimpleChanges): void {\n\t\tif (ngbTypeahead && !ngbTypeahead.firstChange) {\n\t\t\tthis._unsubscribeFromUserInput();\n\t\t\tthis._subscribeToUserInput();\n\t\t}\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._closePopup();\n\t\tthis._unsubscribeFromUserInput();\n\t}\n\n\tregisterOnChange(fn: (value: any) => any): void {\n\t\tthis._onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: () => any): void {\n\t\tthis._onTouched = fn;\n\t}\n\n\twriteValue(value) {\n\t\tthis._writeInputValue(this._formatItemForInput(value));\n\t\tif (this.showHint) {\n\t\t\tthis._inputValueBackup = value;\n\t\t}\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis._nativeElement.disabled = isDisabled;\n\t}\n\n\t/**\n\t * Dismisses typeahead popup window\n\t */\n\tdismissPopup() {\n\t\tif (this.isPopupOpen()) {\n\t\t\tthis._resubscribeTypeahead$.next(null);\n\t\t\tthis._closePopup();\n\t\t\tif (this.showHint && this._inputValueBackup !== null) {\n\t\t\t\tthis._writeInputValue(this._inputValueBackup);\n\t\t\t}\n\t\t\tthis._changeDetector.markForCheck();\n\t\t}\n\t}\n\n\t/**\n\t * Returns true if the typeahead popup window is displayed\n\t */\n\tisPopupOpen() {\n\t\treturn this._windowRef != null;\n\t}\n\n\thandleBlur() {\n\t\tthis._resubscribeTypeahead$.next(null);\n\t\tthis._onTouched();\n\t}\n\n\thandleKeyDown(event: KeyboardEvent) {\n\t\tif (!this.isPopupOpen()) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch (event.key) {\n\t\t\tcase 'ArrowDown':\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis._windowRef!.instance.next();\n\t\t\t\tthis._showHint();\n\t\t\t\tbreak;\n\t\t\tcase 'ArrowUp':\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis._windowRef!.instance.prev();\n\t\t\t\tthis._showHint();\n\t\t\t\tbreak;\n\t\t\tcase 'Enter':\n\t\t\tcase 'Tab': {\n\t\t\t\tconst result = this._windowRef!.instance.getActive();\n\t\t\t\tif (isDefined(result)) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tthis._selectResult(result);\n\t\t\t\t}\n\t\t\t\tthis._closePopup();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _openPopup() {\n\t\tif (!this.isPopupOpen()) {\n\t\t\tthis._inputValueBackup = this._nativeElement.value;\n\t\t\tconst { windowRef } = this._popupService.open();\n\t\t\tthis._windowRef = windowRef;\n\t\t\tthis._windowRef.setInput('id', this.popupId);\n\t\t\tthis._windowRef.setInput('popupClass', this.popupClass);\n\t\t\tthis._windowRef.instance.selectEvent.subscribe((result: any) => this._selectResultClosePopup(result));\n\t\t\tthis._windowRef.instance.activeChangeEvent.subscribe((activeId: string) => (this.activeDescendant = activeId));\n\n\t\t\tif (this.container === 'body') {\n\t\t\t\t(this._windowRef.location.nativeElement as HTMLElement).style.zIndex = '1055';\n\t\t\t\tthis._document.body.appendChild(this._windowRef.location.nativeElement);\n\t\t\t}\n\n\t\t\tthis._changeDetector.markForCheck();\n\n\t\t\t// Setting up popper and scheduling updates when zone is stable\n\t\t\tthis._ngZone.runOutsideAngular(() => {\n\t\t\t\tif (this._windowRef) {\n\t\t\t\t\tthis._positioning.createPopper({\n\t\t\t\t\t\thostElement: this._nativeElement,\n\t\t\t\t\t\ttargetElement: this._windowRef.location.nativeElement,\n\t\t\t\t\t\tplacement: this.placement,\n\t\t\t\t\t\tupdatePopperOptions: (options) => this.popperOptions(addPopperOffset([0, 2])(options)),\n\t\t\t\t\t});\n\n\t\t\t\t\tthis._afterRenderRef = afterEveryRender(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmixedReadWrite: () => {\n\t\t\t\t\t\t\t\tthis._positioning.update();\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ injector: this._injector },\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tngbAutoClose(this._ngZone, this._document, 'outside', () => this.dismissPopup(), this._closed$, [\n\t\t\t\tthis._nativeElement,\n\t\t\t\tthis._windowRef.location.nativeElement,\n\t\t\t]);\n\t\t}\n\t}\n\n\tprivate _closePopup() {\n\t\tthis._popupService.close().subscribe(() => {\n\t\t\tthis._positioning.destroy();\n\t\t\tthis._afterRenderRef?.destroy();\n\t\t\tthis._closed$.next();\n\t\t\tthis._windowRef = null;\n\t\t\tthis.activeDescendant = null;\n\t\t});\n\t}\n\n\tprivate _selectResult(result: any) {\n\t\tlet defaultPrevented = false;\n\t\tthis.selectItem.emit({\n\t\t\titem: result,\n\t\t\tpreventDefault: () => {\n\t\t\t\tdefaultPrevented = true;\n\t\t\t},\n\t\t});\n\t\tthis._resubscribeTypeahead$.next(null);\n\n\t\tif (!defaultPrevented) {\n\t\t\tthis.writeValue(result);\n\t\t\tthis._onChange(result);\n\t\t}\n\t}\n\n\tprivate _selectResultClosePopup(result: any) {\n\t\tthis._selectResult(result);\n\t\tthis._closePopup();\n\t}\n\n\tprivate _showHint() {\n\t\tif (this.showHint && this._windowRef?.instance.hasActive() && this._inputValueBackup != null) {\n\t\t\tconst userInputLowerCase = this._inputValueBackup.toLowerCase();\n\t\t\tconst formattedVal = this._formatItemForInput(this._windowRef.instance.getActive());\n\n\t\t\tif (userInputLowerCase === formattedVal.substring(0, this._inputValueBackup.length).toLowerCase()) {\n\t\t\t\tthis._writeInputValue(this._inputValueBackup + formattedVal.substring(this._inputValueBackup.length));\n\t\t\t\tthis._nativeElement['setSelectionRange'].apply(this._nativeElement, [\n\t\t\t\t\tthis._inputValueBackup.length,\n\t\t\t\t\tformattedVal.length,\n\t\t\t\t]);\n\t\t\t} else {\n\t\t\t\tthis._writeInputValue(formattedVal);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _formatItemForInput(item: any): string {\n\t\treturn item != null && this.inputFormatter ? this.inputFormatter(item) : toString(item);\n\t}\n\n\tprivate _writeInputValue(value: string): void {\n\t\tthis._nativeElement.value = toString(value);\n\t}\n\n\tprivate _subscribeToUserInput(): void {\n\t\tconst results$ = this._valueChanges$.pipe(\n\t\t\ttap((value) => {\n\t\t\t\tthis._inputValueBackup = this.showHint ? value : null;\n\t\t\t\tthis._inputValueForSelectOnExact = this.selectOnExact ? value : null;\n\t\t\t\tthis._onChange(this.editable ? value : null);\n\t\t\t}),\n\t\t\tthis.ngbTypeahead ? this.ngbTypeahead : () => of([]),\n\t\t);\n\n\t\tthis._subscription = this._resubscribeTypeahead$.pipe(switchMap(() => results$)).subscribe((results) => {\n\t\t\tif (!results || results.length === 0) {\n\t\t\t\tthis._closePopup();\n\t\t\t} else {\n\t\t\t\t// when there is only one result and this matches the input value\n\t\t\t\tif (\n\t\t\t\t\tthis.selectOnExact &&\n\t\t\t\t\tresults.length === 1 &&\n\t\t\t\t\tthis._formatItemForInput(results[0]) === this._inputValueForSelectOnExact\n\t\t\t\t) {\n\t\t\t\t\tthis._selectResult(results[0]);\n\t\t\t\t\tthis._closePopup();\n\t\t\t\t} else {\n\t\t\t\t\tthis._openPopup();\n\t\t\t\t\tthis._windowRef!.setInput('focusFirst', this.focusFirst);\n\t\t\t\t\tthis._windowRef!.setInput('results', results);\n\t\t\t\t\tthis._windowRef!.setInput('term', this._nativeElement.value);\n\t\t\t\t\tif (this.resultFormatter) {\n\t\t\t\t\t\tthis._windowRef!.setInput('formatter', this.resultFormatter);\n\t\t\t\t\t}\n\t\t\t\t\tif (this.resultTemplate) {\n\t\t\t\t\t\tthis._windowRef!.setInput('resultTemplate', this.resultTemplate);\n\t\t\t\t\t}\n\t\t\t\t\tthis._windowRef!.instance.resetActive();\n\n\t\t\t\t\t// The observable stream we are subscribing to might have async steps\n\t\t\t\t\t// and if a component containing typeahead is using the OnPush strategy\n\t\t\t\t\t// the change detection turn wouldn't be invoked automatically.\n\t\t\t\t\tthis._windowRef!.changeDetectorRef.detectChanges();\n\n\t\t\t\t\tthis._showHint();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// live announcer\n\t\t\tconst count = results ? results.length : 0;\n\t\t\tthis._live.say(count === 0 ? 'No results available' : `${count} result${count === 1 ? '' : 's'} available`);\n\t\t});\n\t}\n\n\tprivate _unsubscribeFromUserInput() {\n\t\tif (this._subscription) {\n\t\t\tthis._subscription.unsubscribe();\n\t\t}\n\t\tthis._subscription = null;\n\t}\n}\n","import { NgModule } from '@angular/core';\n\nimport { NgbHighlight } from './highlight';\nimport { NgbTypeahead } from './typeahead';\n\nexport { NgbHighlight } from './highlight';\nexport { NgbTypeaheadWindow } from './typeahead-window';\nexport { NgbTypeaheadConfig } from './typeahead-config';\nexport { NgbTypeahead, NgbTypeaheadSelectItemEvent } from './typeahead';\n\n@NgModule({\n\timports: [NgbHighlight, NgbTypeahead],\n\texports: [NgbHighlight, NgbTypeahead],\n})\nexport class NgbTypeaheadModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAGA;;;;;;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