import { StyleProp, ViewStyle, TextStyle } from 'react-native'; /** 布局方向 */ export type CheckboxLayout = 'left' | 'right'; /** Checkbox 样式配置 */ export interface CheckboxStyleConfig { /** Checkbox 方框大小 */ boxSize?: number; /** 勾选图标大小 */ iconSize?: number; /** 边框宽度 */ borderWidth?: number; /** 边框圆角 */ borderRadius?: number; /** 未选中时边框颜色 */ borderColor?: string; /** 选中时边框颜色(默认使用 activeColor) */ activeBorderColor?: string; /** 选中时背景颜色(默认使用 activeColor) */ activeBackgroundColor?: string; /** 勾选图标颜色 */ checkColor?: string; /** Checkbox 方框样式 */ boxStyle?: StyleProp; } /** 单个 Checkbox 选项 */ export interface CheckboxOption { /** 选项值 */ value: T; /** 显示标签(文本) */ label?: string; /** 自定义标签内容(ReactNode,优先于 label) */ labelContent?: React.ReactNode; /** 是否禁用 */ disabled?: boolean; /** 副标题/描述 */ description?: string; /** 自定义描述内容(ReactNode,优先于 description) */ descriptionContent?: React.ReactNode; } /** DbCheckbox 单个组件属性 */ export interface DbCheckboxProps { /** 是否选中 */ checked?: boolean; /** 默认是否选中(非受控) */ defaultChecked?: boolean; /** 选中状态改变回调 */ onChange?: (checked: boolean) => void; /** 标签文字 */ label?: string; /** 自定义标签内容(ReactNode,优先于 label) */ labelContent?: React.ReactNode; /** 是否禁用 */ disabled?: boolean; /** 副标题/描述 */ description?: string; /** 自定义描述内容(ReactNode,优先于 description) */ descriptionContent?: React.ReactNode; /** 布局方向:left=左侧选择框右侧文字,right=左侧文字右侧选择框 */ layout?: CheckboxLayout; /** 尺寸 */ size?: 'small' | 'medium' | 'large'; /** 主题色(选中状态颜色) */ activeColor?: string; /** 未选中时的颜色 */ inactiveColor?: string; /** Checkbox 样式配置 */ checkboxConfig?: CheckboxStyleConfig; /** 是否显示为不确定状态(半选) */ indeterminate?: boolean; /** 容器样式 */ style?: StyleProp; /** 标签文字样式 */ labelStyle?: StyleProp; /** 描述文字样式 */ descriptionStyle?: StyleProp; /** 标签文字颜色 */ labelColor?: string; /** 描述文字颜色 */ descriptionColor?: string; /** 自定义渲染选中图标 */ renderChecked?: () => React.ReactNode; /** 自定义渲染未选中图标 */ renderUnchecked?: () => React.ReactNode; /** 自定义渲染不确定状态图标 */ renderIndeterminate?: () => React.ReactNode; } /** CheckboxGroup 组件属性 */ export interface DbCheckboxGroupProps { /** 当前选中值数组 */ value?: T[]; /** 默认选中值数组(非受控) */ defaultValue?: T[]; /** 值改变回调 */ onChange?: (value: T[]) => void; /** 选项列表 */ options?: CheckboxOption[]; /** 是否禁用全部 */ disabled?: boolean; /** 布局方向 */ layout?: CheckboxLayout; /** 尺寸 */ size?: 'small' | 'medium' | 'large'; /** 主题色 */ activeColor?: string; /** 未选中时的颜色 */ inactiveColor?: string; /** Checkbox 样式配置 */ checkboxConfig?: CheckboxStyleConfig; /** 最小选择数量 */ min?: number; /** 最大选择数量 */ max?: number; /** 选项间距 */ spacing?: number; /** 容器样式 */ style?: StyleProp; /** 选项行样式 */ itemStyle?: StyleProp; /** 标签文字样式 */ labelStyle?: StyleProp; /** 描述文字样式 */ descriptionStyle?: StyleProp; /** 标签文字颜色 */ labelColor?: string; /** 描述文字颜色 */ descriptionColor?: string; /** 自定义渲染选中图标 */ renderChecked?: () => React.ReactNode; /** 自定义渲染未选中图标 */ renderUnchecked?: () => React.ReactNode; /** 子元素 */ children?: React.ReactNode; } /** CheckboxItem 组件属性(用于 Group 内) */ export interface DbCheckboxItemProps { /** 选项值 */ value: T; /** 显示标签(文本) */ label?: string; /** 自定义标签内容(ReactNode,优先于 label) */ labelContent?: React.ReactNode; /** 是否禁用 */ disabled?: boolean; /** 副标题/描述 */ description?: string; /** 自定义描述内容(ReactNode,优先于 description) */ descriptionContent?: React.ReactNode; /** 选项行样式 */ style?: StyleProp; /** 标签文字样式 */ labelStyle?: StyleProp; /** 描述文字样式 */ descriptionStyle?: StyleProp; /** 标签文字颜色 */ labelColor?: string; /** 描述文字颜色 */ descriptionColor?: string; }