@tinkoff/angular-contenteditable-accessor
Version:
This is a ControlValueAccessor for using Angular forms with contenteditable elements
25 lines (24 loc) • 1.2 kB
TypeScript
import { AfterViewInit, ElementRef, OnDestroy, Renderer2 } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
import { DomSanitizer } from '@angular/platform-browser';
import * as i0 from "@angular/core";
export declare class ContenteditableValueAccessor implements ControlValueAccessor, AfterViewInit, OnDestroy {
private readonly elementRef;
private readonly renderer;
private readonly sanitizer;
private observer;
private onTouched;
private onChange;
constructor(elementRef: ElementRef, renderer: Renderer2, sanitizer: DomSanitizer);
ngAfterViewInit(): void;
ngOnDestroy(): void;
onInput(): void;
onBlur(): void;
writeValue(value: string | null): void;
registerOnChange(onChange: (value: string) => void): void;
registerOnTouched(onTouched: () => void): void;
setDisabledState(disabled: boolean): void;
private processValue;
static ɵfac: i0.ɵɵFactoryDeclaration<ContenteditableValueAccessor, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<ContenteditableValueAccessor, "[contenteditable][formControlName], [contenteditable][formControl], [contenteditable][ngModel]", never, {}, {}, never>;
}