types(BfForm): Adding BfForm types

This commit is contained in:
kailong321200875 2021-12-12 19:48:18 +08:00
parent 184b468cd4
commit bc9195b21e
1 changed files with 57 additions and 5 deletions

View File

@ -19,6 +19,7 @@ declare global {
| 'Transfer' | 'Transfer'
| 'Divider' | 'Divider'
| 'TimeSelect' | 'TimeSelect'
| 'SelectV2'
declare type ColProps = { declare type ColProps = {
span?: number span?: number
@ -40,16 +41,14 @@ declare global {
validator?: (rule: any, value: FormValueTypes, callback: Fn) => void | boolean validator?: (rule: any, value: FormValueTypes, callback: Fn) => void | boolean
} }
declare type FormItem = { declare type FormItemProps = {
prop?: string
label?: string
labelWidth?: string | number labelWidth?: string | number
required?: boolean required?: boolean
rules?: FormRules | FormRules[] rules?: FormRules | FormRules[]
error?: string error?: string
showMessage?: boolean showMessage?: boolean
inlineMessage?: boolean inlineMessage?: boolean
size?: ElememtPlusSzie style?: CSSProperties
} }
declare type FormOptions = { declare type FormOptions = {
@ -425,6 +424,53 @@ declare global {
contentPosition?: 'left' | 'right' | 'center' contentPosition?: 'left' | 'right' | 'center'
} }
declare type TimeSelectProps = {
disabled?: boolean
editable?: boolean
clearable?: boolean
placeholder?: string
name?: string
prefixIcon?: string | Component
clearIcon?: string | Component
start?: string
end?: string
step?: string
minTime?: string
maxTime?: string
}
declare type SelectV2Props = {
multiple?: boolean
disabled?: boolean
valueKey?: string
clearable?: boolean
collapsetags?: boolean
multiplelimit?: number
name?: string
autocomplete?: string
placeholder?: string
filterable?: boolean
allowCreate?: boolean
noDataText?: string
popperClass?: string
popperAppendToBody?: boolean
popperOptions?: Recordable
automaticDropdown?: boolean
clearIcon?: string | Component
height?: number
scrollbarAlwaysOn?: boolean
onChange?: ChangeEvent
onVisibleChange?: (val: boolean) => void
onRemoveTag?: (val: string | number) => void
onClear?: () => void
onBlur?: BlurOrFocusEvent
onFocus?: BlurOrFocusEvent
slots?: {
default?: boolean
empty?: boolean
}
}
declare type FormSchema = { declare type FormSchema = {
/** /**
* @field form model key * @field form model key
@ -460,7 +506,13 @@ declare global {
| ColorPickerProps | ColorPickerProps
| TransferProps | TransferProps
| DividerProps | DividerProps
// formItemProps?: ElFormItem | TimeSelectProps
| SelectV2Props
/**
* @formItemProps form-item props
*/
formItemProps?: FormItemProps
/** /**
* @component Component * @component Component