UNPKG

@mobsolutions/ngx-dadata

Version:

[![npm version](https://badge.fury.io/js/%40kolkov%2Fngx-dadata.svg)](https://badge.fury.io/js/%40kolkov%2Fngx-dadata) [![Build Status](https://travis-ci.org/kolkov/ngx-dadata.svg?branch=master)](https://travis-ci.org/kolkov/ngx-dadata) [![Coverage Stat

65 lines (64 loc) 2.05 kB
import { ElementRef, EventEmitter, OnChanges, OnInit, Renderer2, SimpleChanges } from '@angular/core'; import { DadataType, NgxDadataService } from './ngx-dadata.service'; import { DadataSuggestion } from './models/suggestion'; import { DadataConfig } from './dadata-config'; import { ControlValueAccessor, FormControl } from '@angular/forms'; export declare function createDaDataValidator(value: any): (c: FormControl) => { rangeError: { given: any; expected: any; }; }; export declare class NgxDadataComponent implements OnInit, ControlValueAccessor, OnChanges { private dataService; private _r; private v; currentFocus: number; data: DadataSuggestion[]; config: DadataConfig; apiKey: string; disabled: any; type: DadataType; limit: number; placeholder: string; selectedSuggestion: DadataSuggestion; selected: EventEmitter<DadataSuggestion>; inputValue: ElementRef; private inputString$; onTouched: () => void; propagateChange: any; validateFn: any; constructor(dataService: NgxDadataService, _r: Renderer2); value: any; ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; getData(value: string): void; onClick(e: MouseEvent, item: DadataSuggestion): void; onOutsideClick(): void; onArrowDown(): void; onArrowUp(): void; onEnter(): void; setFocus(id: number): void; removeFocus(id: number): void; writeValue(value: any): void; /** * Set the function to be called * when the control receives a change event. * * @param fn a function */ registerOnChange(fn: any): void; /** * Set the function to be called * when the control receives a touch event. * * @param fn a function */ registerOnTouched(fn: any): void; /** * Implements disabled state for this element * * @param isDisabled */ setDisabledState(isDisabled: boolean): void; }