@cainiaofe/cn-ui-m
Version:
53 lines (52 loc) • 1.28 kB
TypeScript
import type { BasicComponentProps, DataSourceItemProps } from "../../../types";
import type { IRequestConfig } from '@cainiaofe/cn-ui-common';
import type { IRadioDataSource } from './i-radio-data-source';
import type { CnRadioProps } from './cn-radio-props';
export interface CnRadioGroupProps extends Omit<BasicComponentProps, 'onChange'> {
/**
* 选项样式,可以设置成 button 展示形状
*/
shape?: 'button' | 'tag';
/**
* 方向
*/
direction?: 'hoz' | 'ver';
/**
* 大小
*/
size?: 'small' | 'medium' | 'large';
/**
* 是否在表单中
* @ignore 内部使用
*/
insideForm?: boolean;
/**
* 默认值
*/
defaultValue?: any;
/**
* 受控值
*/
value?: any;
/**
* 是否禁用
*/
disabled?: boolean;
/**
* 是否预览
*/
readOnly?: boolean;
/**
* 自定义预览展示
*/
readOnlyRender?: (props: CnRadioGroupProps) => React.ReactNode;
/**
* 数据源
*/
dataSource?: Array<CnRadioProps | DataSourceItemProps | string | number>;
/**
* 值改变时触发的回调函数
*/
onChange?: (value: any, e: any) => void;
requestConfig?: IRequestConfig<IRadioDataSource>;
}