Documents / @faasjs/ant-design / ExtendFormItemProps
Interface: ExtendFormItemProps
Extend custom form item types.
Example
import type { ExtendFormItemProps, FormProps } from '@faasjs/ant-design'
// define custom type
interface ExtendTypes extends ExtendFormItemProps {
type: 'password'
}
// extend form
function ExtendForm(props: FormProps<any, ExtendTypes>) {
return (
<Form
{...props}
extendTypes={{ password: { children: <Input.Password /> } }}
/>
)
}
// use custom type
<ExtendForm
items={[
{
id: 'test',
type: 'password',
},
]}
/>
Extends
Omit
<FormItemProps
,"type"
>
Properties
children?
optional
children:UnionFaasItemElement
<any
>
Inherited from
Omit.children
col?
optional
col:number
Inherited from
Omit.col
disabled?
optional
disabled:boolean
Inherited from
Omit.disabled
extendTypes?
optional
extendTypes:ExtendTypes
Inherited from
Omit.extendTypes
formChildren?
optional
formChildren:UnionFaasItemElement
<any
>
Inherited from
Omit.formChildren
formRender?
optional
formRender:UnionFaasItemRender
<any
>
Inherited from
Omit.formRender
id
id:
string
Inherited from
Omit.id
if()?
optional
if: (values
) =>boolean
trigger when any item's value changed
Parameters
• values: Record
<string
, any
>
Returns
boolean
Inherited from
Omit.if
input?
optional
input:SelectProps
<any
,DefaultOptionType
> |InputProps
|RadioProps
|InputNumberProps
<ValueType
> |SwitchProps
|DatePickerProps
Inherited from
Omit.input
label?
optional
label:string
|false
Inherited from
Omit.label
maxCount?
optional
maxCount:number
Inherited from
Omit.maxCount
object?
optional
object:FormItemProps
<any
>[]
Inherited from
Omit.object
onValueChange()?
optional
onValueChange: (value
,values
,form
) =>void
trigger when current item's value changed
Parameters
• value: any
• values: any
• form: FormInstance
<any
>
Returns
void
Inherited from
Omit.onValueChange
options?
optional
options:BaseOption
[]
Inherited from
Omit.options
render?
optional
render:UnionFaasItemRender
<any
>
Inherited from
Omit.render
required?
optional
required:boolean
Inherited from
Omit.required
rules?
optional
rules:RuleObject
[]
Inherited from
Omit.rules
title?
optional
title:string
Inherited from
Omit.title
type?
optional
type:string