|
| 1 | +# AUTO GENERATED FILE - DO NOT EDIT |
| 2 | + |
| 3 | +from dash.development.base_component import Component, _explicitize_args |
| 4 | + |
| 5 | + |
| 6 | +class Keyboard(Component): |
| 7 | + """A Keyboard component. |
| 8 | +The Keyboard component listens for keyboard events. |
| 9 | +
|
| 10 | +Keyword arguments: |
| 11 | +
|
| 12 | +- children (a list of or a singular dash component, string or number; optional): |
| 13 | + The children of this component. If any children are provided, the |
| 14 | + component will listen for events from these components. If no |
| 15 | + children are specified, the component will listen for events from |
| 16 | + the document object. |
| 17 | +
|
| 18 | +- id (string; optional): |
| 19 | + The ID used to identify this component in Dash callbacks. |
| 20 | +
|
| 21 | +- captureKeys (list of strings; optional): |
| 22 | + The keys to capture. Defaults to all keys. |
| 23 | +
|
| 24 | +- className (string; optional): |
| 25 | + A custom class name. |
| 26 | +
|
| 27 | +- eventProps (list of strings; default ["key", "altKey", "ctrlKey", "shiftKey","metaKey", "repeat"]): |
| 28 | + The event properties to forward to dash, see |
| 29 | + https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent. |
| 30 | +
|
| 31 | +- keydown (dict; optional): |
| 32 | + keydown (dict) the object that holds the result of the key down |
| 33 | + event. It is a dictionary with the following keys: \"key\", |
| 34 | + \"altKey\", \"ctrlKey\", \"shiftKey\",\"metaKey\", \"repeat\". |
| 35 | + Those keys have the following values: - key (str) which key is |
| 36 | + pressed - altKey (bool) whether the Alt key is pressed - |
| 37 | + ctrlKey (bool) Ctrl key is pressed - shiftKey (bool) Shift key |
| 38 | + is pressed - metaKey (bool) Meta key is pressed (Mac: Command |
| 39 | + key or PC: Windows key) - repeat (bool) whether the key is held |
| 40 | + down. |
| 41 | +
|
| 42 | +- keys_pressed (dict; optional): |
| 43 | + keys_pressed (dict) is a dict of objects like keydown for all keys |
| 44 | + currently pressed. |
| 45 | +
|
| 46 | +- keyup (dict; optional): |
| 47 | + keyup (dict) the object that holds the result of the key up event. |
| 48 | + Structure like keydown. |
| 49 | +
|
| 50 | +- n_keydowns (number; default 0): |
| 51 | + A counter, which is incremented on each key down event, similar to |
| 52 | + n_clicks for buttons. |
| 53 | +
|
| 54 | +- n_keyups (number; default 0): |
| 55 | + A counter, which is incremented on each key up event, similar to |
| 56 | + n_clicks for buttons. |
| 57 | +
|
| 58 | +- style (dict; optional): |
| 59 | + The CSS style of the component. |
| 60 | +
|
| 61 | +- useCapture (boolean; default False): |
| 62 | + Value of useCapture used when registering event listeners.""" |
| 63 | + _children_props = [] |
| 64 | + _base_nodes = ['children'] |
| 65 | + _namespace = 'dash_extensions' |
| 66 | + _type = 'Keyboard' |
| 67 | + @_explicitize_args |
| 68 | + def __init__(self, children=None, style=Component.UNDEFINED, className=Component.UNDEFINED, id=Component.UNDEFINED, eventProps=Component.UNDEFINED, captureKeys=Component.UNDEFINED, keydown=Component.UNDEFINED, keyup=Component.UNDEFINED, keys_pressed=Component.UNDEFINED, n_keydowns=Component.UNDEFINED, n_keyups=Component.UNDEFINED, useCapture=Component.UNDEFINED, **kwargs): |
| 69 | + self._prop_names = ['children', 'id', 'captureKeys', 'className', 'eventProps', 'keydown', 'keys_pressed', 'keyup', 'n_keydowns', 'n_keyups', 'style', 'useCapture'] |
| 70 | + self._valid_wildcard_attributes = [] |
| 71 | + self.available_properties = ['children', 'id', 'captureKeys', 'className', 'eventProps', 'keydown', 'keys_pressed', 'keyup', 'n_keydowns', 'n_keyups', 'style', 'useCapture'] |
| 72 | + self.available_wildcard_properties = [] |
| 73 | + _explicit_args = kwargs.pop('_explicit_args') |
| 74 | + _locals = locals() |
| 75 | + _locals.update(kwargs) # For wildcard attrs and excess named props |
| 76 | + args = {k: _locals[k] for k in _explicit_args if k != 'children'} |
| 77 | + |
| 78 | + super(Keyboard, self).__init__(children=children, **args) |
0 commit comments