import type { PisellNumberProps } from '../pisellNumber'; import type { ProgressProps, SliderSingleProps } from 'antd'; /** * 从 @pisell/utils 重新导出公共类型 */ export type { DisplayState, ValidationResult, NumberInputState, BaseNumberInputProps, } from '@pisell/utils'; /** * PisellPercent 组件 Props 类型定义 * * 基于 PisellNumber 扩展,专门处理百分比数据 */ export interface PisellPercentProps extends PisellNumberProps { /** * 是否显示百分号 % * @default true */ showPercentSymbol?: boolean; /** * 百分比范围 * @default [0, 100] * @example [0, 100] - 常用范围,值直接作为百分比 * @example [0, 1] - 小数范围,值会乘以100转换 * @example [0, 1000] - 自定义范围,按比例转换 */ range?: [number, number]; /** * 展示变体 * - text: 纯文本显示(如 85.5%) * - progress: 进度条显示 * - circle: 环形进度显示 * @default 'text' */ variant?: 'text' | 'progress' | 'circle'; /** * 进度条额外配置(variant='progress' 时使用) */ progressProps?: ProgressProps; /** * 环形进度额外配置(variant='circle' 时使用) */ circleProps?: ProgressProps; /** * 编辑态是否显示滑块 * @default false * @description 启用后,会在输入框上方显示滑块,便于快速调整 */ showSlider?: boolean; /** * 滑块额外配置 */ sliderProps?: SliderSingleProps; /** * 小数精度 * @default 1 * @description 百分比默认保留1位小数 */ precision?: number; /** * 最小值 * @default 0 */ min?: number; /** * 最大值 * @default 100 */ max?: number; }