UNPKG

@ucloud-pccl/react-components

Version:
36 lines (35 loc) 1.5 kB
import React, { MouseEvent, ReactNode } from 'react'; import { ButtonProps } from 'src/components/Button/Button'; import { Size } from 'src/type'; interface ActionInfo { /** 展示 */ label?: ReactNode; /** 点击回调 */ onClick?: (e: MouseEvent) => void; /** 子菜单,仅 menu 项有效 */ children?: ActionInfo[]; /** 提示内容,或自定义 tooltip props */ tooltip?: ReactNode | any; /** 禁用 */ disabled?: boolean; } export interface ActionListProps { /** 操作列表 */ actionList: ActionInfo[]; /** 暴露的操作数量 */ exposeCount?: number; /** 控件尺寸 */ size?: Size; /** 操作数量等于 exposeCount+1 时是否直接显示按钮而不是显示下拉菜单 */ smart?: boolean; /** 按钮的默认样式类别,参考 Button 的 styleType */ buttonStyleType?: ButtonProps['styleType']; /** 自定义更多按钮内容,也可通过传入 object 来定义 props*/ dropdownButton?: ReactNode | ButtonProps; /** 弹出层的 popover props */ popoverProps?: any; /** 不使用按钮形式,用户dropdownButton自定义 */ dropdownNoButton?: boolean; } declare const _default: React.MemoExoticComponent<({ actionList, exposeCount, size, smart, buttonStyleType, popoverProps, dropdownButton, className, dropdownNoButton, ...rest }: ActionListProps & Omit<React.HTMLAttributes<HTMLDivElement>, keyof ActionListProps>) => React.JSX.Element>; export default _default;