UNPKG

@asi-ngtools/lib

Version:

This project is a little components library, simple to use, which will help you to simplify your project.

43 lines (42 loc) 1.48 kB
import { DefaultControlValueAccessor } from './../common/default-control-value-accessor'; import { ElementRef, OnInit, Renderer2 } from '@angular/core'; export declare class AsiInputChipsComponent extends DefaultControlValueAccessor implements OnInit { private renderer; private elementRef; /** html id */ id: string; /** html name */ name: string; /** Label to display (is translated) */ label: string; /**Label position */ labelPosition: 'top' | 'left' | 'right' | 'bottom' | 'bottom-center' | 'top-center'; /** Placeholder to display */ placeholder: string; /** Max length of the text */ maxlength: number; /** Must be a number (internaly set the regex to ^-*[0-9,\.]*$ */ number: boolean; /** Delay before the component change value */ delay: number; /** Allow you to define only one value */ uniq: boolean; /** Init data */ chips: Array<string>; inputElm: ElementRef; private _inputValue; private onChangeCallback; value: any; constructor(renderer: Renderer2, elementRef: ElementRef); ngOnInit(): void; /** * Catch on key event to add a chip on pressing 'Enter' * @param $event the event thrown by pressing 'Enter' only */ onKey(): void; removeChip(chipIndex: number): void; validateValue(value: string): boolean; writeValue(value: string): void; registerOnChange(fn: any): void; focusChip(_chipIndex: number): void; }