UNPKG

@asoftwareworld/form-builder-pro

Version:

ASW Form Builder Pro helps you with rapid development and designed web forms which includes several controls. The key feature of Form Builder is to make your content attractive and effective. We can customize our control at run time and preview the same b

131 lines (130 loc) 4.74 kB
import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit, Renderer2, TemplateRef } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { DomSanitizer } from '@angular/platform-browser'; import { AswEditorConfig, ElementDOM } from '@asoftwareworld/form-builder-pro/api'; import { AswEditorToolbar } from './editor-toolbar/editor-toolbar'; import { AswEditorService } from './editor.service'; import * as i0 from "@angular/core"; export declare class AswEditor implements OnInit, ControlValueAccessor, AfterViewInit, OnDestroy, ElementDOM { private renderer; private aswEditorService; private doc; private sanitizer; private cdRef; private autoFocus; elementDOM: ElementRef<HTMLElement>; private onChange; private onTouched; modeVisual: boolean; showPlaceholder: boolean; disabled: boolean; focused: boolean; touched: boolean; changed: boolean; focusInstance: any; blurInstance: any; id: string; config: AswEditorConfig | any; placeholder: string; tabIndex: number | null; html: any; textArea: ElementRef; editorWrapper: ElementRef; editorToolbar?: AswEditorToolbar; customButtonsTemplateRef: TemplateRef<any> | any; executeCommandFn: any; viewMode: EventEmitter<boolean>; /** emits `blur` event when focused out from the textarea */ blurEvent: EventEmitter<FocusEvent>; /** emits `focus` event when focused in to the textarea */ focusEvent: EventEmitter<FocusEvent>; tabindex: number; onFocus(): void; constructor(renderer: Renderer2, aswEditorService: AswEditorService, doc: any, sanitizer: DomSanitizer, cdRef: ChangeDetectorRef, defaultTabIndex: string, autoFocus: any, elementDOM: ElementRef<HTMLElement>); ngOnInit(): void; ngAfterViewInit(): void; onPaste(event: ClipboardEvent): any; /** * Executed command from editor header buttons * @param command string from triggerCommand */ executeCommand(command: string, value?: string): void; /** * focus event */ onTextAreaFocus(event: FocusEvent): void; /** * @description fires when cursor leaves textarea */ onTextAreaMouseOut(event: MouseEvent): void; /** * blur event */ onTextAreaBlur(event: FocusEvent): void; /** * focus the text area when the editor is focused */ focus(): void; /** * Executed from the contenteditable section while the input property changes * @param element html element from contenteditable */ onContentChange(element: 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; /** * Write a new value to the element. * * @param value value to be executed when there is a change in contenteditable */ writeValue(value: any): void; /** * refresh view/HTML of the editor * * @param value html string from the editor */ refreshView(value: string): void; /** * toggles placeholder based on input string * * @param value A HTML string from the editor */ togglePlaceholder(value: boolean): void; /** * Implements disabled state for this element * * @param isDisabled Disabled flag */ setDisabledState(isDisabled: boolean): void; /** * toggles editor mode based on bToSource bool * * @param bToSource A boolean value from the editor */ toggleEditorMode(bToSource: boolean): void; /** * toggles editor buttons when cursor moved or positioning * * Send a node array from the contentEditable of the editor */ exec(): void; private configure; getCustomTags(): string; ngOnDestroy(): void; filterStyles(html: string): string; getChildById(id: string): any; static ɵfac: i0.ɵɵFactoryDeclaration<AswEditor, [null, null, null, null, null, { attribute: "tabindex"; }, { attribute: "autofocus"; }, null]>; static ɵcmp: i0.ɵɵComponentDeclaration<AswEditor, "asw-editor", never, { "id": { "alias": "id"; "required": false; }; "config": { "alias": "config"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; }, { "html": "html"; "viewMode": "viewMode"; "blurEvent": "blur"; "focusEvent": "focus"; }, ["customButtonsTemplateRef"], never, false, never>; }