import { TemplateRef } from '@angular/core'; import { IBixiTimeProps } from '@bixi/core/time'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; import { Observable } from 'rxjs'; import { IPagination } from './pagination-list.base'; export declare type IFn = (val: NzSafeAny, row: IRow, index: number) => T; export declare type IFnNoVal = (row: IRow, index: number) => T; export declare type IFnPure = () => T; export declare type IAllowFn = IFn | T; export declare type IAllowFnPure = IFnPure | T; export declare type IAllowFnNoVal = IFnNoVal | T; export declare type IRenderProp = string | number | boolean | undefined; export declare enum EColType { 'checkbox' = "checkbox", 'text' = "text", 'link' = "link", 'time' = "time", 'status' = "status", 'progress' = "progress", 'template' = "template", 'component' = "component", 'operations' = "operations" } interface IBaseCol { name?: string; nameRef?: string; key: string; keyAlias?: string; visible?: IAllowFnPure; titleTipIcon?: string; titleTipContent?: string | TemplateRef; width?: string; maxWidth?: string; align?: 'left' | 'center' | 'right'; value?: IAllowFn; onClick?: (row: NzSafeAny, index: number) => void; fixed?: 'left' | 'right'; sort?: { key?: string; direction?: 'descend' | 'ascend' | null; }; filter?: { key?: string; multiple?: boolean; options: { text: string; value: NzSafeAny; byDefault?: boolean; }[] | Observable<{ text: string; value: NzSafeAny; byDefault?: boolean; }[]>; }; } export interface IFilterParams { [key: string]: NzSafeAny; } export interface ISearchParams { filterParams: IFilterParams; pagination: IPagination; } export interface ITextCol extends IBaseCol { type?: EColType.text; ellipsis?: boolean; tooltip?: IAllowFn; } export interface ILinkCol extends IBaseCol { type: EColType.link; ellipsis?: boolean; tooltip?: IAllowFn; href?: IAllowFn; target?: '_blank' | '_self' | '_parent' | '_top'; } export interface ITimeCol extends IBaseCol, IBixiTimeProps { type: EColType.time; } export declare enum EProgressStatus { 'stop' = "stop", 'processing' = "processing", 'success' = "success", 'failed' = "failed", 'starting' = "starting" } export interface IProgressCol extends IBaseCol { type: EColType.progress; status: IAllowFn; tooltip?: IAllowFn; } export interface IStatus { text?: string; value: string | number; type: string | EStatus; } export declare enum EStatus { 'success' = "success", 'error' = "error", 'default' = "default", 'processing' = "processing", 'stop' = "stop" } export interface IStatusCol extends IBaseCol { type: EColType.status; options?: IStatus[]; tooltip?: IAllowFn; } export interface ITemplateCol extends IBaseCol { type: EColType.template; ref: string; } export interface ICheckboxCol extends IBaseCol { type: EColType.checkbox; selectable?: IAllowFn; name?: string; selectionList?: { text: string; onSelect(...args: NzSafeAny[]): NzSafeAny; }[]; onSelected?: (row: IRow, index: number, checked: boolean) => void; } export interface IOperationsCol extends IBaseCol { type: EColType.operations; disabled?: IFnNoVal; operations: (row: IRow, index: number) => IOperationsColBtn[]; } export interface IOperationsColBtn { name: string; disabled?: IAllowFnNoVal; visible?: IAllowFnNoVal; tooltip?: IAllowFnNoVal; onClick?: IFnNoVal; children?: IOperationsColBtn[]; } export declare enum EBixiCustomTplType { header = "header", body = "body" } export interface IBixiTableStatusConfigCustom { text: string; className?: string; style?: Partial; } export interface IBixiTableStatusConfig { [prop: string]: EStatus | IBixiTableStatusConfigCustom; } export interface IBixiTableConfig { status: IBixiTableStatusConfig; } export declare type ICol = ITextCol | ILinkCol | ITimeCol | IStatusCol | IProgressCol | ITemplateCol | IOperationsCol | ICheckboxCol; export declare type ICols = ICol[]; export declare type IRow = NzSafeAny; export declare type IRows = IRow[]; export declare type IRowKey = string | number; export declare type IInternalColFixed = { _left?: string | false; _right?: string | false; _leftLastFixed?: boolean; _rightFirstFixed?: boolean; }; export declare type IInternalCol = ICol & IInternalColFixed; export declare type ITableLayout = 'fixed' | 'auto'; export declare type IInternalCols = IInternalCol[]; export {};