forked from varletjs/varlet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprops.ts
More file actions
72 lines (69 loc) · 2.05 KB
/
Copy pathprops.ts
File metadata and controls
72 lines (69 loc) · 2.05 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import { InputHTMLAttributes, type PropType } from 'vue'
import { fieldDecoratorProps } from '../field-decorator'
import { defineListenerProp, pickProps } from '../utils/components'
export type InputType = 'text' | 'password' | 'number' | 'tel' | 'email'
export type InputValidateTrigger = 'onFocus' | 'onBlur' | 'onChange' | 'onClick' | 'onClear' | 'onInput'
export const props = {
modelValue: String,
modelModifiers: {
type: Object as PropType<{ trim?: boolean }>,
default: () => ({}),
},
type: {
type: String as PropType<InputType>,
default: 'text',
},
textarea: Boolean,
ariaLabel: String,
rows: {
type: [String, Number],
default: 8,
},
maxlength: [String, Number],
readonly: Boolean,
resize: Boolean,
autofocus: Boolean,
validateTrigger: {
type: Array as PropType<InputValidateTrigger[]>,
default: () => ['onInput', 'onClear'],
},
rules: [Array, Function, Object] as PropType<any>,
enterkeyhint: String as PropType<InputHTMLAttributes['enterKeyHint']>,
onFocus: defineListenerProp<(e: FocusEvent) => void>(),
onBlur: defineListenerProp<(e: FocusEvent) => void>(),
onInput: defineListenerProp<(value: string, e: Event) => void>(),
onChange: defineListenerProp<(value: string, e: Event) => void>(),
onClear: defineListenerProp<(value: string) => void>(),
onKeydown: defineListenerProp<(e: KeyboardEvent) => void>(),
onKeyup: defineListenerProp<(e: KeyboardEvent) => void>(),
onEnter: defineListenerProp<(value: string, e: KeyboardEvent) => void>(),
'onUpdate:modelValue': defineListenerProp<(value: string) => void>(),
...pickProps(fieldDecoratorProps, [
'size',
'variant',
'placeholder',
'line',
'hint',
'textColor',
'focusColor',
'blurColor',
'disabled',
'clearable',
'onClick',
]),
// internal start
autocomplete: String,
isForceFocusingEffect: {
type: Boolean,
default: undefined,
},
isForceErrorEffect: {
type: Boolean,
default: undefined,
},
isShowFormDetails: {
type: Boolean,
default: true,
},
// internal end
}