Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit 8120739

Browse files
authored
Merge pull request #50 from rmarren1/ide
IDE support
2 parents 9c4a714 + 7a9b00c commit 8120739

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+11390
-27
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## Unreleased
66

7+
## [0.12.0] - 2018-06-01
8+
### Changed
9+
- `dash_html_components/__init__.py` now imports from python class files rather than generating classes at runtime,
10+
adding support for IDE auto complete etc.
11+
712
## [0.11.0] - 2018-06-01
813
### Added
914
- A `n_clicks_timestamp` property was added to all of the components. This property represents the date that the element was clicked on and can be used to determine _which element was clicked on_ in callbacks with multiple elements. This is considered a stop-gap solution: ultimately we'll want a solution that works for _all_ properties across all components, not just the `n_clicks` property. https://github.com/plotly/dash-html-components/pull/45

circle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ machine:
99
dependencies:
1010
pre:
1111
- npm install -g eslint
12-
- pip install tox
12+
- pip install tox dash==0.23.1
1313
- npm install
1414
- node_modules/.bin/builder run build-dist
1515
- node_modules/.bin/builder run copy-lib

dash_html_components/A.py

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# AUTO GENERATED FILE - DO NOT EDIT
2+
3+
from dash.development.base_component import Component, _explicitize_args
4+
5+
6+
class A(Component):
7+
"""A A component.
8+
9+
10+
Keyword arguments:
11+
- children (a list of or a singular dash component, string or number; optional): The children of this component
12+
- id (string; optional): The ID of this component, used to identify dash components
13+
in callbacks. The ID needs to be unique across all of the
14+
components in an app.
15+
- n_clicks (optional): An integer that represents the number of times
16+
that this element has been clicked on.
17+
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18+
at which n_clicks changed. This can be used to tell
19+
which button was changed most recently.
20+
- key (string; optional): A unique identifier for the component, used to improve
21+
performance by React.js while rendering components
22+
See https://reactjs.org/docs/lists-and-keys.html for more info
23+
- role (string; optional): The ARIA role attribute
24+
- data-* (string; optional): A wildcard data attribute
25+
- aria-* (string; optional): A wildcard aria attribute
26+
- download (string; optional): Indicates that the hyperlink is to be used for downloading a resource.
27+
- href (string; optional): The URL of a linked resource.
28+
- hrefLang (string; optional): Specifies the language of the linked resource.
29+
- media (string; optional): Specifies a hint of the media for which the linked resource was designed.
30+
- rel (string; optional): Specifies the relationship of the target object to the link object.
31+
- shape (string; optional)
32+
- target (string; optional)
33+
- accessKey (string; optional): Defines a keyboard shortcut to activate or add focus to the element.
34+
- className (string; optional): Often used with CSS to style elements with common properties.
35+
- contentEditable (string; optional): Indicates whether the element's content is editable.
36+
- contextMenu (string; optional): Defines the ID of a <menu> element which will serve as the element's context menu.
37+
- dir (string; optional): Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
38+
- draggable (string; optional): Defines whether the element can be dragged.
39+
- hidden (string; optional): Prevents rendering of given element, while keeping child elements, e.g. script elements, active.
40+
- lang (string; optional): Defines the language used in the element.
41+
- spellCheck (string; optional): Indicates whether spell checking is allowed for the element.
42+
- style (dict; optional): Defines CSS styles which will override styles previously set.
43+
- tabIndex (string; optional): Overrides the browser's default tab order and follows the one specified instead.
44+
- title (string; optional): Text to be displayed in a tooltip when hovering over the element.
45+
46+
Available events: 'click'"""
47+
@_explicitize_args
48+
def __init__(self, children=None, id=Component.UNDEFINED, n_clicks=Component.UNDEFINED, n_clicks_timestamp=Component.UNDEFINED, key=Component.UNDEFINED, role=Component.UNDEFINED, download=Component.UNDEFINED, href=Component.UNDEFINED, hrefLang=Component.UNDEFINED, media=Component.UNDEFINED, rel=Component.UNDEFINED, shape=Component.UNDEFINED, target=Component.UNDEFINED, accessKey=Component.UNDEFINED, className=Component.UNDEFINED, contentEditable=Component.UNDEFINED, contextMenu=Component.UNDEFINED, dir=Component.UNDEFINED, draggable=Component.UNDEFINED, hidden=Component.UNDEFINED, lang=Component.UNDEFINED, spellCheck=Component.UNDEFINED, style=Component.UNDEFINED, tabIndex=Component.UNDEFINED, title=Component.UNDEFINED, **kwargs):
49+
self._prop_names = ['children', 'id', 'n_clicks', 'n_clicks_timestamp', 'key', 'role', 'data-*', 'aria-*', 'download', 'href', 'hrefLang', 'media', 'rel', 'shape', 'target', 'accessKey', 'className', 'contentEditable', 'contextMenu', 'dir', 'draggable', 'hidden', 'lang', 'spellCheck', 'style', 'tabIndex', 'title']
50+
self._type = 'A'
51+
self._namespace = 'dash_html_components'
52+
self._valid_wildcard_attributes = ['data-', 'aria-']
53+
self.available_events = ['click']
54+
self.available_properties = ['children', 'id', 'n_clicks', 'n_clicks_timestamp', 'key', 'role', 'data-*', 'aria-*', 'download', 'href', 'hrefLang', 'media', 'rel', 'shape', 'target', 'accessKey', 'className', 'contentEditable', 'contextMenu', 'dir', 'draggable', 'hidden', 'lang', 'spellCheck', 'style', 'tabIndex', 'title']
55+
self.available_wildcard_properties = ['data-', 'aria-']
56+
57+
_explicit_args = kwargs.pop('_explicit_args')
58+
_locals = locals()
59+
_locals.update(kwargs) # For wildcard attrs
60+
args = {k: _locals[k] for k in _explicit_args if k != 'children'}
61+
62+
for k in []:
63+
if k not in args:
64+
raise TypeError(
65+
'Required argument `' + k + '` was not specified.')
66+
super(A, self).__init__(children=children, **args)
67+
68+
def __repr__(self):
69+
if(any(getattr(self, c, None) is not None
70+
for c in self._prop_names
71+
if c is not self._prop_names[0])
72+
or any(getattr(self, c, None) is not None
73+
for c in self.__dict__.keys()
74+
if any(c.startswith(wc_attr)
75+
for wc_attr in self._valid_wildcard_attributes))):
76+
props_string = ', '.join([c+'='+repr(getattr(self, c, None))
77+
for c in self._prop_names
78+
if getattr(self, c, None) is not None])
79+
wilds_string = ', '.join([c+'='+repr(getattr(self, c, None))
80+
for c in self.__dict__.keys()
81+
if any([c.startswith(wc_attr)
82+
for wc_attr in
83+
self._valid_wildcard_attributes])])
84+
return ('A(' + props_string +
85+
(', ' + wilds_string if wilds_string != '' else '') + ')')
86+
else:
87+
return (
88+
'A(' +
89+
repr(getattr(self, self._prop_names[0], None)) + ')')

dash_html_components/Abbr.py

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# AUTO GENERATED FILE - DO NOT EDIT
2+
3+
from dash.development.base_component import Component, _explicitize_args
4+
5+
6+
class Abbr(Component):
7+
"""A Abbr component.
8+
9+
10+
Keyword arguments:
11+
- children (a list of or a singular dash component, string or number; optional): The children of this component
12+
- id (string; optional): The ID of this component, used to identify dash components
13+
in callbacks. The ID needs to be unique across all of the
14+
components in an app.
15+
- n_clicks (optional): An integer that represents the number of times
16+
that this element has been clicked on.
17+
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18+
at which n_clicks changed. This can be used to tell
19+
which button was changed most recently.
20+
- key (string; optional): A unique identifier for the component, used to improve
21+
performance by React.js while rendering components
22+
See https://reactjs.org/docs/lists-and-keys.html for more info
23+
- role (string; optional): The ARIA role attribute
24+
- data-* (string; optional): A wildcard data attribute
25+
- aria-* (string; optional): A wildcard aria attribute
26+
- accessKey (string; optional): Defines a keyboard shortcut to activate or add focus to the element.
27+
- className (string; optional): Often used with CSS to style elements with common properties.
28+
- contentEditable (string; optional): Indicates whether the element's content is editable.
29+
- contextMenu (string; optional): Defines the ID of a <menu> element which will serve as the element's context menu.
30+
- dir (string; optional): Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
31+
- draggable (string; optional): Defines whether the element can be dragged.
32+
- hidden (string; optional): Prevents rendering of given element, while keeping child elements, e.g. script elements, active.
33+
- lang (string; optional): Defines the language used in the element.
34+
- spellCheck (string; optional): Indicates whether spell checking is allowed for the element.
35+
- style (dict; optional): Defines CSS styles which will override styles previously set.
36+
- tabIndex (string; optional): Overrides the browser's default tab order and follows the one specified instead.
37+
- title (string; optional): Text to be displayed in a tooltip when hovering over the element.
38+
39+
Available events: 'click'"""
40+
@_explicitize_args
41+
def __init__(self, children=None, id=Component.UNDEFINED, n_clicks=Component.UNDEFINED, n_clicks_timestamp=Component.UNDEFINED, key=Component.UNDEFINED, role=Component.UNDEFINED, accessKey=Component.UNDEFINED, className=Component.UNDEFINED, contentEditable=Component.UNDEFINED, contextMenu=Component.UNDEFINED, dir=Component.UNDEFINED, draggable=Component.UNDEFINED, hidden=Component.UNDEFINED, lang=Component.UNDEFINED, spellCheck=Component.UNDEFINED, style=Component.UNDEFINED, tabIndex=Component.UNDEFINED, title=Component.UNDEFINED, **kwargs):
42+
self._prop_names = ['children', 'id', 'n_clicks', 'n_clicks_timestamp', 'key', 'role', 'data-*', 'aria-*', 'accessKey', 'className', 'contentEditable', 'contextMenu', 'dir', 'draggable', 'hidden', 'lang', 'spellCheck', 'style', 'tabIndex', 'title']
43+
self._type = 'Abbr'
44+
self._namespace = 'dash_html_components'
45+
self._valid_wildcard_attributes = ['data-', 'aria-']
46+
self.available_events = ['click']
47+
self.available_properties = ['children', 'id', 'n_clicks', 'n_clicks_timestamp', 'key', 'role', 'data-*', 'aria-*', 'accessKey', 'className', 'contentEditable', 'contextMenu', 'dir', 'draggable', 'hidden', 'lang', 'spellCheck', 'style', 'tabIndex', 'title']
48+
self.available_wildcard_properties = ['data-', 'aria-']
49+
50+
_explicit_args = kwargs.pop('_explicit_args')
51+
_locals = locals()
52+
_locals.update(kwargs) # For wildcard attrs
53+
args = {k: _locals[k] for k in _explicit_args if k != 'children'}
54+
55+
for k in []:
56+
if k not in args:
57+
raise TypeError(
58+
'Required argument `' + k + '` was not specified.')
59+
super(Abbr, self).__init__(children=children, **args)
60+
61+
def __repr__(self):
62+
if(any(getattr(self, c, None) is not None
63+
for c in self._prop_names
64+
if c is not self._prop_names[0])
65+
or any(getattr(self, c, None) is not None
66+
for c in self.__dict__.keys()
67+
if any(c.startswith(wc_attr)
68+
for wc_attr in self._valid_wildcard_attributes))):
69+
props_string = ', '.join([c+'='+repr(getattr(self, c, None))
70+
for c in self._prop_names
71+
if getattr(self, c, None) is not None])
72+
wilds_string = ', '.join([c+'='+repr(getattr(self, c, None))
73+
for c in self.__dict__.keys()
74+
if any([c.startswith(wc_attr)
75+
for wc_attr in
76+
self._valid_wildcard_attributes])])
77+
return ('Abbr(' + props_string +
78+
(', ' + wilds_string if wilds_string != '' else '') + ')')
79+
else:
80+
return (
81+
'Abbr(' +
82+
repr(getattr(self, self._prop_names[0], None)) + ')')

dash_html_components/Acronym.py

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# AUTO GENERATED FILE - DO NOT EDIT
2+
3+
from dash.development.base_component import Component, _explicitize_args
4+
5+
6+
class Acronym(Component):
7+
"""A Acronym component.
8+
9+
10+
Keyword arguments:
11+
- children (a list of or a singular dash component, string or number; optional): The children of this component
12+
- id (string; optional): The ID of this component, used to identify dash components
13+
in callbacks. The ID needs to be unique across all of the
14+
components in an app.
15+
- n_clicks (optional): An integer that represents the number of times
16+
that this element has been clicked on.
17+
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18+
at which n_clicks changed. This can be used to tell
19+
which button was changed most recently.
20+
- key (string; optional): A unique identifier for the component, used to improve
21+
performance by React.js while rendering components
22+
See https://reactjs.org/docs/lists-and-keys.html for more info
23+
- role (string; optional): The ARIA role attribute
24+
- data-* (string; optional): A wildcard data attribute
25+
- aria-* (string; optional): A wildcard aria attribute
26+
- accessKey (string; optional): Defines a keyboard shortcut to activate or add focus to the element.
27+
- className (string; optional): Often used with CSS to style elements with common properties.
28+
- contentEditable (string; optional): Indicates whether the element's content is editable.
29+
- contextMenu (string; optional): Defines the ID of a <menu> element which will serve as the element's context menu.
30+
- dir (string; optional): Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
31+
- draggable (string; optional): Defines whether the element can be dragged.
32+
- hidden (string; optional): Prevents rendering of given element, while keeping child elements, e.g. script elements, active.
33+
- lang (string; optional): Defines the language used in the element.
34+
- spellCheck (string; optional): Indicates whether spell checking is allowed for the element.
35+
- style (dict; optional): Defines CSS styles which will override styles previously set.
36+
- tabIndex (string; optional): Overrides the browser's default tab order and follows the one specified instead.
37+
- title (string; optional): Text to be displayed in a tooltip when hovering over the element.
38+
39+
Available events: 'click'"""
40+
@_explicitize_args
41+
def __init__(self, children=None, id=Component.UNDEFINED, n_clicks=Component.UNDEFINED, n_clicks_timestamp=Component.UNDEFINED, key=Component.UNDEFINED, role=Component.UNDEFINED, accessKey=Component.UNDEFINED, className=Component.UNDEFINED, contentEditable=Component.UNDEFINED, contextMenu=Component.UNDEFINED, dir=Component.UNDEFINED, draggable=Component.UNDEFINED, hidden=Component.UNDEFINED, lang=Component.UNDEFINED, spellCheck=Component.UNDEFINED, style=Component.UNDEFINED, tabIndex=Component.UNDEFINED, title=Component.UNDEFINED, **kwargs):
42+
self._prop_names = ['children', 'id', 'n_clicks', 'n_clicks_timestamp', 'key', 'role', 'data-*', 'aria-*', 'accessKey', 'className', 'contentEditable', 'contextMenu', 'dir', 'draggable', 'hidden', 'lang', 'spellCheck', 'style', 'tabIndex', 'title']
43+
self._type = 'Acronym'
44+
self._namespace = 'dash_html_components'
45+
self._valid_wildcard_attributes = ['data-', 'aria-']
46+
self.available_events = ['click']
47+
self.available_properties = ['children', 'id', 'n_clicks', 'n_clicks_timestamp', 'key', 'role', 'data-*', 'aria-*', 'accessKey', 'className', 'contentEditable', 'contextMenu', 'dir', 'draggable', 'hidden', 'lang', 'spellCheck', 'style', 'tabIndex', 'title']
48+
self.available_wildcard_properties = ['data-', 'aria-']
49+
50+
_explicit_args = kwargs.pop('_explicit_args')
51+
_locals = locals()
52+
_locals.update(kwargs) # For wildcard attrs
53+
args = {k: _locals[k] for k in _explicit_args if k != 'children'}
54+
55+
for k in []:
56+
if k not in args:
57+
raise TypeError(
58+
'Required argument `' + k + '` was not specified.')
59+
super(Acronym, self).__init__(children=children, **args)
60+
61+
def __repr__(self):
62+
if(any(getattr(self, c, None) is not None
63+
for c in self._prop_names
64+
if c is not self._prop_names[0])
65+
or any(getattr(self, c, None) is not None
66+
for c in self.__dict__.keys()
67+
if any(c.startswith(wc_attr)
68+
for wc_attr in self._valid_wildcard_attributes))):
69+
props_string = ', '.join([c+'='+repr(getattr(self, c, None))
70+
for c in self._prop_names
71+
if getattr(self, c, None) is not None])
72+
wilds_string = ', '.join([c+'='+repr(getattr(self, c, None))
73+
for c in self.__dict__.keys()
74+
if any([c.startswith(wc_attr)
75+
for wc_attr in
76+
self._valid_wildcard_attributes])])
77+
return ('Acronym(' + props_string +
78+
(', ' + wilds_string if wilds_string != '' else '') + ')')
79+
else:
80+
return (
81+
'Acronym(' +
82+
repr(getattr(self, self._prop_names[0], None)) + ')')

0 commit comments

Comments
 (0)