@teamix/pro-action
Version:
action组件
41 lines (40 loc) • 1.99 kB
TypeScript
import React from 'react';
import { QuickShowConfig } from '@alicloudfe/components/types/dialog';
import { quickShowDrawerProps } from '@alicloudfe/components/types/drawer';
import { ProFormSchema, ProFormSchemaItem } from '@teamix/pro-form';
import { ProMessageProps } from '@teamix/utils';
import { RequestAction } from './request';
export interface DialogAction extends Omit<RequestAction, 'url'>, Omit<QuickShowConfig, 'onError' | 'type'>, Omit<quickShowDrawerProps, 'trigger' | 'animation' | 'height' | 'locale' | 'onError'> {
/** 点击「确认按钮」后的数据请求地址,非必填,不填就不发请求 */
url?: string;
/** 弹窗类型,支持普通弹窗和抽屉两种模式,默认为普通弹窗 */
dialogType?: 'dialog' | 'drawer' | 'pop';
/** 弹窗快捷调用类型 */
dialogQuickShowType?: 'alert' | 'confirm';
/** 弹窗消息类型 */
messageType?: 'success' | 'warning' | 'error' | 'notice' | 'help' | 'loading';
/** 位于弹窗内容最上方的自定义内容区 */
beforeContent?: React.ReactNode;
/** 位于弹窗内容上方的消息提示区 */
message?: ProMessageProps;
/** 位于弹窗内容下方的自定义内容区 */
afterContent?: React.ReactNode;
/** 弹窗页脚描述区,位于按钮组的对面 */
footerDescription?: React.ReactNode | ProFormSchema | ProFormSchemaItem;
/** 弹窗内容组件的 schema */
schema?: any;
/** 弹窗内容区的组件 */
component?: any;
/** 点击确定自定义回调函数 */
onOk?: any;
/** 点击取消自定义回调函数 */
onCancel?: any;
/** 隐藏footer区域 */
hideFooter?: boolean;
/** 支持通过传函数自定义底部按钮 */
footer?: any;
}
export declare function useDialogAction(action: DialogAction, actionContext?: any, hasForm?: boolean): {
[x: string]: (e: React.MouseEvent<HTMLElement, MouseEvent>) => Promise<void>;
};
export default useDialogAction;