/** * @author linhd * @date 2022/4/13 10:49 AM * @description 表格操作按钮 */ import React, { FunctionComponent } from 'react'; import { PopConfirmProps } from '../PopConfirm'; import './index.scss'; /** 按钮配置 */ export interface OperateBtnListProps { /** 样式class */ className?: string; /** style */ style?: React.CSSProperties; /** key 表示唯一值 */ key?: string; /** 显示名 */ label?: React.ReactNode; /** 鼠标移上去显示的内容 */ toolTipTitle?: React.ReactNode; /** 图标 */ icon?: React.ReactNode; /** 定位方向 */ placement?: 'top-start' | 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top'; /** 是否禁用 */ disabled?: boolean; /** 设置危险按钮 */ danger?: boolean; /** 点击事件 */ onClick?: (item: OperateBtnListProps, e: any) => void | Promise; /** 气泡确认框参数 */ popConfirmProps?: PopConfirmProps; [name: string]: any; } export interface OperateBtnProps { /** 样式class */ className?: string; /** style */ style?: React.CSSProperties; /** listItem索引下标 */ key?: string; /** 大小 */ size?: 'small' | 'medium' | 'large'; /** 按钮列表配置 */ list?: OperateBtnListProps[]; /** 加载对象映射 */ loadingMapping?: { [name: string]: true | false; }; /** 显示几个, 多余的放到更多里面 */ showNum?: number; /** 下拉框样式 */ popoverClassName?: string; /** 定位方向 */ placement?: 'top-start' | 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top'; /** 点击是否关闭更多 */ clickCloseMore?: boolean; /** 点击事件, 如果listItem里面存在onClick事件,则不触发改事件 */ onClick?: (item: OperateBtnListProps, e: any) => void | Promise; } declare const OperateBtn: FunctionComponent; export default OperateBtn;