sapi-pro / ValueField
T extends ValueType
new ValueField<
T>():ValueField<T>
ValueField<T>
protected__optional:boolean=false
protectedoptional_key?:string
readonlyisValueField:true=true
protectedvalidators:FieldValidator<T>[] =[]
get isOptional():
boolean
boolean
abstractbuild(form,t):void
ModalFormData
void
getKey():
string|undefined
string | undefined
key(
key):this
string
this
optional():
ValueField<T> &object
ValueField<T> & object
abstractparse(raw):T|undefined
将 UI 原始值解析为目标类型。
- 如果是基础类型错误(如期待数字却得到布尔),抛出对应类型的 ParseError。
- 如果是数值格式错误(如 TextField 输入了非数字),抛出格式 ParseError。
ValueType
T | undefined
validate(
value):string|LangText|undefined
执行校验链。
- isEmpty 判定:undefined 或空字符串。
- 如果必填且为空,返回 Field_Empty 错误。
T | undefined
string | LangText | undefined
validator(...
v):ValueField<T>
...FieldValidator<T>[]
ValueField<T>