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A;AAAA","sources":["./src/app/shared/components/autosuggest-input/autosuggest-input.component.ts","./src/app/shared/components/autosuggest-input/autosuggest-input.component.html","./src/app/shared/components/autosuggest-input/autosuggest-input.module.ts"],"sourcesContent":["import {\r\n Component,\r\n Input,\r\n Output,\r\n EventEmitter,\r\n OnChanges,\r\n ElementRef,\r\n ViewChild,\r\n} from '@angular/core';\r\nimport { Subject } from 'rxjs';\r\nimport { debounceTime, distinctUntilChanged } from 'rxjs/operators';\r\n\r\n@Component({\r\n selector: 'app-autosuggest-input',\r\n templateUrl: './autosuggest-input.component.html',\r\n styleUrls: ['./autosuggest-input.component.less'],\r\n host: {class: 'autosuggest-input'},\r\n})\r\nexport class AutosuggestInputComponent implements OnChanges {\r\n @Input() searchQuery: string;\r\n @Input() placeholder: string;\r\n @Input() minLength: number;\r\n @Output() onQuery = new EventEmitter();\r\n @Output() onBlur = new EventEmitter();\r\n @Output() onClear = new EventEmitter();\r\n @Output() toResults = new EventEmitter();\r\n @ViewChild('query', { static: true }) input: ElementRef;\r\n\r\n hasError = false;\r\n\r\n private _query = new Subject();\r\n private _value: string = '';\r\n\r\n get inputValue(): string {\r\n return this._value;\r\n }\r\n set inputValue(val: string) {\r\n this._value = val;\r\n }\r\n\r\n constructor() {\r\n this._query\r\n .pipe(debounceTime(200), distinctUntilChanged())\r\n .subscribe((value) => {\r\n this.onQuery.emit(value);\r\n });\r\n }\r\n\r\n ngOnInit() {\r\n setTimeout(() => {\r\n this.input.nativeElement.focus();\r\n }, 0);\r\n }\r\n\r\n ngOnChanges() {\r\n if (this.searchQuery) {\r\n this.inputValue = this.searchQuery;\r\n }\r\n }\r\n\r\n search(val) {\r\n if (this.minLength && val.length < this.minLength) {\r\n this.hasError = true;\r\n return;\r\n }\r\n\r\n this.hasError = false;\r\n this.inputValue = val;\r\n this._query.next(val);\r\n }\r\n\r\n toResultPage() {\r\n this.toResults.emit();\r\n }\r\n\r\n clear() {\r\n this.inputValue = '';\r\n this.onClear.emit();\r\n }\r\n}\r\n","
\r\n \r\n\r\n \r\n {{ 'search.MinLength' | translate }} - {{ minLength }}\r\n \r\n
\r\n\r\n\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { AutosuggestInputComponent } from './autosuggest-input.component';\r\nimport { TranslateModule } from '@ngx-translate/core';\r\n\r\n@NgModule({\r\n declarations: [AutosuggestInputComponent],\r\n imports: [CommonModule, TranslateModule],\r\n exports: [AutosuggestInputComponent],\r\n})\r\nexport class AutosuggestInputModule {}\r\n"],"names":["EventEmitter","Subject","debounceTime","distinctUntilChanged","i0","ɵɵelementStart","ɵɵlistener","AutosuggestInputComponent_i_3_Template_i_click_0_listener","ɵɵrestoreView","_r3","ctx_r3","ɵɵnextContext","ɵɵresetView","clear","ɵɵelementEnd","ɵɵtext","ɵɵadvance","ɵɵtextInterpolate2","ɵɵpipeBind1","minLength","AutosuggestInputComponent","inputValue","_value","val","constructor","onQuery","onBlur","onClear","toResults","hasError","_query","pipe","subscribe","value","emit","ngOnInit","setTimeout","input","nativeElement","focus","ngOnChanges","searchQuery","search","length","next","toResultPage","_","_2","selectors","viewQuery","AutosuggestInputComponent_Query","rf","ctx","AutosuggestInputComponent_Template_input_clickOutside_1_listener","_r1","AutosuggestInputComponent_Template_input_keyup_enter_1_listener","AutosuggestInputComponent_Template_input_keyup_1_listener","query_r2","ɵɵreference","ɵɵtemplate","AutosuggestInputComponent_i_3_Template","AutosuggestInputComponent_span_4_Template","AutosuggestInputComponent_Template_button_click_5_listener","ɵɵclassProp","ɵɵproperty","placeholder","ɵɵtextInterpolate1","CommonModule","TranslateModule","AutosuggestInputModule","_3","declarations","imports","exports"],"sourceRoot":"webpack:///","x_google_ignoreList":[]}