-
Notifications
You must be signed in to change notification settings - Fork 429
/
Copy pathinner-input.d.ts
190 lines (189 loc) · 5.96 KB
/
inner-input.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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
declare module '@salesforce/design-system-react/components/input/private/inner-input' {
import React from 'react';
type Props = {
'aria-activedescendant'?: string;
'aria-autocomplete'?: string;
/**
* An HTML ID that is shared with ARIA-supported devices with the
* `aria-controls` attribute in order to relate the input with
* another region of the page. An example would be a select box
* that shows or hides a panel.
*/
'aria-controls'?: string;
'aria-describedby'?: string;
'aria-expanded'?: boolean;
'aria-haspopup'?: boolean | string;
'aria-labelledby'?: string;
/**
* An HTML ID that is shared with ARIA-supported devices with the
* `aria-controls` attribute in order to relate the input with
* another region of the page. An example would be a search field
* that shows search results.
*/
'aria-owns'?: string;
'aria-required'?: boolean;
/**
* **Assistive text for accessibility.**
* This object is merged with the default props object on every render.
* * `spinner`: Assistive text on the spinner.
*/
assistiveText?: Partial<{
spinner?: string;
}>;
/**
* Disabled brower's autocomplete when "off" is used.
*/
autoComplete?: string;
/**
* Class names to be added to the `input` element.
*/
className?: any[] | Record<string, any> | string;
/**
* Class names to be added to the outer container `div` of the input.
*/
containerClassName?: any[] | Record<string, any> | string;
/**
* Props to be added to the outer container `div` of the input (excluding `containerClassName`).
*/
containerProps?: Record<string, any>;
/**
* Disables the input and prevents editing the contents.
*/
disabled?: boolean;
/**
* Displays text or node to the left of the input. This follows the fixed text input UX pattern.
*/
fixedTextLeft?: React.ReactNode | string;
/**
* Displays text or node to the right of the input. This follows the fixed text input UX pattern.
*/
fixedTextRight?: React.ReactNode | string;
/**
* If true, loading spinner appears inside input on right hand side.
*/
hasSpinner?: boolean;
/**
* Left aligned icon, must be instance of `design-system-react/components/icon/input-icon`
*/
iconLeft?: React.ReactNode;
/**
* Right aligned icon, must be instance of `design-system-react/components/icon/input-icon`
*/
iconRight?: React.ReactNode;
/**
* Every input must have a unique ID in order to support keyboard navigation and ARIA support.
*/
id: string /*.isRequired*/;
/**
* Displays help text under the input.
*/
inlineHelpText?: React.ReactNode | string;
/**
* This callback exposes the input reference / DOM node to parent components. `<Parent inputRef={(inputComponent) => this.input = inputComponent} />
*/
inputRef?: React.LegacyRef<HTMLInputElement>;
/**
* Displays the value of the input statically. This follows the static input UX pattern.
*/
isStatic?: boolean;
/**
* This label appears above the input.
*/
label?: string;
onBlur?: React.FocusEventHandler<HTMLInputElement>;
/**
* This callback fires when the input changes. The synthetic React event will be the first parameter to the callback. You will probably want to reference `event.target.value` in your callback. No custom data object is provided.
*/
onChange?: React.ChangeEventHandler<HTMLInputElement>;
/**
* This event fires when the input is clicked.
*/
onClick?: React.MouseEventHandler<HTMLInputElement>;
onFocus?: React.FocusEventHandler<HTMLInputElement>;
onInput?: React.FormEventHandler<HTMLInputElement>;
onInvalid?: React.FormEventHandler<HTMLInputElement>;
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
onKeyPress?: React.KeyboardEventHandler<HTMLInputElement>;
onKeyUp?: React.KeyboardEventHandler<HTMLInputElement>;
onSelect?: React.ReactEventHandler<HTMLInputElement>;
onSubmit?: React.ReactEventHandler<HTMLInputElement>;
/**
* Text that will appear in an empty input.
*/
placeholder?: string;
minLength?: string;
/**
* Specifies minimum accepted value for an input of type "number"
*/
minValue?: number;
maxLength?: string;
/**
* Specifies maximum accepted value for an input of type "number"
*/
maxValue?: number;
/**
* Name of the submitted form parameter.
*/
name?: string;
/**
* Specifies `readOnly` for `input` node.
*/
readOnly?: boolean;
/**
* Highlights the input as a required field (does not perform any validation).
*/
required?: boolean;
/**
* `role` to be added to `input` node
*/
role?: string;
/**
* Determines the step size upon increment or decrement. Can be set to decimal values.
*/
step?: number;
/**
* Style object to be added to `input` node
*/
style?: Record<string, any>;
/**
* Specifies `tabIndex` for `input` node
*/
tabIndex?: string;
/**
* The `<Input>` element includes support for all HTML5 types.
*/
type?:
| 'text'
| 'password'
| 'datetime'
| 'datetime-local'
| 'date'
| 'month'
| 'time'
| 'week'
| 'number'
| 'email'
| 'url'
| 'search'
| 'tel'
| 'color';
/**
* The input is a controlled component, and will always display this value.
*/
value?: number | string;
/**
* Which UX pattern of input? The default is `base` while other option is `counter`
*/
variant?: 'base' | COUNTER;
/**
* This is the initial value of an uncontrolled form element and is present only to provide
* compatibility with hybrid framework applications that are not entirely React. It should only
* be used in an application without centralized state (Redux, Flux). "Controlled components"
* with centralized state is highly recommended.
* See [Code Overview](https://github.com/salesforce/design-system-react/blob/master/docs/codebase-overview.md#controlled-and-uncontrolled-components) for more information.
*/
defaultValue?: number | string;
};
function Component(props: Props): JSX.Element;
export default Component;
}