tsp-component
Version:
提供多端和react版本的UI组件
67 lines (64 loc) • 1.14 kB
TypeScript
interface TspComponentFormProps {
/**
* 表单控件ID的前缀
*/
prefix?: string;
/**
* scrollTo的偏移值
*/
top?: number;
/**
* 类名
*/
className?: string;
/**
* 要提交的表单字段
*/
fields: string[];
/**
* form submit
*/
onSubmit: (values: any) => void;
/**
* 容器元素
*/
container?: HTMLElement;
}
interface TspComponentFormCore {
/**
* 该字段没填写时的提示文字
*/
required?: string;
/**
* 验证类型
*/
patternType?: TspUtilRegexpMap;
/**
* input pattern
*/
pattern?: RegExp;
/**
* 验证触发布尔值
*/
patternTrigger?: boolean;
/**
* 验证失败时的提示文本
*/
patternMsg?: string;
/**
* 默认值
*/
defaultValue: string | number;
}
interface TspComponentFormCoreParams extends TspComponentFormCore {
/**
* 元素
*/
elem: HTMLElement;
}
interface TspComponentFormCoreSetPatternParams {
patternType: TspUtilRegexpMap;
pattern?: RegExp;
patternTrigger?: boolean;
patternMsg?: string;
}