-
Notifications
You must be signed in to change notification settings - Fork 126
Expand file tree
/
Copy pathReactCodeInput.d.ts
More file actions
85 lines (57 loc) · 2.34 KB
/
ReactCodeInput.d.ts
File metadata and controls
85 lines (57 loc) · 2.34 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
73
74
75
76
77
78
79
80
81
82
83
84
85
// Type definitions for react-code-input 3.8.2
// Project: React Code Input
// Definitions by: Siraj Alam https://github.com/sirajalam049
import React, { Component } from 'react';
export type InputModeTypes =
'verbatim' | 'latin' | 'latin-name' | 'latin-prose' |
'full-width-latin' | 'kana' | 'kana-name' | 'katakana' |
'numeric' | 'tel' | 'email' | 'url'
export interface ReactCodeInputProps {
// Type of input accept
type?: 'text' | 'number' | 'password' | 'tel'
// Allowed amount of characters to enter.
fields?: number
// Placeholder of the inputs.
placeholder?: string
// Value of the input
value?: string
// Get the full value of the input on every change
onChange?: (value: string) => void
// Setting the name of component.
name: string
// Marks the given fields as "touched" to show errors.
touch?: (name: string) => void
// Clears the "touched" flag for the given fields.
untouch?: (name: string) => void
// Add classname to the root element.
className?: string
isValid?: boolean
// When present, it specifies that the element should be disabled.
disabled?: boolean
// Setting the styles of container element.
style?: React.CSSProperties
// Setting the styles of each input field.
inputStyle?: React.CSSProperties
// Setting the styles of each input field if isValid prop is false.
inputStyleInvalid?: React.CSSProperties
// Setup autofocus on the first input, true by default.
autoFocus?: boolean
//
forceUppercase?: boolean
// Filter characters on key down.
filterKeyCodes?: Array<number>
// Filter characters.
filterChars?: Array<string>
// Filter above acts as blacklist if false, whitelist if true; false by default.
filterCharsIsWhitelist?: boolean;
// The pattern prop specifies a regular expression that the element's value is checked against.
pattern?: string
// The inputMode prop tells the browser on devices with dynamic keyboards which keyboard to display.
inputMode: InputModeTypes
// The autoComplete prop specifies whether or not an input field should have autocomplete enabled.
autoComplete?: string
}
declare class ReactCodeInput extends Component<ReactCodeInputProps, any> {
constructor(props: ReactCodeInputProps);
}
export default ReactCodeInput