import { PropType, VNode, VNodeChild, CSSProperties } from "vue"; import { Column } from "./column"; import { ColumnProps, SortOrder } from "ant-design-vue/lib/table/interface"; import type { TooltipProps } from 'ant-design-vue'; import type { ActionProps as ActionOptions } from '../component/TableAction.vue'; import { PaginationProps } from './pagination'; import { ColumnModalItem } from './column'; import type { TableRowSelection as ITableRowSelection } from 'ant-design-vue/lib/table/interface'; export declare type SizeType = 'default' | 'middle' | 'small' | 'large'; export interface FetchSetting { pageField: string; sizeField: string; listField: string; totalField: string; } export interface TableCustomRecord { record?: T; index?: number; } export interface TableCurrentDataSource { currentDataSource: T[]; } export interface TableRowSelection extends ITableRowSelection { /** * 当所选行发生更改时执行的回调 * @type Function */ onChange?: (selectedRowKeys: string[] | number[], selectedRows: T[]) => any; /** * 当选择/取消选择一行时执行的回调 * @type Function */ onSelect?: (record: T, selected: boolean, selectedRows: Object[], nativeEvent: Event) => any; /** * 当选择/取消选择所有行时执行回调 * @type Function */ onSelectAll?: (selected: boolean, selectedRows: T[], changeRows: T[]) => any; /** * 当行选择倒置时执行的回调 * @type Function */ onSelectInvert?: (selectedRows: string[] | number[]) => any; } export interface SorterResult { column: ColumnProps; order: SortOrder; field: string; columnKey: string; } export interface BasicColumn extends ColumnProps { children?: BasicColumn[]; filters?: { text: string; value: string; children?: unknown[] | (((props: Record) => unknown[]) & (() => unknown[]) & (() => unknown[])); }[]; slots?: Recordable; defaultHidden?: boolean; helpMessage?: string | string[]; ifShow?: boolean | ((column: BasicColumn) => boolean); editDynamicDisabled?: boolean | ((record: Recordable) => boolean); } export declare const createButton: () => { show: { type: BooleanConstructor; default: boolean; }; text: { type: StringConstructor; default: string; }; isDisabled: { type: BooleanConstructor; default: boolean; }; loading: { type: BooleanConstructor; default: boolean; }; icon: { type: StringConstructor; default: string; }; type: { type: StringConstructor; default: string; }; action: PropType<(...arg: any) => void>; }; export interface CreateButton { show?: boolean; text?: string; isDisabled?: boolean; loading?: boolean; icon?: string; type?: string; action?: (...arg: any) => void; } export declare const multipleActionOptions: () => { show: { type: BooleanConstructor; default: boolean; }; triggerMultiple: { type: BooleanConstructor; default: boolean; }; isNotCheck: { type: BooleanConstructor; default: boolean; }; styleMode: StringConstructor; options: { type: PropType; }; }; interface ButtonType { toolOptions?: TooltipProps; tooltipDes?: string; label?: string; value?: string | number; disabled?: boolean | ((...args: any) => boolean); overlayClassName?: string; action?: string | ((...args: any) => void); } export interface MultipleActionOptions { show?: boolean; options?: Array; [key: string]: any; } export declare const searchOptions: () => { show: { type: BooleanConstructor; default: boolean; }; showSelect: { type: BooleanConstructor; default: boolean; }; typeList: (ArrayConstructor | PromiseConstructor)[]; loading: { type: BooleanConstructor; default: boolean; }; action: PropType<(fetchParams: FetchParams) => void>; selectOptions: PropType<{ placeholder: string; width: string; clearInput: boolean; defaultValue: string; }>; inputOptions: PropType<{ placeholder: (key: string) => string | string; validator: (key: string) => string | string; validatorTrigger: 'all' | 'search' | 'change'; maxlength: number; width: string; allowClear: boolean; defaultValue: string; }>; }; export interface SearchOptions { show?: boolean; showSelect?: boolean; typeList?: (...arg: any) => Promise | Array<{ label: string; value: string; disabled: boolean; }>; action?: (fetchParams: FetchParams) => void; loading: boolean; selectOptions?: { placeholder?: string; width?: string; defaultValue?: string; clearInput?: boolean; }; inputOptions?: { placeholder?: (key: string) => string | string; validator?: (key: string) => string | string; validatorTrigger?: 'all' | 'search' | 'change'; maxlength?: number; width?: string; allowClear?: boolean; defaultValue?: string; }; } export interface ScrollProps { x: number; y: number; } export interface ActiveOptions { reload?: { text?: string; show?: boolean; isDisabled?: boolean; loading?: boolean; action?: Fn; }; download?: { text?: string; show?: boolean; isDisabled?: boolean; loading?: boolean; action?: Fn; href?: string; }; columnDialog?: { text?: string; show?: boolean; isDisabled?: boolean; loading?: boolean; okModal?: Fn; cancelModal: Fn; }; } export interface LocaleProps { filterConfirm?: string; filterReset?: string; emptyText?: string | VNode; } export declare const tableProps: () => { maxHeight: NumberConstructor; resizeHeightOffset: { type: NumberConstructor; default: number; }; isCanResizeParent: { type: BooleanConstructor; default: boolean; }; canResize: { type: BooleanConstructor; default: boolean; }; filterLeftStyle: PropType; filterRightStyle: PropType; createButtonOptions: { type: PropType; default(): { show: boolean; text: string; }; }; upTitle: { type: StringConstructor; default(): string; }; downTitle: { type: StringConstructor; default(): string; }; cancelUpTitle: { type: StringConstructor; default(): string; }; cancelDownTitle: { type: StringConstructor; default(): string; }; multipleOptions: { type: PropType; }; searchOptions: { type: PropType; }; actionsOptions: PropType; customFilter: { type: BooleanConstructor; default(): boolean; }; filterTag: { type: BooleanConstructor; default(): boolean; }; activeOptions: { type: PropType; }; columnFilterList: { type: PropType; default(): never[]; }; bordered: { type: BooleanConstructor; default(): boolean; }; sortFn: PropType<(sortInfo: SorterResult) => any>; filterFn: PropType<(data: Partial>) => any>; pagination: { type: PropType; default(): boolean; }; scroll: { type: PropType; default(): { x: string; }; }; dataSource: ArrayConstructor; isTreeTable: BooleanConstructor; autoCreateKey: BooleanConstructor; rowKey: (StringConstructor | FunctionConstructor)[]; defaultExpandAllRows: BooleanConstructor; defaultExpandedRowKeys: PropType; expandedRowKeys: PropType; expandIcon: PropType; expandRowByClick: BooleanConstructor; expandIconColumnIndex: NumberConstructor; size: { type: PropType; default(): string; }; childrenColumnName: StringConstructor; api: PropType<(...arg: any) => Promise>; beforeFetch: PropType>; afterFetch: PropType>; handleSearchInfoFn: PropType>; fetchSetting: PropType>; immediate: { type: BooleanConstructor; default(): boolean; }; emptyDataIsShowTable: BooleanConstructor; searchInfo: PropType>; defSort: PropType>; loading: BooleanConstructor; /** * Row's className * @type Function */ rowClassName: PropType<((record: TableCustomRecord, index: number) => string)>; /** * `table-layout` attribute of table element * `fixed` when header/columns are fixed, or using `column.ellipsis` * * @see https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout * @version 1.5.0 */ tableLayout: PropType; showHeader: { type: BooleanConstructor; default(): boolean; }; /** * Set props on per header row * @type Function */ customHeaderRow: PropType<(column: ColumnProps, index: number) => object>; /** * Set props on per row * @type Function */ customRow: PropType<(record: any, index: number) => object>; /** * Row selection config * @type object */ /** * Table footer renderer * @type Function | VNodeChild */ footer: PropType; /** * Row selection config * @type object */ rowSelection: PropType>; columns: PropType; cancelModal: PropType<(...arg: any) => void>; okModal: PropType<(...arg: any) => void>; langLocale: { type: ObjectConstructor; }; locale: { type: PropType; }; indentSize: { type: NumberConstructor; default(): number; }; }; export interface TableProps { maxHeight: number; resizeHeightOffset: number; isCanResizeParent: boolean; canResize: boolean; filterLeftStyle: CSSProperties; filterRightStyle: CSSProperties; upTitle: string; downTitle: string; createButtonOptions?: CreateButton; multipleOptions?: MultipleActionOptions; searchOptions?: SearchOptions; actionsOptions?: ActionOptions; customFilter?: boolean; filterTag?: boolean; activeOptions?: ActiveOptions; columnFilterList?: Array; bordered?: boolean; sortFn?: (sortInfo: SorterResult) => any; filterFn?: (data: Partial>) => any; pagination?: PaginationProps | boolean; scroll?: ScrollProps; dataSource?: Array; isTreeTable: boolean; autoCreateKey: boolean; rowKey?: string | Fn; defaultExpandAllRows?: boolean; defaultExpandedRowKeys?: string[]; expandedRowKeys?: string[]; expandIcon?: Function | VNodeChild | JSX.Element; expandRowByClick?: boolean; expandIconColumnIndex?: number; size?: SizeType; childrenColumnName?: string; api?: (...arg: any) => Promise; beforeFetch?: Fn; afterFetch?: Fn; handleSearchInfoFn?: Fn; fetchSetting?: Partial; immediate?: boolean; emptyDataIsShowTable?: boolean; searchInfo?: Recordable; defSort?: Recordable; loading?: boolean; /** * Row's className * @type Function */ rowClassName?: (record: TableCustomRecord, index: number) => string; /** * `table-layout` attribute of table element * `fixed` when header/columns are fixed, or using `column.ellipsis` * * @see https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout * @version 1.5.0 */ tableLayout?: 'auto' | 'fixed' | string; showHeader?: boolean; /** * Set props on per header row * @type Function */ customHeaderRow?: (column: ColumnProps, index: number) => object; /** * Set props on per row * @type Function */ customRow?: (record: any, index: number) => object; /** * Row selection config * @type object */ /** * Table footer renderer * @type Function | VNodeChild */ footer?: Function | VNodeChild | JSX.Element; rowSelection?: TableRowSelection; columns: BasicColumn[]; cancelModal?: (...arg: any) => void; okModal?: (...arg: any) => void; langLocale?: object; locale?: LocaleProps; indentSize: number; } export interface FetchParams { searchInfo?: Recordable; page?: number; sortInfo?: Recordable; filterInfo?: Recordable; } export interface GetColumnsParams { ignoreIndex?: boolean; ignoreAction?: boolean; sort?: boolean; } export interface TableActionType { reload: (opt?: FetchParams) => Promise; setSelectedRows: (rows: Recordable[]) => void; getSelectRows: () => T[]; clearSelectedRowKeys: () => void; expandAll: () => void; expandRows: (keys: string[] | number[]) => void; collapseAll: () => void; getSelectRowKeys: () => string[]; deleteSelectRowByKey: (key: string) => void; setPagination: (info: Partial) => void; setTableData: (values: T[]) => void; updateTableDataRecord: (rowKey: string | number, record: Recordable) => Recordable | void; deleteTableDataRecord: (rowKey: string | number | string[] | number[]) => void; insertTableDataRecord: (record: Recordable, index?: number) => Recordable | void; findTableDataRecord: (rowKey: string | number) => Recordable | void; getColumns: (opt?: GetColumnsParams) => BasicColumn[]; setColumns: (columns: Column[]) => void; getDataSource: () => T[]; getRawDataSource: () => T; setLoading: (loading: boolean) => void; setProps: (props: Partial) => void; setSelectedRowKeys: (rowKeys: string[] | number[]) => void; getPaginationRef: () => PaginationProps | boolean; getRowSelection: () => TableRowSelection; emit?: EmitType; updateTableData: (index: number, key: string, value: any) => Recordable; setShowPagination: (show: boolean) => Promise; getShowPagination: () => boolean; clearFilterDropdownRef: (column: Column) => void; setSearchOptions: (searchOptions: SearchOptions) => void; setMultipleAction: (multipleActionOptions: MultipleActionOptions) => void; setFilterColumnRef: (columns: Column[]) => void; setFilterColumnChecked: (colKeys: string[] | number[]) => void; setFilterColumnDisabled: (colKeys: string[] | number[]) => void; } export {};