UNPKG

ngx-tagify

Version:

Angular library that wraps @yaireo/tagify

76 lines (71 loc) 3.55 kB
import Tagify, { BaseTagData, TagData } from '@yaireo/tagify'; export { TagData, default as Tagify, TagifySettings } from '@yaireo/tagify'; import * as _angular_core from '@angular/core'; import { AfterViewInit, OnDestroy, ElementRef } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { Observable } from 'rxjs'; declare class TagifyService { private tagifyMap; /** * Adds a tagify instance, so it is available via service. Used internally. */ add(name: string, tagify: Tagify<any>): void; /** * Get tagify instance for full access to tagify API. */ get<T extends BaseTagData = TagData>(name: string): Tagify<T> | undefined; /** * Removes a tagify instance from service. Used internally. */ remove(name: string): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration<TagifyService, never>; static ɵprov: _angular_core.ɵɵInjectableDeclaration<TagifyService>; } declare class TagifyComponent<T extends BaseTagData = TagData> implements AfterViewInit, ControlValueAccessor, OnDestroy { private valueData; private valueType; private onChange; private onTouched; private unsubscribe$; private value$; private tagify; private skip; private tagifyService; private element; inputRef: _angular_core.Signal<ElementRef<HTMLInputElement>>; settings: _angular_core.InputSignal<Tagify.TagifySettings<T>>; name: _angular_core.InputSignal<string>; whitelist: _angular_core.InputSignal<Observable<string[] | T[]>>; inputClass: _angular_core.InputSignal<string>; readonly: _angular_core.InputSignal<boolean>; disabled: _angular_core.InputSignal<boolean>; get value(): string | T[]; set value(v: string | T[]); add: _angular_core.OutputEmitterRef<{ tags: T[]; added: T; }>; remove: _angular_core.OutputEmitterRef<T[]>; tInput: _angular_core.OutputEmitterRef<string>; constructor(); ngAfterViewInit(): void; writeValue(tags: string | T[]): void; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; private setValue; /** * Tagify creates a `tags` element to which the classes of the `input` element are applied. * Changes of `inputClass` are applied automatically to the `input` element, but have to be * manually applied to the `tags` element. */ private setTagsClass; ngOnDestroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration<TagifyComponent<any>, never>; static ɵcmp: _angular_core.ɵɵComponentDeclaration<TagifyComponent<any>, "tagify", never, { "settings": { "alias": "settings"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "whitelist": { "alias": "whitelist"; "required": false; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "add": "add"; "remove": "remove"; "tInput": "tInput"; }, never, ["*"], true, never>; } declare class TagifyModule { static ɵfac: _angular_core.ɵɵFactoryDeclaration<TagifyModule, never>; static ɵmod: _angular_core.ɵɵNgModuleDeclaration<TagifyModule, never, [typeof TagifyComponent], [typeof TagifyComponent]>; static ɵinj: _angular_core.ɵɵInjectorDeclaration<TagifyModule>; } export { TagifyComponent, TagifyModule, TagifyService };