import { FormControl, FormArray, ValidationErrors, FormGroup, AbstractControl } from '@angular/forms'; import { TranslateService } from '@ngx-translate/core'; import { NgbActiveModal as ActiveModal, NgbModal as Modal } from '@ng-bootstrap/ng-bootstrap'; import { FieldTypes } from 'mel-common'; import { FilterExpressionControl } from '../../controls/filterExpressionControl'; import { ClientFilters } from '../../../services/core/client-filters'; import { FieldConditions, ClientFilterCondition, ITranslateOptions } from '../../../services/core/client-filter-condition'; import { MelModal } from '../mel-modal'; import * as i0 from "@angular/core"; export declare type FilterDlgData = { title?: string; entityName?: string; filters?: ClientFilters; useFlowfilters?: boolean; }; /** * The FilterDialogComponent consists of an array of FilterExpressionControls, * which resides in the FormArray "filterElements". * A FilterExpressionControl extends a FormControl and represents a Condition * The FilterDialogComponent get IFilterDialogData with the title of the dialog, * the entityname, the existing filters and if flowfilters should be used (default:false). * The user can add a new filterlement (fieldname and condition) and delete a filter but not locked filters * After entering a condition, this condition will be validated and values are converted and enum translated. * A cancel-button and a save-button close the dialog * The returned conditions contain only the filters the user has edited */ export declare class FilterDlgComponent extends MelModal { translate: TranslateService; constructor(modalRef: ActiveModal, translate: TranslateService); set dlgData(data: FilterDlgData); get returnValue(): FieldConditions; get caption(): string; filterElements: FormArray; fieldNames?: string[]; onKeyDown(event: KeyboardEvent): void; static validate(ctrl: FilterExpressionControl): ValidationErrors | null; validationErrors(i: number): string; usedFieldNames(): string[]; fieldNameControl(filterElement: AbstractControl): FormControl; fieldConditionControl(filterElement: AbstractControl): FilterExpressionControl; firstUnusedFieldName(): string | undefined; newFilterelement(): FormGroup | undefined; translateOptions(columnType: FieldTypes, fieldName: string): ITranslateOptions | undefined; /** * Creates a FilterExpressionControl from the fieldName and condition * @param fieldName the fieldname * @param condition the condiition */ addFilterelement(fieldName: string, condition?: ClientFilterCondition): FormGroup | undefined; clear(): void; private filterExpressionControl; onFieldNameChange(newFieldName: string, index: number): void; onConditionChange(event: any, index: number): void; clearButtonClicked(index: number): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export declare function filterDlg(modal: Modal, dlgData: FilterDlgData): Promise;