import { ResponseToolbarComponent, ResponseToolbarClickEvent } from '@farris/ui-response-toolbar';
import { DatagridComponent, DataColumn } from '@farris/ui-datagrid';
import { TemplateRef, Injector, ComponentFactoryResolver, ChangeDetectorRef, OnInit } from '@angular/core';
import { MessagerService } from '@farris/ui-messager';
import { NotifyService } from '@farris/ui-notify';
import { GSPMetadataRTService } from '@gsp-lcm/metadatart-selector';
import { BsModalService } from '@farris/ui-modal';
import { AifLocalePipe } from '../aif-ui-common/pipe/aif-ui-common-locale.pipe';
export declare abstract class AbstractDatagridComponent implements OnInit {
protected messager: MessagerService;
protected notify: NotifyService;
protected metadataService: GSPMetadataRTService;
protected modalService: BsModalService;
protected localePipe: AifLocalePipe;
protected injector: Injector;
protected resolver: ComponentFactoryResolver;
protected cdf: ChangeDetectorRef;
readonly groupIcon = "";
toolbar: ResponseToolbarComponent;
readonly toolbarData: {
id: string;
text: any;
class: string;
disabled: boolean;
}[];
dg: DatagridComponent;
dgIdField: string;
dgColumns: DataColumn[];
abstract dgData: Array;
readonly dgTotal: number;
dgIsEnabledStateCell: TemplateRef;
dgOpCell: TemplateRef;
editingRowId: string;
constructor(messager: MessagerService, notify: NotifyService, metadataService: GSPMetadataRTService, modalService: BsModalService, localePipe: AifLocalePipe, injector: Injector, resolver: ComponentFactoryResolver, cdf: ChangeDetectorRef);
abstract ngOnInit(): void;
toolbarClickHandler(args: ResponseToolbarClickEvent): void;
/**
* 新增行
*/
abstract add(): void;
/**
* 开始行编辑
* @param ctx
*/
startRowEdit(ctx?: {
rowIndex: number;
rowData: {
[key: string]: any;
id: any;
};
}): boolean;
/**
* 取消行编辑
* @param ctx
*/
cancelRowEdit(ctx?: {
rowIndex: number;
rowData: {
[key: string]: any;
id: any;
};
}): boolean;
/**
* 结束行编辑
* @param ctx
*/
endRowEdit(ctx?: {
rowIndex: number;
rowData: {
[key: string]: any;
id: any;
};
}): boolean;
/**
* 行删除
* @param ctx
*/
remove(evt: Event, ctx?: {
rowIndex: number;
rowData: {
id: any;
[key: string]: any;
};
}): boolean;
/**
* 行移动
* @param ctx datagrid上下文
* @param direction -1: 上移, 1:下移
*/
rowMove(evt: Event, ctx: {
rowIndex: number;
rowData: {
id: any;
[key: string]: any;
};
}, direction: number): boolean;
/**
* 查找数组中指定id的元素下标
* @param arr 数组
* @param id 数组唯一标识
* @returns 元素下标
*/
protected findIndex(arr: any[], id: any): number;
abstract load(): void;
abstract configDgColumns(): void;
}