import { ChangeDetectorRef, ElementRef, OnInit } from '@angular/core'; import { ControlValueAccessor, FormControl, Validator } from '@angular/forms'; import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; import { DndDropEvent, DropEffect } from 'ngx-drag-drop'; import { BuildingItem } from '../../interfaces/building-item'; import { PropertyInput, Schema, StructuralProperty, StructuralTable } from '../../interfaces/property'; import { Tab } from '../../interfaces/tab'; import { Tabs } from '../../interfaces/tabs'; import { FormBuilderService } from '../../services/form-builder.service'; import { TranslationService } from '../../services/translation.service'; import * as i0 from "@angular/core"; export declare class FormBuilderComponent implements ControlValueAccessor, Validator, OnInit { private _elementRef; private _cdr; private _translationSvc; private _modalSvc; private _formBuilderSvc; roles: Array<{ id: number; name: string; }>; toolbarElement: ElementRef; buildingItems: BuildingItem[]; buildingItemsToShow: BuildingItem[]; sticky: boolean; elementPosition: any; tabIndex: number; defaultSchema: Schema; get schema(): Schema; set schema(v: Schema); disabled: boolean; constructor(_elementRef: ElementRef, _cdr: ChangeDetectorRef, _translationSvc: TranslationService, _modalSvc: NgbModal, _formBuilderSvc: FormBuilderService); range: ArrayConstructor; ngOnInit(): void; onTouch: () => void; onChange(event: any): void; /** * The method set in registerOnChange, it is just a placeholder for a method that takes one parameter, * we use it to emit changes back to the form * @private * @memberof FormBuilderComponent */ private propagateChange; /** * initial value set to the component * * @param {*} obj */ writeValue(obj: any): void; /** * Registers a callback function that is called when the control's value changes in the UI. * * @param {*} fn The callback function to register */ registerOnChange(fn: any): void; /** * Registers a callback function is called by the forms API on initialization to update the form model on blur. * * @param {*} fn The callback function to register */ registerOnTouched(fn: any): void; /** * This function is called when the control status changes to or from "DISABLED". * Depending on the value, it will enable or disable the appropriate DOM element. * @param isDisabled */ setDisabledState?(isDisabled: boolean): void; handleScroll(): void; /** * returns null when valid else the validation object in this case we're checking if the json parsing has * passed or failed from the onChange method * @param c */ validate(c: FormControl): any; save(): Promise; /** * Evento lanzado cuando se deja el item en su lugar. Si es un movimiento, elimina el elemento de la posición inicial * * @param {*} item * @param {any[]} list * @param {DropEffect} effect */ onDragged(item: any, list: any[], effect: DropEffect): void; /** * Evento lanzado finalmente que añade el elemento en la posición indicada * * @param {DndDropEvent} event * @param {any[]} [list] */ onDrop(event: DndDropEvent, property?: StructuralProperty | Schema): Promise; /** * Procedimiento utilizado cuando se suelta un elemento de construcción en una tabla estructural * * @param {DndDropEvent} event * @param {StructuralProperty[]} properties * @param {number} columnIndex * @param {number} rowIndex * @return {*} */ onStructuralTableDrop(event: DndDropEvent, tableProperty: StructuralTable, columnIndex: number, rowIndex: number): Promise; /** * Añade un nuevo elemento de construcción de un tipo a las propiedades de la propiedad pasada por parámetro * * * @param {string} type * @param {(StructuralProperty | Schema)} parent * @return {*} {Promise} */ add(type: string, parent: StructuralProperty | Schema): Promise; /** * Edita un elemento de construcción * * @param {StructuralProperty} parent * @param {*} item * @return {*} {Promise} */ edit(item: StructuralProperty | PropertyInput): Promise; /** * Elimina la propiedad del listado de propiedades pasadas por parámetro * * @param {StructuralProperty} parent * @param {(StructuralProperty | PropertyInput)} item */ delete(item: StructuralProperty | PropertyInput): void; /** * Clona una propiedad en el listado pasado por parámetro * * @param {StructuralProperty} parent * @param {(StructuralProperty | PropertyInput)} item */ clone(item: StructuralProperty | PropertyInput): void; /** * Obtiene la referencia al modal del componente específico del tipo pasado por parámetro * * @param {string} type * @return {*} {NgbModalRef} */ getModalRefByKey(type: string): NgbModalRef; /** * Elimina la fila de la tabla estructural pasada por parámetro * * @param {any[]} columns * @param {number} rowIndex */ removeRow(item: StructuralTable, rowIndex: number): void; /** * Añade una fila arriba o abajo * * @param {StructuralTable} item * @param {number} index */ addRow(item: StructuralTable, index: number): void; /** * Cambio de pestaña en clic * * @param {(Tabs & { index: number })} tabs * @param {Tab} tab */ tabClick(tabs: Tabs & { index: number; }, tab: Tab): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }