import { ElementRef } from '@angular/core'; import { Repository, FrameContext, NgFormControl } from '@farris/devkit'; import { FrameContextService } from './frame-context.service'; import { FormControlService } from './form-control.service'; interface FocusableInvalidationGrid { editCell(rowId: any, field: string): void; disabled: boolean; } /** * 表单验证服务 * @scope FrameComponent */ declare class FocusInvalidService { private repository; private frameContext; private frameContextService; private formControlService; /** * 构造函数 */ constructor(repository: Repository, frameContext: FrameContext, frameContextService: FrameContextService, formControlService: FormControlService); /** * 向第一个验证不通过的字段设置焦点 */ focusInvalidInput(verifyInformations: any[], rootElement: ElementRef): void; /** * 设置DataGrid单元格焦点 */ focusGridCell(verifyInformations: any[], focusableDataGrid: FocusableInvalidationGrid): void; private updateVerifyInformationsIndex; private isGridComponent; private getColumnIndex; private getIndexFromColumns; private selectFirstVerifyInformation; private getInputElementById; getFrameContextsByPropertyPath(propertyPath: string, separtor?: string): FrameContext[]; getFormControlIndexByBindingPath(frameContext: FrameContext, binding: string): number; getFieldIndex(frameContext: FrameContext, binding: string): number; getFormControlsByFrameContext(frameContext: FrameContext): { [propertyName: string]: NgFormControl; } | null; focusElement(elementId: string, rootElement: ElementRef): boolean; /** * 设置焦点 * @param verifyInformation 错误信息 * @param frameContext 上下文 * @returns */ focus(verifyInformation: any, frameContext: FrameContext): void; /** * 通过控件id设置焦点 * @param elementId * @param elementRef */ private focusById; /** * 获取组件实例 * @param frameContext * @returns */ private getComponentRef; /** * 获取grid实例 * @param frameContext frameContext * @returns */ private getGridRef; } export { FocusableInvalidationGrid, FocusInvalidService };