-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathForm.d.ts
55 lines (49 loc) · 1.07 KB
/
Form.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import { CubeUIComponent } from '../component'
interface IField {
type?: string
component?: string | object
modelKey?: string
label?: string
props?: object
events?: object
rules?: object
trigger?: 'blur' | 'change'
debounce?: number | boolean
messages?: string
key?: string
}
interface IFields {
fields: IField[]
}
interface IGroups {
groups: {
legend?: string
fields?: IField[]
}
}
interface IValidity {
valid?: boolean | undefined
result?: {}
dirty?: boolean
}
interface IValidateParams {
validity?: IValidity
valid?: boolean | undefined
invalid?: boolean
dirty?: boolean
firstInvalidFieldIndex?: number
}
export declare class CubeForm extends CubeUIComponent {
model?: object
schema?: IFields | IGroups
immediateValidate?: boolean
action?: string | undefined
options?: {
scrollToInvalidField?: boolean
layout?: 'standard' | 'classic' | 'fresh'
}
submitAlwaysValidate?: boolean
submit: (skipValidate?: boolean) => void
reset: () => void
validate: (cb?: Function) => Promise<boolean | undefined> | undefined
}