import React from 'react'; import type { TableProps } from 'antd/lib/table/Table'; import type { ColumnProps } from 'antd/lib/table/Column'; import type { ButtonProps } from 'antd/lib/button'; import type { AlignType } from 'rc-table/lib/interface'; import type { G3FieldInputType } from '@g3-cscec/g3-ui'; export type { TableRowSelection } from 'antd/lib/table/interface'; export declare type AddOptional = { [Property in keyof Type]+?: Type[Property]; }; export interface BaseTableRef { getSelectedRowKeys: () => React.Key[]; getTableWidth: () => { width: number; height: number; }; } export declare type G3TableRef = AddOptional; export interface ActionRowProps { rowKey: string; record: T; rowIndex: number; tableWidth: number; children: React.ReactElement[]; actionRef: React.RefObject; tableRef: React.RefObject; rowActions: G3TableProps['rowActions']; maxRowActionCount: G3TableProps['maxRowActionCount']; rowActionPosition: G3TableProps['rowActionPosition']; } export interface ActionContainerRef { setRowRef(rowKey: string, ref: any): void; showRowAction(rowKey: string): void; hideRowAction(rowKey: string): void; getContainer(): HTMLDivElement | null; } export interface RowAction> extends Omit { text: string; visible?: boolean | string; disabled?: boolean | string; needConfirm?: boolean | undefined; onClick: ((record: RecordType, index: number) => void) | string; } export interface G3TableProps> extends Omit, 'rowKey' | 'columns' | 'dataSource'> { widgetKey?: string; persistKey?: string; editable?: boolean; enableRowSort?: boolean; rowKey?: string; showRowNum?: boolean; resizableTitle?: boolean; rowBreak?: boolean; enableColEdit?: true; minColWidth?: number; rowActions?: RowAction[]; maxRowActionCount?: number; rowActionPosition?: 'fixed' | 'float'; actionColWidth?: number | undefined; columns?: G3TableColumnProps[]; dataSource?: readonly RecordType[]; } export interface G3TableColumnProps> extends Omit, 'width' | 'onHeaderCell'> { width?: number; visible?: boolean; hideInSetting?: boolean; required?: boolean; resizable?: boolean; titleTip?: string; headAlign?: AlignType; rowBreak?: boolean; enableTotal?: boolean; fieldType?: G3FieldInputType; fieldProps?: Record; displayKey?: string; renderText?(value: any, record: RecordType, index: number): string; renderStyle?(value: any, record: RecordType, index: number): React.CSSProperties; }