UNPKG

@flatbiz/antd

Version:
29 lines (26 loc) 1.09 kB
import { TAny } from '@flatbiz/utils'; import { ButtonProps } from 'antd'; export type ButtonWrapperProps = Omit<ButtonProps, "onClick" | "color"> & { /** 当返回 Promise 时,按钮自动loading */ onClick?: (e: React.MouseEvent<HTMLElement>) => Promise<TAny> | void; /** 重复点击间隙,单位毫秒 默认值:500 */ debounceDuration?: number; /** 基于GLOBAL中elemAclLimits按钮权限列表,控制按钮显示、隐藏 */ permission?: string; /** 是否隐藏按钮 */ hidden?: boolean; /** loading 显示位置,默认值:left */ loadingPosition?: "left" | "center"; /** 移除按钮内边距,一般用于 type=link 类型下 */ removeGap?: boolean; color?: string; }; /** * antd Button包装组件 * 1. 添加按钮 onClick 返回 Promise自动loading效果 * 2. 内置 防抖 效果(在第一触发函数后,在指定时间内再次触发无效,即两次触发的时间间隙大于指定时间) * @param props * @returns */ export declare const ButtonWrapper: (props: ButtonWrapperProps) => import("react").JSX.Element | null; export {};