import type { PickClassStyleType, ReactPropsBase, RendererProps, SchemaClassName, WithRemoteItem } from 'jamis-core'; import type { BaseSchema, SchemaCollection, SchemaExpression } from '../types'; export type StepStatus = 'wait' | 'process' | 'finish' | 'error'; export interface StepObject { className?: SchemaClassName; /** * 标题 */ title?: string | JSX.Element; /** * 子标题 */ subTitle?: string | JSX.Element; /** * 图标 */ icon?: string; value?: string | number; /** * 描述 */ description?: string | JSX.Element; status?: StepStatus; iconClassName?: string; } export interface StepsObject { /** * 指定为 Steps 步骤条组件 */ type: 'steps'; /** * 步骤 */ steps?: Array; /** * API 或 数据映射 */ source?: string; /** * 指定当前步骤 */ value?: number | string; /** * 变量映射 */ name?: string; status: StepStatus; /** * 展示模式 */ mode?: 'horizontal' | 'vertical'; /** * 标签放置位置 */ labelPlacement?: 'horizontal' | 'vertical'; } export interface StepsProps extends ReactPropsBase, PickClassStyleType { steps: StepObject[]; current: number; status?: StepStatus | { [propName: string]: StepStatus; }; mode?: 'horizontal' | 'vertical'; labelPlacement?: 'horizontal' | 'vertical'; progressDot?: boolean; progressDotClassName?: SchemaClassName; } export interface StepSchema extends WithRemoteItem { /** * 标题 */ title: SchemaCollection; /** * 子标题 */ subTitle?: SchemaCollection; /** * 图标 */ icon?: string; value?: string | number; /** * 描述 */ description?: SchemaCollection; className?: SchemaClassName; } export interface StepsSchema extends BaseSchema { /** * 指定为 Steps 步骤条组件 */ type: 'steps'; /** * 步骤 */ steps?: Array; /** * API 或 数据映射 */ source?: string; /** * 指定当前步骤 */ value?: number | string; /** * 变量映射 */ name?: string; status?: StepStatus | { [propName: string]: StepStatus; } | SchemaExpression; /** * 展示模式 */ mode?: 'horizontal' | 'vertical'; /** * 标签放置位置 */ labelPlacement?: 'horizontal' | 'vertical'; /** * 点状步骤条 */ progressDot?: boolean; progressDotClassName?: SchemaClassName; } export interface StepsRendererProps extends RendererProps, Omit { }