mr-component
Version:
A library for Mr components
83 lines (82 loc) • 2.52 kB
TypeScript
import React from 'react';
export interface PaymentOption {
id: string;
name: string;
icon?: React.ReactNode | string;
balance?: string;
currency?: string;
fee?: string;
disabled?: boolean;
disabledReason?: string;
extra?: string;
}
export interface MrPaymentPopupProps {
/** 是否显示弹窗 */
visible: boolean;
/** 弹窗标题 */
title?: string;
/** 支付选项列表 */
options: PaymentOption[];
/** 当前选中值 */
value?: string;
/** 默认选中值 */
defaultValue?: string;
/** 是否显示余额 */
showBalance?: boolean;
/** 是否显示手续费 */
showFee?: boolean;
/** 是否可以添加新卡片 */
allowAddCard?: boolean;
/** 添加卡片文本 */
addCardText?: string;
/** 确认按钮文本 */
confirmButtonText?: string;
/** 是否禁用 */
disabled?: boolean;
/** 弹窗位置 */
position?: 'top' | 'bottom' | 'left' | 'right' | 'center';
/** 弹窗圆角 */
round?: boolean;
/** 是否显示关闭图标 */
closeable?: boolean;
/** 关闭图标位置 */
closeIconPosition?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
/** 点击遮罩是否关闭 */
closeOnClickOverlay?: boolean;
/** 背景颜色 */
backgroundColor?: string;
/** 悬停背景色 */
hoverBackgroundColor?: string;
/** 边框颜色 */
borderColor?: string;
/** 分隔线颜色 */
dividerColor?: string;
/** 圆角大小 */
borderRadius?: number | string;
/** 内边距 */
padding?: number | string;
/** 文字颜色 */
textColor?: string;
/** 描述颜色 */
descriptionColor?: string;
/** 禁用颜色 */
disabledColor?: string;
/** 预设主题 */
theme?: 'default' | 'primary' | 'success' | 'warning' | 'danger';
/** 尺寸 */
size?: 'small' | 'normal' | 'large';
/** 弹窗关闭回调 */
onClose?: () => void;
/** 选择变化回调 */
onChange?: (value: string, option: PaymentOption) => void;
/** 添加卡片回调 */
onAddCard?: () => void;
/** 确认回调 */
onConfirm?: (value: string, option: PaymentOption | undefined) => void;
/** 自定义类名 */
className?: string;
/** 自定义样式 */
style?: React.CSSProperties;
}
declare const MrPaymentPopup: import("react").ForwardRefExoticComponent<MrPaymentPopupProps & import("react").RefAttributes<HTMLDivElement>>;
export default MrPaymentPopup;