import { Size, ClassValue, CommonProps, StyleValue } from '@wakeadmin/element-adapter'; import { RouteLocation } from '../hooks'; import { LooseMessageBoxOptions } from '../utils'; export interface FatAction { /** * 文案 * * 可以传入一个jsx */ name: any; /** * 按钮形式 */ type?: 'default' | 'danger' | 'warning'; /** * 显示状态, 默认为 true */ visible?: boolean | (() => boolean); /** * 禁用 */ disabled?: boolean | (() => boolean); /** * 点击事件, link 类型默认会打开路由, 可以返回 false 来阻止默认行为 */ onClick?: (action: FatAction) => boolean | void | Promise; /** * 路由,如果提供这个,将忽略 onClick */ link?: RouteLocation; /** * 自定义样式 */ style?: StyleValue; /** * 自定义类名 */ className?: ClassValue; /** * 文案提示 */ title?: string | (() => string); /** * 图标 */ icon?: any; /** * 确认弹窗,默认关闭 */ confirm?: LooseMessageBoxOptions<{ action: FatAction; }>; /** * 受控显示加载状态 * * 如果 onClick 返回 Promise,FatActions 也会为该 Promise 维护 loading 状态 * */ loading?: boolean; } export interface FatActionsProps extends CommonProps { /** * 选项列表 */ options: FatAction[]; /** * 最多显示多少个, 默认 4 */ max?: number; /** * 选项采用 按钮形式 还是 文本形式,默认为 文本形式 */ type?: 'text' | 'button'; /** * 按钮大小,默认为 default */ size?: Size; /** * 空占位 */ undefinedPlaceholder?: any; /** * 下拉操作栏容器属性 */ dropdownProps?: { /** * 下拉列表的className */ class?: string; /** * 菜单弹出位置 */ placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end'; /** * 触发下拉的行为 * * 默认为 click */ trigger?: 'hover' | 'click'; /** * 展开下拉菜单的延时(仅在 trigger 为 hover 时有效) */ 'show-timeout'?: number; /** * 收起下拉菜单的延时(仅在 trigger 为 hover 时有效) */ 'hide-timeout'?: number; }; } export declare const FatActions: import("@wakeadmin/h").DefineComponent; //# sourceMappingURL=index.d.ts.map