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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
|
# AUTO GENERATED FILE - DO NOT EDIT
import typing # noqa: F401
from typing_extensions import TypedDict, NotRequired, Literal # noqa: F401
from dash.development.base_component import Component, _explicitize_args
ComponentType = typing.Union[
str,
int,
float,
Component,
None,
typing.Sequence[typing.Union[str, int, float, Component, None]],
]
NumberType = typing.Union[
typing.SupportsFloat, typing.SupportsInt, typing.SupportsComplex
]
class Input(Component):
"""An Input component.
A basic HTML input control for entering text, numbers, or passwords.
Note that checkbox and radio types are supported through
the Checklist and RadioItems component. Dates, times, and file uploads
are also supported through separate components.
Keyword arguments:
- value (string | number; optional):
The value of the input.
- type (a value equal to: 'text', 'number', 'password', 'email', 'range', 'search', 'tel', 'url', 'hidden'; default 'text'):
The type of control to render.
- debounce (boolean | number; default False):
If True, changes to input will be sent back to the Dash server
only on enter or when losing focus. If it's False, it will send
the value back on every change. If a number, it will not send
anything back to the Dash server until the user has stopped typing
for that number of seconds.
- placeholder (string | number; optional):
A hint to the user of what can be entered in the control . The
placeholder text must not contain carriage returns or line-feeds.
Note: Do not use the placeholder attribute instead of a <label>
element, their purposes are different. The <label> attribute
describes the role of the form element (i.e. it indicates what
kind of information is expected), and the placeholder attribute is
a hint about the format that the content should take. There are
cases in which the placeholder attribute is never displayed to the
user, so the form must be understandable without it.
- n_submit (number; default 0):
Number of times the `Enter` key was pressed while the input had
focus.
- n_submit_timestamp (number; default -1):
Last time that `Enter` was pressed.
- inputMode (a value equal to: 'verbatim', 'latin', 'latin-name', 'latin-prose', 'full-width-latin', 'kana', 'katakana', 'numeric', 'tel', 'email', 'url'; optional):
Provides a hint to the browser as to the type of data that might
be entered by the user while editing the element or its contents.
- autoComplete (string; optional):
This attribute indicates whether the value of the control can be
automatically completed by the browser.
- readOnly (boolean | a value equal to: 'readOnly', 'readonly', 'READONLY'; optional):
This attribute indicates that the user cannot modify the value of
the control. The value of the attribute is irrelevant. If you need
read-write access to the input value, do not add the \"readonly\"
attribute. It is ignored if the value of the type attribute is
hidden, range, color, checkbox, radio, file, or a button type
(such as button or submit). readOnly is an HTML boolean attribute
- it is enabled by a boolean or 'readOnly'. Alternative
capitalizations `readonly` & `READONLY` are also acccepted.
- required (a value equal to: 'required', 'REQUIRED' | boolean; optional):
This attribute specifies that the user must fill in a value before
submitting a form. It cannot be used when the type attribute is
hidden, image, or a button type (submit, reset, or button). The
:optional and :required CSS pseudo-classes will be applied to the
field as appropriate. required is an HTML boolean attribute - it
is enabled by a boolean or 'required'. Alternative capitalizations
`REQUIRED` are also acccepted.
- autoFocus (a value equal to: 'autoFocus', 'autofocus', 'AUTOFOCUS' | boolean; optional):
The element should be automatically focused after the page loaded.
autoFocus is an HTML boolean attribute - it is enabled by a
boolean or 'autoFocus'. Alternative capitalizations `autofocus` &
`AUTOFOCUS` are also acccepted.
- disabled (a value equal to: 'disabled', 'DISABLED' | boolean; optional):
If True, the input is disabled and can't be clicked on. disabled
is an HTML boolean attribute - it is enabled by a boolean or
'disabled'. Alternative capitalizations `DISABLED`.
- list (string; optional):
Identifies a list of pre-defined options to suggest to the user.
The value must be the id of a <datalist> element in the same
document. The browser displays only options that are valid values
for this input element. This attribute is ignored when the type
attribute's value is hidden, checkbox, radio, file, or a button
type.
- multiple (boolean; optional):
This Boolean attribute indicates whether the user can enter more
than one value. This attribute applies when the type attribute is
set to email or file, otherwise it is ignored.
- spellCheck (a value equal to: 'true', 'false' | boolean; optional):
Setting the value of this attribute to True indicates that the
element needs to have its spelling and grammar checked. The value
default indicates that the element is to act according to a
default behavior, possibly based on the parent element's own
spellcheck value. The value False indicates that the element
should not be checked.
- name (string; optional):
The name of the control, which is submitted with the form data.
- min (string | number; optional):
The minimum (numeric or date-time) value for this item, which must
not be greater than its maximum (max attribute) value.
- max (string | number; optional):
The maximum (numeric or date-time) value for this item, which must
not be less than its minimum (min attribute) value.
- step (string | number; default 'any'):
Works with the min and max attributes to limit the increments at
which a numeric or date-time value can be set. It can be the
string any or a positive floating point number. If this attribute
is not set to any, the control accepts only values at multiples of
the step value greater than the minimum.
- minLength (string | number; optional):
If the value of the type attribute is text, email, search,
password, tel, or url, this attribute specifies the minimum number
of characters (in Unicode code points) that the user can enter.
For other control types, it is ignored.
- maxLength (string | number; optional):
If the value of the type attribute is text, email, search,
password, tel, or url, this attribute specifies the maximum number
of characters (in UTF-16 code units) that the user can enter. For
other control types, it is ignored. It can exceed the value of the
size attribute. If it is not specified, the user can enter an
unlimited number of characters. Specifying a negative number
results in the default behavior (i.e. the user can enter an
unlimited number of characters). The constraint is evaluated only
when the value of the attribute has been changed.
- pattern (string; optional):
A regular expression that the control's value is checked against.
The pattern must match the entire value, not just some subset. Use
the title attribute to describe the pattern to help the user. This
attribute applies when the value of the type attribute is text,
search, tel, url, email, or password, otherwise it is ignored. The
regular expression language is the same as JavaScript RegExp
algorithm, with the 'u' parameter that makes it treat the pattern
as a sequence of unicode code points. The pattern is not
surrounded by forward slashes.
- selectionStart (string; optional):
The offset into the element's text content of the first selected
character. If there's no selection, this value indicates the
offset to the character following the current text input cursor
position (that is, the position the next character typed would
occupy).
- selectionEnd (string; optional):
The offset into the element's text content of the last selected
character. If there's no selection, this value indicates the
offset to the character following the current text input cursor
position (that is, the position the next character typed would
occupy).
- selectionDirection (string; optional):
The direction in which selection occurred. This is \"forward\" if
the selection was made from left-to-right in an LTR locale or
right-to-left in an RTL locale, or \"backward\" if the selection
was made in the opposite direction. On platforms on which it's
possible this value isn't known, the value can be \"none\"; for
example, on macOS, the default direction is \"none\", then as the
user begins to modify the selection using the keyboard, this will
change to reflect the direction in which the selection is
expanding.
- n_blur (number; default 0):
Number of times the input lost focus.
- n_blur_timestamp (number; default -1):
Last time the input lost focus.
- size (string; optional):
The initial size of the control. This value is in pixels unless
the value of the type attribute is text or password, in which case
it is an integer number of characters. Starting in, this attribute
applies only when the type attribute is set to text, search, tel,
url, email, or password, otherwise it is ignored. In addition, the
size must be greater than zero. If you do not specify a size, a
default value of 20 is used.' simply states \"the user agent
should ensure that at least that many characters are visible\",
but different characters can have different widths in certain
fonts. In some browsers, a certain string with x characters will
not be entirely visible even if size is defined to at least x.
- className (string; optional):
The class of the input element.
- id (string; optional):
The ID of this component, used to identify dash components in
callbacks. The ID needs to be unique across all of the components
in an app.
- persistence (boolean | string | number; optional):
Used to allow user interactions in this component to be persisted
when the component - or the page - is refreshed. If `persisted` is
truthy and hasn't changed from its previous value, a `value` that
the user has changed while using the app will keep that change, as
long as the new `value` also matches what was given originally.
Used in conjunction with `persistence_type`.
- persisted_props (list of a value equal to: 'value's; default ['value']):
Properties whose user interactions will persist after refreshing
the component or the page. Since only `value` is allowed this prop
can normally be ignored.
- persistence_type (a value equal to: 'local', 'session', 'memory'; default 'local'):
Where persisted user changes will be stored: memory: only kept in
memory, reset on page refresh. local: window.localStorage, data is
kept after the browser quit. session: window.sessionStorage, data
is cleared once the browser quit."""
_children_props = []
_base_nodes = ["children"]
_namespace = "dash_core_components"
_type = "Input"
def __init__(
self,
value: typing.Optional[typing.Union[str, NumberType]] = None,
type: typing.Optional[
Literal[
"text",
"number",
"password",
"email",
"range",
"search",
"tel",
"url",
"hidden",
]
] = None,
debounce: typing.Optional[typing.Union[bool, NumberType]] = None,
placeholder: typing.Optional[typing.Union[str, NumberType]] = None,
n_submit: typing.Optional[NumberType] = None,
n_submit_timestamp: typing.Optional[NumberType] = None,
inputMode: typing.Optional[
Literal[
"verbatim",
"latin",
"latin-name",
"latin-prose",
"full-width-latin",
"kana",
"katakana",
"numeric",
"tel",
"email",
"url",
]
] = None,
autoComplete: typing.Optional[str] = None,
readOnly: typing.Optional[
typing.Union[bool, Literal["readOnly", "readonly", "READONLY"]]
] = None,
required: typing.Optional[
typing.Union[Literal["required", "REQUIRED"], bool]
] = None,
autoFocus: typing.Optional[
typing.Union[Literal["autoFocus", "autofocus", "AUTOFOCUS"], bool]
] = None,
disabled: typing.Optional[
typing.Union[Literal["disabled", "DISABLED"], bool]
] = None,
list: typing.Optional[str] = None,
multiple: typing.Optional[bool] = None,
spellCheck: typing.Optional[
typing.Union[Literal["true", "false"], bool]
] = None,
name: typing.Optional[str] = None,
min: typing.Optional[typing.Union[str, NumberType]] = None,
max: typing.Optional[typing.Union[str, NumberType]] = None,
step: typing.Optional[typing.Union[str, NumberType]] = None,
minLength: typing.Optional[typing.Union[str, NumberType]] = None,
maxLength: typing.Optional[typing.Union[str, NumberType]] = None,
pattern: typing.Optional[str] = None,
selectionStart: typing.Optional[str] = None,
selectionEnd: typing.Optional[str] = None,
selectionDirection: typing.Optional[str] = None,
n_blur: typing.Optional[NumberType] = None,
n_blur_timestamp: typing.Optional[NumberType] = None,
size: typing.Optional[str] = None,
style: typing.Optional[typing.Any] = None,
className: typing.Optional[str] = None,
id: typing.Optional[typing.Union[str, dict]] = None,
persistence: typing.Optional[typing.Union[bool, str, NumberType]] = None,
persisted_props: typing.Optional[typing.Sequence[Literal["value"]]] = None,
persistence_type: typing.Optional[Literal["local", "session", "memory"]] = None,
**kwargs
):
self._prop_names = [
"value",
"type",
"debounce",
"placeholder",
"n_submit",
"n_submit_timestamp",
"inputMode",
"autoComplete",
"readOnly",
"required",
"autoFocus",
"disabled",
"list",
"multiple",
"spellCheck",
"name",
"min",
"max",
"step",
"minLength",
"maxLength",
"pattern",
"selectionStart",
"selectionEnd",
"selectionDirection",
"n_blur",
"n_blur_timestamp",
"size",
"style",
"className",
"id",
"persistence",
"persisted_props",
"persistence_type",
]
self._valid_wildcard_attributes = []
self.available_properties = [
"value",
"type",
"debounce",
"placeholder",
"n_submit",
"n_submit_timestamp",
"inputMode",
"autoComplete",
"readOnly",
"required",
"autoFocus",
"disabled",
"list",
"multiple",
"spellCheck",
"name",
"min",
"max",
"step",
"minLength",
"maxLength",
"pattern",
"selectionStart",
"selectionEnd",
"selectionDirection",
"n_blur",
"n_blur_timestamp",
"size",
"style",
"className",
"id",
"persistence",
"persisted_props",
"persistence_type",
]
self.available_wildcard_properties = []
_explicit_args = kwargs.pop("_explicit_args")
_locals = locals()
_locals.update(kwargs) # For wildcard attrs and excess named props
args = {k: _locals[k] for k in _explicit_args}
super(Input, self).__init__(**args)
setattr(Input, "__init__", _explicitize_args(Input.__init__))
|