@iress-oss/ids-mcp-server 6.0.0-alpha.1-canary-20251204032753-fe18cab → 6.0.0-alpha.1-canary-20251204040305-3639454
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generated/docs/components_components-alert-docs.md +1054 -0
- package/generated/docs/components_components-autocomplete-docs.md +3304 -0
- package/generated/docs/components_components-autocomplete-recipes-docs.md +98 -0
- package/generated/docs/components_components-badge-docs.md +312 -0
- package/generated/docs/components_components-button-docs.md +2339 -0
- package/generated/docs/components_components-buttongroup-docs.md +980 -0
- package/generated/docs/components_components-card-docs.md +1970 -0
- package/generated/docs/components_components-checkbox-docs.md +1083 -0
- package/generated/docs/components_components-checkboxgroup-docs.md +1597 -0
- package/generated/docs/components_components-checkboxgroup-recipes-docs.md +209 -0
- package/generated/docs/components_components-col-docs.md +755 -0
- package/generated/docs/components_components-container-docs.md +172 -0
- package/generated/docs/components_components-divider-docs.md +235 -0
- package/generated/docs/components_components-expander-docs.md +428 -0
- package/generated/docs/components_components-field-docs.md +3345 -0
- package/generated/docs/components_components-filter-docs.md +4091 -0
- package/generated/docs/components_components-hide-docs.md +450 -0
- package/generated/docs/components_components-icon-docs.md +1017 -0
- package/generated/docs/components_components-image-docs.md +168 -0
- package/generated/docs/components_components-inline-docs.md +1962 -0
- package/generated/docs/components_components-input-docs.md +1388 -0
- package/generated/docs/components_components-input-recipes-docs.md +349 -0
- package/generated/docs/components_components-inputcurrency-docs.md +636 -0
- package/generated/docs/components_components-inputcurrency-recipes-docs.md +208 -0
- package/generated/docs/components_components-introduction-docs.md +448 -0
- package/generated/docs/components_components-label-docs.md +229 -0
- package/generated/docs/components_components-link-docs.md +454 -0
- package/generated/docs/components_components-menu-docs.md +2219 -0
- package/generated/docs/components_components-menu-menuitem-docs.md +1455 -0
- package/generated/docs/components_components-modal-docs.md +2002 -0
- package/generated/docs/components_components-panel-docs.md +342 -0
- package/generated/docs/components_components-placeholder-docs.md +98 -0
- package/generated/docs/components_components-popover-docs.md +1631 -0
- package/generated/docs/components_components-popover-recipes-docs.md +537 -0
- package/generated/docs/components_components-progress-docs.md +128 -0
- package/generated/docs/components_components-provider-docs.md +123 -0
- package/generated/docs/components_components-radio-docs.md +499 -0
- package/generated/docs/components_components-radiogroup-docs.md +1573 -0
- package/generated/docs/components_components-readonly-docs.md +277 -0
- package/generated/docs/components_components-richselect-docs.md +6101 -0
- package/generated/docs/components_components-row-docs.md +2172 -0
- package/generated/docs/components_components-select-docs.md +1110 -0
- package/generated/docs/components_components-skeleton-docs.md +467 -0
- package/generated/docs/components_components-skeleton-recipes-docs.md +110 -0
- package/generated/docs/components_components-skiplink-docs.md +220 -0
- package/generated/docs/components_components-slideout-docs.md +1910 -0
- package/generated/docs/components_components-slider-docs.md +1284 -0
- package/generated/docs/components_components-spinner-docs.md +90 -0
- package/generated/docs/components_components-stack-docs.md +730 -0
- package/generated/docs/components_components-table-docs.md +4038 -0
- package/generated/docs/components_components-tabset-docs.md +955 -0
- package/generated/docs/components_components-tabset-tab-docs.md +342 -0
- package/generated/docs/components_components-tag-docs.md +410 -0
- package/generated/docs/components_components-text-docs.md +593 -0
- package/generated/docs/components_components-toaster-docs.md +451 -0
- package/generated/docs/components_components-toggle-docs.md +513 -0
- package/generated/docs/components_components-tooltip-docs.md +564 -0
- package/generated/docs/components_components-validationmessage-docs.md +608 -0
- package/generated/docs/components_contact-us-docs.md +9 -0
- package/generated/docs/components_foundations-accessibility-docs.md +33 -0
- package/generated/docs/components_foundations-consistency-docs.md +44 -0
- package/generated/docs/components_foundations-content-docs.md +18 -0
- package/generated/docs/components_foundations-introduction-docs.md +17 -0
- package/generated/docs/components_foundations-principles-docs.md +60 -0
- package/generated/docs/components_foundations-responsive-layout-docs.md +2692 -0
- package/generated/docs/components_foundations-user-experience-docs.md +53 -0
- package/generated/docs/components_foundations-visual-design-docs.md +39 -0
- package/generated/docs/components_foundations-z-index-stacking-docs.md +288 -0
- package/generated/docs/components_frequently-asked-questions-docs.md +44 -0
- package/generated/docs/components_get-started-develop-docs.md +47 -0
- package/generated/docs/components_get-started-using-storybook-docs.md +55 -0
- package/generated/docs/components_introduction-docs.md +85 -0
- package/generated/docs/components_patterns-form-docs.md +2469 -0
- package/generated/docs/components_patterns-form-recipes-docs.md +1597 -0
- package/generated/docs/components_patterns-introduction-docs.md +31 -0
- package/generated/docs/components_patterns-loading-docs.md +1908 -0
- package/generated/docs/components_patterns-shadow-docs.md +195 -0
- package/generated/docs/components_resources-code-katas-docs.md +25 -0
- package/generated/docs/components_resources-introduction-docs.md +28 -0
- package/generated/docs/components_resources-mcp-server-docs.md +23 -0
- package/generated/docs/components_resources-migration-guides-from-v4-to-v5-docs.md +142 -0
- package/generated/docs/components_styling-props-colour-docs.md +91 -0
- package/generated/docs/components_styling-props-elevation-docs.md +69 -0
- package/generated/docs/components_styling-props-radius-docs.md +63 -0
- package/generated/docs/components_styling-props-reference-docs.md +160 -0
- package/generated/docs/components_styling-props-screen-readers-docs.md +66 -0
- package/generated/docs/components_styling-props-sizing-docs.md +217 -0
- package/generated/docs/components_styling-props-spacing-docs.md +545 -0
- package/generated/docs/components_styling-props-typography-docs.md +66 -0
- package/generated/docs/components_versions-docs.md +14 -0
- package/generated/docs/guidelines.md +3083 -0
- package/generated/docs/introduction-docs.md +37 -0
- package/generated/docs/tokens_colour-docs.md +479 -0
- package/generated/docs/tokens_elevation-docs.md +39 -0
- package/generated/docs/tokens_introduction-docs.md +150 -0
- package/generated/docs/tokens_radius-docs.md +67 -0
- package/generated/docs/tokens_spacing-docs.md +87 -0
- package/generated/docs/tokens_typography-docs.md +305 -0
- package/package.json +2 -2
|
@@ -0,0 +1,1388 @@
|
|
|
1
|
+
Input
|
|
2
|
+
=====
|
|
3
|
+
|
|
4
|
+
Overview
|
|
5
|
+
--------
|
|
6
|
+
|
|
7
|
+
Inputs allow a user to input and interact with data. This component should be used as a child of the `IressField` component to ensure the correct placement of elements like label, error & hint text.
|
|
8
|
+
|
|
9
|
+
* * *
|
|
10
|
+
|
|
11
|
+
Updated
|
|
12
|
+
|
|
13
|
+
**Recently updated**
|
|
14
|
+
|
|
15
|
+
This component has been recently updated with new props. The props have been marked as beta. Please tell us if there are any issues.
|
|
16
|
+
|
|
17
|
+
[](./iframe.html?id=components-input--default)
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
<IressInput
|
|
22
|
+
append\=""
|
|
23
|
+
placeholder\="Enter your name"
|
|
24
|
+
prepend\=""
|
|
25
|
+
/>
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Props
|
|
30
|
+
-----
|
|
31
|
+
|
|
32
|
+
| Name | Description | Default | Control |
|
|
33
|
+
| --- | --- | --- | --- |
|
|
34
|
+
| alignRight |
|
|
35
|
+
Set input content align to right, useful for numeric inputs.
|
|
36
|
+
|
|
37
|
+
boolean
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
| \- | Set boolean |
|
|
42
|
+
| append |
|
|
43
|
+
|
|
44
|
+
Content to append to the input field, usually a button or icon.
|
|
45
|
+
|
|
46
|
+
ReactNode
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
| \- |
|
|
51
|
+
|
|
52
|
+
""
|
|
53
|
+
|
|
54
|
+
|
|
|
55
|
+
| clearable |
|
|
56
|
+
|
|
57
|
+
If `true`, then user can clear the value of the input. Will be ignored if `rows` prop is in use.
|
|
58
|
+
|
|
59
|
+
boolean
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
| \- | Set boolean |
|
|
64
|
+
| defaultValue |
|
|
65
|
+
|
|
66
|
+
The value of the input. Can be a string or a number. Use for uncontrolled inputs.
|
|
67
|
+
|
|
68
|
+
T
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
| \- | Set object |
|
|
73
|
+
| formatter |
|
|
74
|
+
|
|
75
|
+
Bring your own formatter that will be used to format the value when the input is not focused, allowing you to display the value in a different format. e.g. User type in value="dsf 987kkk123" => result after formatter: $987,123 (string)
|
|
76
|
+
|
|
77
|
+
(value?: T) => string | number
|
|
78
|
+
|
|
79
|
+
| \- | \- |
|
|
80
|
+
| inline |
|
|
81
|
+
|
|
82
|
+
Make prepend/append element closer to the input content.
|
|
83
|
+
|
|
84
|
+
boolean
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
| \- | Set boolean |
|
|
89
|
+
| loading |
|
|
90
|
+
|
|
91
|
+
The loading states of the input field. If provided a string, will use that text as the loading message.
|
|
92
|
+
|
|
93
|
+
union
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
| \- | Set object |
|
|
98
|
+
| onChange |
|
|
99
|
+
|
|
100
|
+
Emitted when the input value changes with the new changed value.
|
|
101
|
+
|
|
102
|
+
(e: ChangeEvent<InputBaseElement<TRows>>, value?: T) => void
|
|
103
|
+
|
|
104
|
+
| \- | \- |
|
|
105
|
+
| onClear |
|
|
106
|
+
|
|
107
|
+
Emitted when the input is manually cleared.
|
|
108
|
+
|
|
109
|
+
(e: ChangeEvent<InputBaseElement<TRows>>) => void
|
|
110
|
+
|
|
111
|
+
| \- | \- |
|
|
112
|
+
| placeholder |
|
|
113
|
+
|
|
114
|
+
string
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
| \- | Enter your name |
|
|
119
|
+
| prepend |
|
|
120
|
+
|
|
121
|
+
Content to prepended to the input field, usually an icon.
|
|
122
|
+
|
|
123
|
+
ReactNode
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
| \- |
|
|
128
|
+
|
|
129
|
+
""
|
|
130
|
+
|
|
131
|
+
|
|
|
132
|
+
| value |
|
|
133
|
+
|
|
134
|
+
The value of the input. Can be a string or a number. Use for controlled inputs.
|
|
135
|
+
|
|
136
|
+
T
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
| \- | Set object |
|
|
141
|
+
| width |
|
|
142
|
+
|
|
143
|
+
The width of the input.
|
|
144
|
+
|
|
145
|
+
FormElementWidths
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
| \- | Set object |
|
|
150
|
+
|
|
151
|
+
Examples
|
|
152
|
+
--------
|
|
153
|
+
|
|
154
|
+
### Types
|
|
155
|
+
|
|
156
|
+
The input component's `type` can be set to one of the following value: `text` (default), `date`, `email`, `number`, `password`, `search`, `tel`, `url`, `time`, `color` and `file`.
|
|
157
|
+
|
|
158
|
+
For more information about each type, please see the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types).
|
|
159
|
+
|
|
160
|
+
[](./iframe.html?id=components-input--types)
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
<IressStack gap\="md"\>
|
|
165
|
+
<IressInput
|
|
166
|
+
placeholder\="Text input"
|
|
167
|
+
type\="text"
|
|
168
|
+
/>
|
|
169
|
+
<IressInput
|
|
170
|
+
placeholder\="Color input"
|
|
171
|
+
type\="color"
|
|
172
|
+
/>
|
|
173
|
+
<IressInput
|
|
174
|
+
placeholder\="Date input"
|
|
175
|
+
type\="date"
|
|
176
|
+
/>
|
|
177
|
+
<IressInput
|
|
178
|
+
placeholder\="Datetime-local input"
|
|
179
|
+
type\="datetime-local"
|
|
180
|
+
/>
|
|
181
|
+
<IressInput
|
|
182
|
+
placeholder\="Email input"
|
|
183
|
+
type\="email"
|
|
184
|
+
/>
|
|
185
|
+
<IressInput
|
|
186
|
+
placeholder\="File input"
|
|
187
|
+
type\="file"
|
|
188
|
+
/>
|
|
189
|
+
<IressInput
|
|
190
|
+
placeholder\="Month input"
|
|
191
|
+
type\="month"
|
|
192
|
+
/>
|
|
193
|
+
<IressInput
|
|
194
|
+
placeholder\="Number input"
|
|
195
|
+
type\="number"
|
|
196
|
+
/>
|
|
197
|
+
<IressInput
|
|
198
|
+
placeholder\="Password input"
|
|
199
|
+
type\="password"
|
|
200
|
+
/>
|
|
201
|
+
<IressInput
|
|
202
|
+
placeholder\="Search input"
|
|
203
|
+
type\="search"
|
|
204
|
+
/>
|
|
205
|
+
<IressInput
|
|
206
|
+
placeholder\="Tel input"
|
|
207
|
+
type\="tel"
|
|
208
|
+
/>
|
|
209
|
+
<IressInput
|
|
210
|
+
placeholder\="Time input"
|
|
211
|
+
type\="time"
|
|
212
|
+
/>
|
|
213
|
+
<IressInput
|
|
214
|
+
placeholder\="Url input"
|
|
215
|
+
type\="url"
|
|
216
|
+
/>
|
|
217
|
+
<IressInput
|
|
218
|
+
placeholder\="Week input"
|
|
219
|
+
type\="week"
|
|
220
|
+
/>
|
|
221
|
+
</IressStack\>
|
|
222
|
+
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
#### Props
|
|
226
|
+
|
|
227
|
+
| Name | Description | Default | Control |
|
|
228
|
+
| --- | --- | --- | --- |
|
|
229
|
+
| alignRight |
|
|
230
|
+
Set input content align to right, useful for numeric inputs.
|
|
231
|
+
|
|
232
|
+
boolean
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
| \- | Set boolean |
|
|
237
|
+
| append |
|
|
238
|
+
|
|
239
|
+
Content to append to the input field, usually a button or icon.
|
|
240
|
+
|
|
241
|
+
ReactNode
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
| \- | Set object |
|
|
246
|
+
| clearable |
|
|
247
|
+
|
|
248
|
+
If `true`, then user can clear the value of the input. Will be ignored if `rows` prop is in use.
|
|
249
|
+
|
|
250
|
+
boolean
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
| \- | Set boolean |
|
|
255
|
+
| defaultValue |
|
|
256
|
+
|
|
257
|
+
The value of the input. Can be a string or a number. Use for uncontrolled inputs.
|
|
258
|
+
|
|
259
|
+
T
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
| \- | Set object |
|
|
264
|
+
| formatter |
|
|
265
|
+
|
|
266
|
+
Bring your own formatter that will be used to format the value when the input is not focused, allowing you to display the value in a different format. e.g. User type in value="dsf 987kkk123" => result after formatter: $987,123 (string)
|
|
267
|
+
|
|
268
|
+
(value?: T) => string | number
|
|
269
|
+
|
|
270
|
+
| \- | \- |
|
|
271
|
+
| inline |
|
|
272
|
+
|
|
273
|
+
Make prepend/append element closer to the input content.
|
|
274
|
+
|
|
275
|
+
boolean
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
| \- | Set boolean |
|
|
280
|
+
| loading |
|
|
281
|
+
|
|
282
|
+
The loading states of the input field. If provided a string, will use that text as the loading message.
|
|
283
|
+
|
|
284
|
+
union
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
| \- | Set object |
|
|
289
|
+
| onChange |
|
|
290
|
+
|
|
291
|
+
Emitted when the input value changes with the new changed value.
|
|
292
|
+
|
|
293
|
+
(e: ChangeEvent<InputBaseElement<TRows>>, value?: T) => void
|
|
294
|
+
|
|
295
|
+
| \- | \- |
|
|
296
|
+
| onClear |
|
|
297
|
+
|
|
298
|
+
Emitted when the input is manually cleared.
|
|
299
|
+
|
|
300
|
+
(e: ChangeEvent<InputBaseElement<TRows>>) => void
|
|
301
|
+
|
|
302
|
+
| \- | \- |
|
|
303
|
+
| prepend |
|
|
304
|
+
|
|
305
|
+
Content to prepended to the input field, usually an icon.
|
|
306
|
+
|
|
307
|
+
ReactNode
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
| \- | Set object |
|
|
312
|
+
| type |
|
|
313
|
+
|
|
314
|
+
\-
|
|
315
|
+
|
|
316
|
+
| \- | \- |
|
|
317
|
+
| value |
|
|
318
|
+
|
|
319
|
+
The value of the input. Can be a string or a number. Use for controlled inputs.
|
|
320
|
+
|
|
321
|
+
T
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
| \- | Set object |
|
|
326
|
+
| width |
|
|
327
|
+
|
|
328
|
+
The width of the input.
|
|
329
|
+
|
|
330
|
+
FormElementWidths
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
| \- | Set object |
|
|
335
|
+
|
|
336
|
+
Hidden inputs
|
|
337
|
+
-------------
|
|
338
|
+
|
|
339
|
+
If you need to use a hidden input in a form, you can use a native Input element with its `type` set to `hidden`. Remember to set the `name` attribute so it can be included in form submissions.
|
|
340
|
+
|
|
341
|
+
### Input modes
|
|
342
|
+
|
|
343
|
+
The `inputmode` attribute provides a hint to browsers for devices with onscreen keyboards (usually mobile devices) to help them decide which keyboard to display when a user has selected any input or textarea element.
|
|
344
|
+
|
|
345
|
+
For more information about each mode (and their expected user experience), please see the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode).
|
|
346
|
+
|
|
347
|
+
[](./iframe.html?id=components-input--input-modes)
|
|
348
|
+
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
<IressStack gap\="md"\>
|
|
352
|
+
<IressInput
|
|
353
|
+
inputMode\="text"
|
|
354
|
+
placeholder\="Text mode, usually best used when type="text" "
|
|
355
|
+
/>
|
|
356
|
+
<IressInput
|
|
357
|
+
inputMode\="tel"
|
|
358
|
+
placeholder\="Tel mode, usually best used when type="tel" "
|
|
359
|
+
/>
|
|
360
|
+
<IressInput
|
|
361
|
+
inputMode\="url"
|
|
362
|
+
placeholder\="Url mode, usually best used when type="url" "
|
|
363
|
+
/>
|
|
364
|
+
<IressInput
|
|
365
|
+
inputMode\="email"
|
|
366
|
+
placeholder\="Email mode, usually best used when type="email" "
|
|
367
|
+
/>
|
|
368
|
+
<IressInput
|
|
369
|
+
inputMode\="numeric"
|
|
370
|
+
placeholder\="Numeric mode, usually best used when type="numeric" "
|
|
371
|
+
/>
|
|
372
|
+
<IressInput
|
|
373
|
+
inputMode\="decimal"
|
|
374
|
+
placeholder\="Decimal mode, usually best used when type="decimal" "
|
|
375
|
+
/>
|
|
376
|
+
<IressInput
|
|
377
|
+
inputMode\="search"
|
|
378
|
+
placeholder\="Search mode, usually best used when type="search" "
|
|
379
|
+
/>
|
|
380
|
+
</IressStack\>
|
|
381
|
+
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
#### Props
|
|
385
|
+
|
|
386
|
+
| Name | Description | Default | Control |
|
|
387
|
+
| --- | --- | --- | --- |
|
|
388
|
+
| alignRight |
|
|
389
|
+
Set input content align to right, useful for numeric inputs.
|
|
390
|
+
|
|
391
|
+
boolean
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
| \- | Set boolean |
|
|
396
|
+
| append |
|
|
397
|
+
|
|
398
|
+
Content to append to the input field, usually a button or icon.
|
|
399
|
+
|
|
400
|
+
ReactNode
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
| \- | Set object |
|
|
405
|
+
| clearable |
|
|
406
|
+
|
|
407
|
+
If `true`, then user can clear the value of the input. Will be ignored if `rows` prop is in use.
|
|
408
|
+
|
|
409
|
+
boolean
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
| \- | Set boolean |
|
|
414
|
+
| defaultValue |
|
|
415
|
+
|
|
416
|
+
The value of the input. Can be a string or a number. Use for uncontrolled inputs.
|
|
417
|
+
|
|
418
|
+
T
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
| \- | Set object |
|
|
423
|
+
| formatter |
|
|
424
|
+
|
|
425
|
+
Bring your own formatter that will be used to format the value when the input is not focused, allowing you to display the value in a different format. e.g. User type in value="dsf 987kkk123" => result after formatter: $987,123 (string)
|
|
426
|
+
|
|
427
|
+
(value?: T) => string | number
|
|
428
|
+
|
|
429
|
+
| \- | \- |
|
|
430
|
+
| inline |
|
|
431
|
+
|
|
432
|
+
Make prepend/append element closer to the input content.
|
|
433
|
+
|
|
434
|
+
boolean
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
| \- | Set boolean |
|
|
439
|
+
| inputMode |
|
|
440
|
+
|
|
441
|
+
\-
|
|
442
|
+
|
|
443
|
+
| \- | \- |
|
|
444
|
+
| loading |
|
|
445
|
+
|
|
446
|
+
The loading states of the input field. If provided a string, will use that text as the loading message.
|
|
447
|
+
|
|
448
|
+
union
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
| \- | Set object |
|
|
453
|
+
| onChange |
|
|
454
|
+
|
|
455
|
+
Emitted when the input value changes with the new changed value.
|
|
456
|
+
|
|
457
|
+
(e: ChangeEvent<InputBaseElement<TRows>>, value?: T) => void
|
|
458
|
+
|
|
459
|
+
| \- | \- |
|
|
460
|
+
| onClear |
|
|
461
|
+
|
|
462
|
+
Emitted when the input is manually cleared.
|
|
463
|
+
|
|
464
|
+
(e: ChangeEvent<InputBaseElement<TRows>>) => void
|
|
465
|
+
|
|
466
|
+
| \- | \- |
|
|
467
|
+
| prepend |
|
|
468
|
+
|
|
469
|
+
Content to prepended to the input field, usually an icon.
|
|
470
|
+
|
|
471
|
+
ReactNode
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
| \- | Set object |
|
|
476
|
+
| value |
|
|
477
|
+
|
|
478
|
+
The value of the input. Can be a string or a number. Use for controlled inputs.
|
|
479
|
+
|
|
480
|
+
T
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
| \- | Set object |
|
|
485
|
+
| width |
|
|
486
|
+
|
|
487
|
+
The width of the input.
|
|
488
|
+
|
|
489
|
+
FormElementWidths
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
| \- | Set object |
|
|
494
|
+
|
|
495
|
+
### Clearable
|
|
496
|
+
|
|
497
|
+
By setting the `clearable` prop to `true` a clear button will appear when the user has entered a value into the input.
|
|
498
|
+
|
|
499
|
+
Clearing will set the focus on the input and trigger the `onClear` handler. Use this handler to clear the input value if your input is controlled.
|
|
500
|
+
|
|
501
|
+
[](./iframe.html?id=components-input--clearable)
|
|
502
|
+
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
<IressInput
|
|
506
|
+
clearable
|
|
507
|
+
placeholder\="Search"
|
|
508
|
+
prepend\={<IressIcon name\="search" />}
|
|
509
|
+
/>
|
|
510
|
+
|
|
511
|
+
```
|
|
512
|
+
|
|
513
|
+
#### Props
|
|
514
|
+
|
|
515
|
+
| Name | Description | Default | Control |
|
|
516
|
+
| --- | --- | --- | --- |
|
|
517
|
+
| alignRight |
|
|
518
|
+
Set input content align to right, useful for numeric inputs.
|
|
519
|
+
|
|
520
|
+
boolean
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
| \- | Set boolean |
|
|
525
|
+
| append |
|
|
526
|
+
|
|
527
|
+
Content to append to the input field, usually a button or icon.
|
|
528
|
+
|
|
529
|
+
ReactNode
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
| \- | Set object |
|
|
534
|
+
| clearable |
|
|
535
|
+
|
|
536
|
+
If `true`, then user can clear the value of the input. Will be ignored if `rows` prop is in use.
|
|
537
|
+
|
|
538
|
+
boolean
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
| \- | FalseTrue |
|
|
543
|
+
| defaultValue |
|
|
544
|
+
|
|
545
|
+
The value of the input. Can be a string or a number. Use for uncontrolled inputs.
|
|
546
|
+
|
|
547
|
+
T
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
| \- | Set object |
|
|
552
|
+
| formatter |
|
|
553
|
+
|
|
554
|
+
Bring your own formatter that will be used to format the value when the input is not focused, allowing you to display the value in a different format. e.g. User type in value="dsf 987kkk123" => result after formatter: $987,123 (string)
|
|
555
|
+
|
|
556
|
+
(value?: T) => string | number
|
|
557
|
+
|
|
558
|
+
| \- | \- |
|
|
559
|
+
| inline |
|
|
560
|
+
|
|
561
|
+
Make prepend/append element closer to the input content.
|
|
562
|
+
|
|
563
|
+
boolean
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
| \- | Set boolean |
|
|
568
|
+
| loading |
|
|
569
|
+
|
|
570
|
+
The loading states of the input field. If provided a string, will use that text as the loading message.
|
|
571
|
+
|
|
572
|
+
union
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
| \- | Set object |
|
|
577
|
+
| onChange |
|
|
578
|
+
|
|
579
|
+
Emitted when the input value changes with the new changed value.
|
|
580
|
+
|
|
581
|
+
(e: ChangeEvent<InputBaseElement<TRows>>, value?: T) => void
|
|
582
|
+
|
|
583
|
+
| \- | \- |
|
|
584
|
+
| onClear |
|
|
585
|
+
|
|
586
|
+
Emitted when the input is manually cleared.
|
|
587
|
+
|
|
588
|
+
(e: ChangeEvent<InputBaseElement<TRows>>) => void
|
|
589
|
+
|
|
590
|
+
| \- | \- |
|
|
591
|
+
| placeholder |
|
|
592
|
+
|
|
593
|
+
string
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
| \- | Search |
|
|
598
|
+
| prepend |
|
|
599
|
+
|
|
600
|
+
Content to prepended to the input field, usually an icon.
|
|
601
|
+
|
|
602
|
+
ReactNode
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
| \- |
|
|
607
|
+
|
|
608
|
+
RAW
|
|
609
|
+
|
|
610
|
+
prepend :
|
|
611
|
+
|
|
612
|
+
{
|
|
613
|
+
|
|
614
|
+
* $$typeof : Symbol(react.transitional.element)
|
|
615
|
+
* type : ({ className, fixedWidth, flip, name, rotate, screenreaderText, set = "fal", spin, ...restProps }) => { const prefix = "fa-"; const classes = icon({ flip, rotate, spin }); return /\* @\_\_PURE\_\_ \*/ jsxDEV( styled.span, { role: "img", className: cx( classes, GlobalCSSClass.Icon, set, \`${prefix}${name}\`, fixedWidth && "fa-fw", className ), "aria-hidden": !screenreaderText && "true", "aria-label": screenreaderText, ...restProps }, void 0, false, { fileName: "/home/runner/work/design-system/design-system/packages/components/src/components/Icon/Icon.tsx", lineNumber: 67, columnNumber: 5 }, this ); }
|
|
616
|
+
* key : null
|
|
617
|
+
* props :
|
|
618
|
+
|
|
619
|
+
{...} 1 key
|
|
620
|
+
|
|
621
|
+
* \_owner : null
|
|
622
|
+
* \_store :
|
|
623
|
+
|
|
624
|
+
{...} 0 keys
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
|
|
|
636
|
+
| value |
|
|
637
|
+
|
|
638
|
+
The value of the input. Can be a string or a number. Use for controlled inputs.
|
|
639
|
+
|
|
640
|
+
T
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
| \- | Set object |
|
|
645
|
+
| width |
|
|
646
|
+
|
|
647
|
+
The width of the input.
|
|
648
|
+
|
|
649
|
+
FormElementWidths
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
| \- | Set object |
|
|
654
|
+
|
|
655
|
+
### Sizing
|
|
656
|
+
|
|
657
|
+
Inputs can be resized to suit a specific number of characters. This sets an expectation of what data a user has to enter; for example using the `Sixteen` width for a credit card number.
|
|
658
|
+
|
|
659
|
+
The width in this case refers to the actual input and ensures that it is wide enough for a set number of characters. If you add any appended or prepended content, the overall size of the `IressInput` will increase.
|
|
660
|
+
|
|
661
|
+
Widths can also be set as a percentage, allowing the input to take up a proportion of the width of its container. In this case, the width of the actual input decreases if you add appended or prepended content.
|
|
662
|
+
|
|
663
|
+
[](./iframe.html?id=components-input--sizing)
|
|
664
|
+
|
|
665
|
+
```
|
|
666
|
+
|
|
667
|
+
<IressStack gap\="md"\>
|
|
668
|
+
<IressInput
|
|
669
|
+
placeholder\="2"
|
|
670
|
+
width\="2"
|
|
671
|
+
/>
|
|
672
|
+
<IressInput
|
|
673
|
+
placeholder\="4"
|
|
674
|
+
width\="4"
|
|
675
|
+
/>
|
|
676
|
+
<IressInput
|
|
677
|
+
placeholder\="6"
|
|
678
|
+
width\="6"
|
|
679
|
+
/>
|
|
680
|
+
<IressInput
|
|
681
|
+
placeholder\="8"
|
|
682
|
+
width\="8"
|
|
683
|
+
/>
|
|
684
|
+
<IressInput
|
|
685
|
+
placeholder\="10"
|
|
686
|
+
width\="10"
|
|
687
|
+
/>
|
|
688
|
+
<IressInput
|
|
689
|
+
placeholder\="12"
|
|
690
|
+
width\="12"
|
|
691
|
+
/>
|
|
692
|
+
<IressInput
|
|
693
|
+
placeholder\="16"
|
|
694
|
+
width\="16"
|
|
695
|
+
/>
|
|
696
|
+
<IressInput
|
|
697
|
+
placeholder\="25perc"
|
|
698
|
+
width\="25perc"
|
|
699
|
+
/>
|
|
700
|
+
<IressInput
|
|
701
|
+
placeholder\="50perc"
|
|
702
|
+
width\="50perc"
|
|
703
|
+
/>
|
|
704
|
+
<IressInput
|
|
705
|
+
placeholder\="75perc"
|
|
706
|
+
width\="75perc"
|
|
707
|
+
/>
|
|
708
|
+
<IressInput
|
|
709
|
+
placeholder\="100perc"
|
|
710
|
+
width\="100perc"
|
|
711
|
+
/>
|
|
712
|
+
</IressStack\>
|
|
713
|
+
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
#### Props
|
|
717
|
+
|
|
718
|
+
| Name | Description | Default | Control |
|
|
719
|
+
| --- | --- | --- | --- |
|
|
720
|
+
| alignRight |
|
|
721
|
+
Set input content align to right, useful for numeric inputs.
|
|
722
|
+
|
|
723
|
+
boolean
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
| \- | Set boolean |
|
|
728
|
+
| append |
|
|
729
|
+
|
|
730
|
+
Content to append to the input field, usually a button or icon.
|
|
731
|
+
|
|
732
|
+
ReactNode
|
|
733
|
+
|
|
734
|
+
|
|
735
|
+
|
|
736
|
+
| \- | Set object |
|
|
737
|
+
| clearable |
|
|
738
|
+
|
|
739
|
+
If `true`, then user can clear the value of the input. Will be ignored if `rows` prop is in use.
|
|
740
|
+
|
|
741
|
+
boolean
|
|
742
|
+
|
|
743
|
+
|
|
744
|
+
|
|
745
|
+
| \- | Set boolean |
|
|
746
|
+
| defaultValue |
|
|
747
|
+
|
|
748
|
+
The value of the input. Can be a string or a number. Use for uncontrolled inputs.
|
|
749
|
+
|
|
750
|
+
T
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
| \- | Set object |
|
|
755
|
+
| formatter |
|
|
756
|
+
|
|
757
|
+
Bring your own formatter that will be used to format the value when the input is not focused, allowing you to display the value in a different format. e.g. User type in value="dsf 987kkk123" => result after formatter: $987,123 (string)
|
|
758
|
+
|
|
759
|
+
(value?: T) => string | number
|
|
760
|
+
|
|
761
|
+
| \- | \- |
|
|
762
|
+
| inline |
|
|
763
|
+
|
|
764
|
+
Make prepend/append element closer to the input content.
|
|
765
|
+
|
|
766
|
+
boolean
|
|
767
|
+
|
|
768
|
+
|
|
769
|
+
|
|
770
|
+
| \- | Set boolean |
|
|
771
|
+
| loading |
|
|
772
|
+
|
|
773
|
+
The loading states of the input field. If provided a string, will use that text as the loading message.
|
|
774
|
+
|
|
775
|
+
union
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
| \- | Set object |
|
|
780
|
+
| onChange |
|
|
781
|
+
|
|
782
|
+
Emitted when the input value changes with the new changed value.
|
|
783
|
+
|
|
784
|
+
(e: ChangeEvent<InputBaseElement<TRows>>, value?: T) => void
|
|
785
|
+
|
|
786
|
+
| \- | \- |
|
|
787
|
+
| onClear |
|
|
788
|
+
|
|
789
|
+
Emitted when the input is manually cleared.
|
|
790
|
+
|
|
791
|
+
(e: ChangeEvent<InputBaseElement<TRows>>) => void
|
|
792
|
+
|
|
793
|
+
| \- | \- |
|
|
794
|
+
| prepend |
|
|
795
|
+
|
|
796
|
+
Content to prepended to the input field, usually an icon.
|
|
797
|
+
|
|
798
|
+
ReactNode
|
|
799
|
+
|
|
800
|
+
|
|
801
|
+
|
|
802
|
+
| \- | Set object |
|
|
803
|
+
| value |
|
|
804
|
+
|
|
805
|
+
The value of the input. Can be a string or a number. Use for controlled inputs.
|
|
806
|
+
|
|
807
|
+
T
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
|
|
811
|
+
| \- | Set object |
|
|
812
|
+
| width |
|
|
813
|
+
|
|
814
|
+
The width of the input.
|
|
815
|
+
|
|
816
|
+
FormElementWidths
|
|
817
|
+
|
|
818
|
+
|
|
819
|
+
|
|
820
|
+
| \- | \- |
|
|
821
|
+
|
|
822
|
+
### Textareas
|
|
823
|
+
|
|
824
|
+
You can also use `IressInput` to render a `textarea` instead of an `input`. Simply set the rows prop to the number of lines of text you'd like to display. This will set the height of the `textarea`; if a user enters more lines of text than the number of rows, a scrollbar will be displayed.
|
|
825
|
+
|
|
826
|
+
[](./iframe.html?id=components-input--text-areas)
|
|
827
|
+
|
|
828
|
+
```
|
|
829
|
+
|
|
830
|
+
<IressInput rows\={5} />
|
|
831
|
+
|
|
832
|
+
```
|
|
833
|
+
|
|
834
|
+
#### Props
|
|
835
|
+
|
|
836
|
+
| Name | Description | Default | Control |
|
|
837
|
+
| --- | --- | --- | --- |
|
|
838
|
+
| alignRight |
|
|
839
|
+
Set input content align to right, useful for numeric inputs.
|
|
840
|
+
|
|
841
|
+
boolean
|
|
842
|
+
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
| \- | Set boolean |
|
|
846
|
+
| append |
|
|
847
|
+
|
|
848
|
+
Content to append to the input field, usually a button or icon.
|
|
849
|
+
|
|
850
|
+
ReactNode
|
|
851
|
+
|
|
852
|
+
|
|
853
|
+
|
|
854
|
+
| \- | Set object |
|
|
855
|
+
| clearable |
|
|
856
|
+
|
|
857
|
+
If `true`, then user can clear the value of the input. Will be ignored if `rows` prop is in use.
|
|
858
|
+
|
|
859
|
+
boolean
|
|
860
|
+
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
| \- | Set boolean |
|
|
864
|
+
| defaultValue |
|
|
865
|
+
|
|
866
|
+
The value of the input. Can be a string or a number. Use for uncontrolled inputs.
|
|
867
|
+
|
|
868
|
+
T
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
| \- | Set object |
|
|
873
|
+
| formatter |
|
|
874
|
+
|
|
875
|
+
Bring your own formatter that will be used to format the value when the input is not focused, allowing you to display the value in a different format. e.g. User type in value="dsf 987kkk123" => result after formatter: $987,123 (string)
|
|
876
|
+
|
|
877
|
+
(value?: T) => string | number
|
|
878
|
+
|
|
879
|
+
| \- | \- |
|
|
880
|
+
| inline |
|
|
881
|
+
|
|
882
|
+
Make prepend/append element closer to the input content.
|
|
883
|
+
|
|
884
|
+
boolean
|
|
885
|
+
|
|
886
|
+
|
|
887
|
+
|
|
888
|
+
| \- | Set boolean |
|
|
889
|
+
| loading |
|
|
890
|
+
|
|
891
|
+
The loading states of the input field. If provided a string, will use that text as the loading message.
|
|
892
|
+
|
|
893
|
+
union
|
|
894
|
+
|
|
895
|
+
|
|
896
|
+
|
|
897
|
+
| \- | Set object |
|
|
898
|
+
| onChange |
|
|
899
|
+
|
|
900
|
+
Emitted when the input value changes with the new changed value.
|
|
901
|
+
|
|
902
|
+
(e: ChangeEvent<InputBaseElement<TRows>>, value?: T) => void
|
|
903
|
+
|
|
904
|
+
| \- | \- |
|
|
905
|
+
| onClear |
|
|
906
|
+
|
|
907
|
+
Emitted when the input is manually cleared.
|
|
908
|
+
|
|
909
|
+
(e: ChangeEvent<InputBaseElement<TRows>>) => void
|
|
910
|
+
|
|
911
|
+
| \- | \- |
|
|
912
|
+
| prepend |
|
|
913
|
+
|
|
914
|
+
Content to prepended to the input field, usually an icon.
|
|
915
|
+
|
|
916
|
+
ReactNode
|
|
917
|
+
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
| \- | Set object |
|
|
921
|
+
| rows |
|
|
922
|
+
|
|
923
|
+
number
|
|
924
|
+
|
|
925
|
+
|
|
926
|
+
|
|
927
|
+
| \- | |
|
|
928
|
+
| value |
|
|
929
|
+
|
|
930
|
+
The value of the input. Can be a string or a number. Use for controlled inputs.
|
|
931
|
+
|
|
932
|
+
T
|
|
933
|
+
|
|
934
|
+
|
|
935
|
+
|
|
936
|
+
| \- | Set object |
|
|
937
|
+
| width |
|
|
938
|
+
|
|
939
|
+
The width of the input.
|
|
940
|
+
|
|
941
|
+
FormElementWidths
|
|
942
|
+
|
|
943
|
+
|
|
944
|
+
|
|
945
|
+
| \- | Set object |
|
|
946
|
+
|
|
947
|
+
### Slot props
|
|
948
|
+
|
|
949
|
+
Content (typically icons) can be added to slots (`append` and `prepend`) within the `IressInput` component.
|
|
950
|
+
|
|
951
|
+
* **Prepend**: appears before the input
|
|
952
|
+
* **Append**: appears after the input
|
|
953
|
+
|
|
954
|
+
[](./iframe.html?id=components-input--slots)
|
|
955
|
+
|
|
956
|
+
```
|
|
957
|
+
|
|
958
|
+
<IressStack gap\="md"\>
|
|
959
|
+
<IressInput
|
|
960
|
+
placeholder\="Prepend slot"
|
|
961
|
+
prepend\={<IressIcon name\="search" />}
|
|
962
|
+
/>
|
|
963
|
+
<IressInput
|
|
964
|
+
append\={<IressIcon name\="search" />}
|
|
965
|
+
placeholder\="Append slot"
|
|
966
|
+
/>
|
|
967
|
+
<IressInput
|
|
968
|
+
placeholder\="Prepend slot"
|
|
969
|
+
prepend\={<IressIcon name\="search" />}
|
|
970
|
+
/>
|
|
971
|
+
<IressInput
|
|
972
|
+
append\={<IressIcon name\="search" />}
|
|
973
|
+
placeholder\="Append slot"
|
|
974
|
+
/>
|
|
975
|
+
</IressStack\>
|
|
976
|
+
|
|
977
|
+
```
|
|
978
|
+
|
|
979
|
+
#### Props
|
|
980
|
+
|
|
981
|
+
| Name | Description | Default | Control |
|
|
982
|
+
| --- | --- | --- | --- |
|
|
983
|
+
| alignRight |
|
|
984
|
+
Set input content align to right, useful for numeric inputs.
|
|
985
|
+
|
|
986
|
+
boolean
|
|
987
|
+
|
|
988
|
+
|
|
989
|
+
|
|
990
|
+
| \- | Set boolean |
|
|
991
|
+
| append |
|
|
992
|
+
|
|
993
|
+
Content to append to the input field, usually a button or icon.
|
|
994
|
+
|
|
995
|
+
ReactNode
|
|
996
|
+
|
|
997
|
+
|
|
998
|
+
|
|
999
|
+
| \- | Set object |
|
|
1000
|
+
| clearable |
|
|
1001
|
+
|
|
1002
|
+
If `true`, then user can clear the value of the input. Will be ignored if `rows` prop is in use.
|
|
1003
|
+
|
|
1004
|
+
boolean
|
|
1005
|
+
|
|
1006
|
+
|
|
1007
|
+
|
|
1008
|
+
| \- | Set boolean |
|
|
1009
|
+
| defaultValue |
|
|
1010
|
+
|
|
1011
|
+
The value of the input. Can be a string or a number. Use for uncontrolled inputs.
|
|
1012
|
+
|
|
1013
|
+
T
|
|
1014
|
+
|
|
1015
|
+
|
|
1016
|
+
|
|
1017
|
+
| \- | Set object |
|
|
1018
|
+
| formatter |
|
|
1019
|
+
|
|
1020
|
+
Bring your own formatter that will be used to format the value when the input is not focused, allowing you to display the value in a different format. e.g. User type in value="dsf 987kkk123" => result after formatter: $987,123 (string)
|
|
1021
|
+
|
|
1022
|
+
(value?: T) => string | number
|
|
1023
|
+
|
|
1024
|
+
| \- | \- |
|
|
1025
|
+
| inline |
|
|
1026
|
+
|
|
1027
|
+
Make prepend/append element closer to the input content.
|
|
1028
|
+
|
|
1029
|
+
boolean
|
|
1030
|
+
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
| \- | Set boolean |
|
|
1034
|
+
| loading |
|
|
1035
|
+
|
|
1036
|
+
The loading states of the input field. If provided a string, will use that text as the loading message.
|
|
1037
|
+
|
|
1038
|
+
union
|
|
1039
|
+
|
|
1040
|
+
|
|
1041
|
+
|
|
1042
|
+
| \- | Set object |
|
|
1043
|
+
| onChange |
|
|
1044
|
+
|
|
1045
|
+
Emitted when the input value changes with the new changed value.
|
|
1046
|
+
|
|
1047
|
+
(e: ChangeEvent<InputBaseElement<TRows>>, value?: T) => void
|
|
1048
|
+
|
|
1049
|
+
| \- | \- |
|
|
1050
|
+
| onClear |
|
|
1051
|
+
|
|
1052
|
+
Emitted when the input is manually cleared.
|
|
1053
|
+
|
|
1054
|
+
(e: ChangeEvent<InputBaseElement<TRows>>) => void
|
|
1055
|
+
|
|
1056
|
+
| \- | \- |
|
|
1057
|
+
| prepend |
|
|
1058
|
+
|
|
1059
|
+
Content to prepended to the input field, usually an icon.
|
|
1060
|
+
|
|
1061
|
+
ReactNode
|
|
1062
|
+
|
|
1063
|
+
|
|
1064
|
+
|
|
1065
|
+
| \- | Set object |
|
|
1066
|
+
| value |
|
|
1067
|
+
|
|
1068
|
+
The value of the input. Can be a string or a number. Use for controlled inputs.
|
|
1069
|
+
|
|
1070
|
+
T
|
|
1071
|
+
|
|
1072
|
+
|
|
1073
|
+
|
|
1074
|
+
| \- | Set object |
|
|
1075
|
+
| width |
|
|
1076
|
+
|
|
1077
|
+
The width of the input.
|
|
1078
|
+
|
|
1079
|
+
FormElementWidths
|
|
1080
|
+
|
|
1081
|
+
|
|
1082
|
+
|
|
1083
|
+
| \- | Set object |
|
|
1084
|
+
|
|
1085
|
+
### Read only
|
|
1086
|
+
|
|
1087
|
+
The `readOnly` prop can be set to prevent the user from changing the value of the input. This will change the input to a custom read-only style and the user will not be able to interact with the input.
|
|
1088
|
+
|
|
1089
|
+
If you need more control over the read-only state (for example, rendering a stylised version of the value), you can use the [`IressReadonly` component](?path=/docs/components-readonly--docs).
|
|
1090
|
+
|
|
1091
|
+
[](./iframe.html?id=components-input--read-only)
|
|
1092
|
+
|
|
1093
|
+
Value
|
|
1094
|
+
|
|
1095
|
+
```
|
|
1096
|
+
|
|
1097
|
+
<IressInput
|
|
1098
|
+
append\=""
|
|
1099
|
+
placeholder\="Enter your name"
|
|
1100
|
+
prepend\=""
|
|
1101
|
+
readOnly
|
|
1102
|
+
value\="Value"
|
|
1103
|
+
/>
|
|
1104
|
+
|
|
1105
|
+
```
|
|
1106
|
+
|
|
1107
|
+
#### Props
|
|
1108
|
+
|
|
1109
|
+
| Name | Description | Default | Control |
|
|
1110
|
+
| --- | --- | --- | --- |
|
|
1111
|
+
| alignRight |
|
|
1112
|
+
Set input content align to right, useful for numeric inputs.
|
|
1113
|
+
|
|
1114
|
+
boolean
|
|
1115
|
+
|
|
1116
|
+
|
|
1117
|
+
|
|
1118
|
+
| \- | Set boolean |
|
|
1119
|
+
| append |
|
|
1120
|
+
|
|
1121
|
+
Content to append to the input field, usually a button or icon.
|
|
1122
|
+
|
|
1123
|
+
ReactNode
|
|
1124
|
+
|
|
1125
|
+
|
|
1126
|
+
|
|
1127
|
+
| \- |
|
|
1128
|
+
|
|
1129
|
+
""
|
|
1130
|
+
|
|
1131
|
+
|
|
|
1132
|
+
| clearable |
|
|
1133
|
+
|
|
1134
|
+
If `true`, then user can clear the value of the input. Will be ignored if `rows` prop is in use.
|
|
1135
|
+
|
|
1136
|
+
boolean
|
|
1137
|
+
|
|
1138
|
+
|
|
1139
|
+
|
|
1140
|
+
| \- | Set boolean |
|
|
1141
|
+
| defaultValue |
|
|
1142
|
+
|
|
1143
|
+
The value of the input. Can be a string or a number. Use for uncontrolled inputs.
|
|
1144
|
+
|
|
1145
|
+
T
|
|
1146
|
+
|
|
1147
|
+
|
|
1148
|
+
|
|
1149
|
+
| \- | Set object |
|
|
1150
|
+
| formatter |
|
|
1151
|
+
|
|
1152
|
+
Bring your own formatter that will be used to format the value when the input is not focused, allowing you to display the value in a different format. e.g. User type in value="dsf 987kkk123" => result after formatter: $987,123 (string)
|
|
1153
|
+
|
|
1154
|
+
(value?: T) => string | number
|
|
1155
|
+
|
|
1156
|
+
| \- | \- |
|
|
1157
|
+
| inline |
|
|
1158
|
+
|
|
1159
|
+
Make prepend/append element closer to the input content.
|
|
1160
|
+
|
|
1161
|
+
boolean
|
|
1162
|
+
|
|
1163
|
+
|
|
1164
|
+
|
|
1165
|
+
| \- | Set boolean |
|
|
1166
|
+
| loading |
|
|
1167
|
+
|
|
1168
|
+
The loading states of the input field. If provided a string, will use that text as the loading message.
|
|
1169
|
+
|
|
1170
|
+
union
|
|
1171
|
+
|
|
1172
|
+
|
|
1173
|
+
|
|
1174
|
+
| \- | Set object |
|
|
1175
|
+
| onChange |
|
|
1176
|
+
|
|
1177
|
+
Emitted when the input value changes with the new changed value.
|
|
1178
|
+
|
|
1179
|
+
(e: ChangeEvent<InputBaseElement<TRows>>, value?: T) => void
|
|
1180
|
+
|
|
1181
|
+
| \- | \- |
|
|
1182
|
+
| onClear |
|
|
1183
|
+
|
|
1184
|
+
Emitted when the input is manually cleared.
|
|
1185
|
+
|
|
1186
|
+
(e: ChangeEvent<InputBaseElement<TRows>>) => void
|
|
1187
|
+
|
|
1188
|
+
| \- | \- |
|
|
1189
|
+
| placeholder |
|
|
1190
|
+
|
|
1191
|
+
string
|
|
1192
|
+
|
|
1193
|
+
|
|
1194
|
+
|
|
1195
|
+
| \- | Enter your name |
|
|
1196
|
+
| prepend |
|
|
1197
|
+
|
|
1198
|
+
Content to prepended to the input field, usually an icon.
|
|
1199
|
+
|
|
1200
|
+
ReactNode
|
|
1201
|
+
|
|
1202
|
+
|
|
1203
|
+
|
|
1204
|
+
| \- |
|
|
1205
|
+
|
|
1206
|
+
""
|
|
1207
|
+
|
|
1208
|
+
|
|
|
1209
|
+
| readOnly |
|
|
1210
|
+
|
|
1211
|
+
boolean
|
|
1212
|
+
|
|
1213
|
+
|
|
1214
|
+
|
|
1215
|
+
| \- | FalseTrue |
|
|
1216
|
+
| value |
|
|
1217
|
+
|
|
1218
|
+
The value of the input. Can be a string or a number. Use for controlled inputs.
|
|
1219
|
+
|
|
1220
|
+
T
|
|
1221
|
+
|
|
1222
|
+
|
|
1223
|
+
|
|
1224
|
+
| \- |
|
|
1225
|
+
|
|
1226
|
+
"Value"
|
|
1227
|
+
|
|
1228
|
+
|
|
|
1229
|
+
| width |
|
|
1230
|
+
|
|
1231
|
+
The width of the input.
|
|
1232
|
+
|
|
1233
|
+
FormElementWidths
|
|
1234
|
+
|
|
1235
|
+
|
|
1236
|
+
|
|
1237
|
+
| \- | Set object |
|
|
1238
|
+
|
|
1239
|
+
### Formatter
|
|
1240
|
+
|
|
1241
|
+
`formatter` allows you to display the value in a different format when the input is not focused. A typical use case is to format a string with currency symbols and commas.
|
|
1242
|
+
|
|
1243
|
+
This prop powers the `IressInputCurrency` component to allow friendly and consistent currency display in Iress products.
|
|
1244
|
+
|
|
1245
|
+
**Notes:**
|
|
1246
|
+
|
|
1247
|
+
* When `formatter` is set, the `type` of the input is changed to `text` when not in focus. Keep this in mind when you are testing the component. If you have set the `type` to number and have set a `formatter`, the role of the input will be `textbox` when not in focus, but `spinbutton` when in focus.
|
|
1248
|
+
* The value of the native input will be the formatted value, not the raw value. If you need the raw value, you can use the `onChange` prop to capture the raw value.
|
|
1249
|
+
|
|
1250
|
+
The example below changes the value entered to uppercase when the input is not focused.
|
|
1251
|
+
|
|
1252
|
+
[](./iframe.html?id=components-input--formatter)
|
|
1253
|
+
|
|
1254
|
+
```
|
|
1255
|
+
|
|
1256
|
+
<IressInput
|
|
1257
|
+
append\=""
|
|
1258
|
+
formatter\={(value) \=> value ? value.toString().toUpperCase() : ""}
|
|
1259
|
+
placeholder\="Enter a string and it will show in UPPERCASE when not focused, and show the raw value on focus"
|
|
1260
|
+
prepend\=""
|
|
1261
|
+
/>
|
|
1262
|
+
|
|
1263
|
+
```
|
|
1264
|
+
|
|
1265
|
+
#### Props
|
|
1266
|
+
|
|
1267
|
+
| Name | Description | Default | Control |
|
|
1268
|
+
| --- | --- | --- | --- |
|
|
1269
|
+
| alignRight |
|
|
1270
|
+
Set input content align to right, useful for numeric inputs.
|
|
1271
|
+
|
|
1272
|
+
boolean
|
|
1273
|
+
|
|
1274
|
+
|
|
1275
|
+
|
|
1276
|
+
| \- | Set boolean |
|
|
1277
|
+
| append |
|
|
1278
|
+
|
|
1279
|
+
Content to append to the input field, usually a button or icon.
|
|
1280
|
+
|
|
1281
|
+
ReactNode
|
|
1282
|
+
|
|
1283
|
+
|
|
1284
|
+
|
|
1285
|
+
| \- |
|
|
1286
|
+
|
|
1287
|
+
""
|
|
1288
|
+
|
|
1289
|
+
|
|
|
1290
|
+
| clearable |
|
|
1291
|
+
|
|
1292
|
+
If `true`, then user can clear the value of the input. Will be ignored if `rows` prop is in use.
|
|
1293
|
+
|
|
1294
|
+
boolean
|
|
1295
|
+
|
|
1296
|
+
|
|
1297
|
+
|
|
1298
|
+
| \- | Set boolean |
|
|
1299
|
+
| defaultValue |
|
|
1300
|
+
|
|
1301
|
+
The value of the input. Can be a string or a number. Use for uncontrolled inputs.
|
|
1302
|
+
|
|
1303
|
+
T
|
|
1304
|
+
|
|
1305
|
+
|
|
1306
|
+
|
|
1307
|
+
| \- | Set object |
|
|
1308
|
+
| formatter |
|
|
1309
|
+
|
|
1310
|
+
Bring your own formatter that will be used to format the value when the input is not focused, allowing you to display the value in a different format. e.g. User type in value="dsf 987kkk123" => result after formatter: $987,123 (string)
|
|
1311
|
+
|
|
1312
|
+
(value?: T) => string | number
|
|
1313
|
+
|
|
1314
|
+
| \- | \- |
|
|
1315
|
+
| inline |
|
|
1316
|
+
|
|
1317
|
+
Make prepend/append element closer to the input content.
|
|
1318
|
+
|
|
1319
|
+
boolean
|
|
1320
|
+
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
| \- | Set boolean |
|
|
1324
|
+
| loading |
|
|
1325
|
+
|
|
1326
|
+
The loading states of the input field. If provided a string, will use that text as the loading message.
|
|
1327
|
+
|
|
1328
|
+
union
|
|
1329
|
+
|
|
1330
|
+
|
|
1331
|
+
|
|
1332
|
+
| \- | Set object |
|
|
1333
|
+
| onChange |
|
|
1334
|
+
|
|
1335
|
+
Emitted when the input value changes with the new changed value.
|
|
1336
|
+
|
|
1337
|
+
(e: ChangeEvent<InputBaseElement<TRows>>, value?: T) => void
|
|
1338
|
+
|
|
1339
|
+
| \- | \- |
|
|
1340
|
+
| onClear |
|
|
1341
|
+
|
|
1342
|
+
Emitted when the input is manually cleared.
|
|
1343
|
+
|
|
1344
|
+
(e: ChangeEvent<InputBaseElement<TRows>>) => void
|
|
1345
|
+
|
|
1346
|
+
| \- | \- |
|
|
1347
|
+
| placeholder |
|
|
1348
|
+
|
|
1349
|
+
string
|
|
1350
|
+
|
|
1351
|
+
|
|
1352
|
+
|
|
1353
|
+
| \- | Enter a string and it will show in UPPERCASE when not focused, and show the raw value on focus |
|
|
1354
|
+
| prepend |
|
|
1355
|
+
|
|
1356
|
+
Content to prepended to the input field, usually an icon.
|
|
1357
|
+
|
|
1358
|
+
ReactNode
|
|
1359
|
+
|
|
1360
|
+
|
|
1361
|
+
|
|
1362
|
+
| \- |
|
|
1363
|
+
|
|
1364
|
+
""
|
|
1365
|
+
|
|
1366
|
+
|
|
|
1367
|
+
| value |
|
|
1368
|
+
|
|
1369
|
+
The value of the input. Can be a string or a number. Use for controlled inputs.
|
|
1370
|
+
|
|
1371
|
+
T
|
|
1372
|
+
|
|
1373
|
+
|
|
1374
|
+
|
|
1375
|
+
| \- | Set object |
|
|
1376
|
+
| width |
|
|
1377
|
+
|
|
1378
|
+
The width of the input.
|
|
1379
|
+
|
|
1380
|
+
FormElementWidths
|
|
1381
|
+
|
|
1382
|
+
|
|
1383
|
+
|
|
1384
|
+
| \- | Set object |
|
|
1385
|
+
|
|
1386
|
+
### `onChange` and `onInput`
|
|
1387
|
+
|
|
1388
|
+
As of version 5, the `onChange` and `onInput` events are now consistent with how React handles the events. This means that the `onChange` event will fire at the same time as `onInput`.
|