Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit 08e12b1

Browse files
authored
Merge pull request #220 from rmarren1/ide
IDE support
2 parents f9b2e93 + dc3dd4c commit 08e12b1

32 files changed

+2409
-612
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ node_modules/
77
.npm
88
vv/
99
venv/
10+
.tox
1011
*.pyc
1112
*.egg-info
1213
*.log

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [0.27.0]
6+
### Changed
7+
- `dash_core_components/__init__.py` now imports from python class files rather than generating classes at runtime,
8+
adding support for IDE autocomplete ect.
9+
510
## [0.26.0]
611
### Added
712
- New Tabs and Tab components! [#213](https://github.com/plotly/dash-core-components/pull/213#pullrequestreview-135893345)

circle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dependencies:
1010
override:
1111
- pip install setuptools --upgrade
1212
- pip install virtualenv
13-
- pip install tox
13+
- pip install tox dash==0.23.1
1414
- npm install -g eslint
1515
- npm install --ignore-scripts
1616
- node_modules/.bin/builder run build-dist

dash_core_components/Checklist.py

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# AUTO GENERATED FILE - DO NOT EDIT
2+
3+
from dash.development.base_component import Component, _explicitize_args
4+
5+
6+
class Checklist(Component):
7+
"""A Checklist component.
8+
Checklist is a component that encapsulates several checkboxes.
9+
The values and labels of the checklist is specified in the `options`
10+
property and the checked items are specified with the `values` property.
11+
Each checkbox is rendered as an input with a surrounding label.
12+
13+
Keyword arguments:
14+
- id (string; optional)
15+
- options (list; optional): An array of options
16+
- values (list; optional): The currently selected value
17+
- className (string; optional): The class of the container (div)
18+
- style (dict; optional): The style of the container (div)
19+
- inputStyle (dict; optional): The style of the <input> checkbox element
20+
- inputClassName (string; optional): The class of the <input> checkbox element
21+
- labelStyle (dict; optional): The style of the <label> that wraps the checkbox input
22+
and the option's label
23+
- labelClassName (string; optional): The class of the <label> that wraps the checkbox input
24+
and the option's label
25+
26+
Available events: 'change'"""
27+
@_explicitize_args
28+
def __init__(self, id=Component.UNDEFINED, options=Component.UNDEFINED, values=Component.UNDEFINED, className=Component.UNDEFINED, style=Component.UNDEFINED, inputStyle=Component.UNDEFINED, inputClassName=Component.UNDEFINED, labelStyle=Component.UNDEFINED, labelClassName=Component.UNDEFINED, **kwargs):
29+
self._prop_names = ['id', 'options', 'values', 'className', 'style', 'inputStyle', 'inputClassName', 'labelStyle', 'labelClassName']
30+
self._type = 'Checklist'
31+
self._namespace = 'dash_core_components'
32+
self._valid_wildcard_attributes = []
33+
self.available_events = ['change']
34+
self.available_properties = ['id', 'options', 'values', 'className', 'style', 'inputStyle', 'inputClassName', 'labelStyle', 'labelClassName']
35+
self.available_wildcard_properties = []
36+
37+
_explicit_args = kwargs.pop('_explicit_args')
38+
_locals = locals()
39+
_locals.update(kwargs) # For wildcard attrs
40+
args = {k: _locals[k] for k in _explicit_args if k != 'children'}
41+
42+
for k in []:
43+
if k not in args:
44+
raise TypeError(
45+
'Required argument `' + k + '` was not specified.')
46+
super(Checklist, self).__init__(**args)
47+
48+
def __repr__(self):
49+
if(any(getattr(self, c, None) is not None
50+
for c in self._prop_names
51+
if c is not self._prop_names[0])
52+
or any(getattr(self, c, None) is not None
53+
for c in self.__dict__.keys()
54+
if any(c.startswith(wc_attr)
55+
for wc_attr in self._valid_wildcard_attributes))):
56+
props_string = ', '.join([c+'='+repr(getattr(self, c, None))
57+
for c in self._prop_names
58+
if getattr(self, c, None) is not None])
59+
wilds_string = ', '.join([c+'='+repr(getattr(self, c, None))
60+
for c in self.__dict__.keys()
61+
if any([c.startswith(wc_attr)
62+
for wc_attr in
63+
self._valid_wildcard_attributes])])
64+
return ('Checklist(' + props_string +
65+
(', ' + wilds_string if wilds_string != '' else '') + ')')
66+
else:
67+
return (
68+
'Checklist(' +
69+
repr(getattr(self, self._prop_names[0], None)) + ')')

dash_core_components/ConfirmDialog.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# AUTO GENERATED FILE - DO NOT EDIT
2+
3+
from dash.development.base_component import Component, _explicitize_args
4+
5+
6+
class ConfirmDialog(Component):
7+
"""A ConfirmDialog component.
8+
ConfirmDialog is used to display the browser's native "confirm" modal,
9+
with an optional message and two buttons ("OK" and "Cancel").
10+
This ConfirmDialog can be used in conjunction with buttons when the user
11+
is performing an action that should require an extra step of verification.
12+
13+
Keyword arguments:
14+
- id (string; optional)
15+
- message (string; optional): Message to show in the popup.
16+
- submit_n_clicks (number; optional): Number of times the submit button was clicked
17+
- submit_n_clicks_timestamp (number; optional): Last time the submit button was clicked.
18+
- cancel_n_clicks (number; optional): Number of times the popup was canceled.
19+
- cancel_n_clicks_timestamp (number; optional): Last time the cancel button was clicked.
20+
- displayed (boolean; optional): Set to true to send the ConfirmDialog.
21+
22+
Available events: """
23+
@_explicitize_args
24+
def __init__(self, id=Component.UNDEFINED, message=Component.UNDEFINED, submit_n_clicks=Component.UNDEFINED, submit_n_clicks_timestamp=Component.UNDEFINED, cancel_n_clicks=Component.UNDEFINED, cancel_n_clicks_timestamp=Component.UNDEFINED, displayed=Component.UNDEFINED, **kwargs):
25+
self._prop_names = ['id', 'message', 'submit_n_clicks', 'submit_n_clicks_timestamp', 'cancel_n_clicks', 'cancel_n_clicks_timestamp', 'displayed']
26+
self._type = 'ConfirmDialog'
27+
self._namespace = 'dash_core_components'
28+
self._valid_wildcard_attributes = []
29+
self.available_events = []
30+
self.available_properties = ['id', 'message', 'submit_n_clicks', 'submit_n_clicks_timestamp', 'cancel_n_clicks', 'cancel_n_clicks_timestamp', 'displayed']
31+
self.available_wildcard_properties = []
32+
33+
_explicit_args = kwargs.pop('_explicit_args')
34+
_locals = locals()
35+
_locals.update(kwargs) # For wildcard attrs
36+
args = {k: _locals[k] for k in _explicit_args if k != 'children'}
37+
38+
for k in []:
39+
if k not in args:
40+
raise TypeError(
41+
'Required argument `' + k + '` was not specified.')
42+
super(ConfirmDialog, self).__init__(**args)
43+
44+
def __repr__(self):
45+
if(any(getattr(self, c, None) is not None
46+
for c in self._prop_names
47+
if c is not self._prop_names[0])
48+
or any(getattr(self, c, None) is not None
49+
for c in self.__dict__.keys()
50+
if any(c.startswith(wc_attr)
51+
for wc_attr in self._valid_wildcard_attributes))):
52+
props_string = ', '.join([c+'='+repr(getattr(self, c, None))
53+
for c in self._prop_names
54+
if getattr(self, c, None) is not None])
55+
wilds_string = ', '.join([c+'='+repr(getattr(self, c, None))
56+
for c in self.__dict__.keys()
57+
if any([c.startswith(wc_attr)
58+
for wc_attr in
59+
self._valid_wildcard_attributes])])
60+
return ('ConfirmDialog(' + props_string +
61+
(', ' + wilds_string if wilds_string != '' else '') + ')')
62+
else:
63+
return (
64+
'ConfirmDialog(' +
65+
repr(getattr(self, self._prop_names[0], None)) + ')')
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# AUTO GENERATED FILE - DO NOT EDIT
2+
3+
from dash.development.base_component import Component, _explicitize_args
4+
5+
6+
class ConfirmDialogProvider(Component):
7+
"""A ConfirmDialogProvider component.
8+
A wrapper component that will display a confirmation dialog
9+
when its child component has been clicked on.
10+
11+
For example:
12+
```
13+
dcc.ConfirmDialogProvider(
14+
html.Button('click me', id='btn'),
15+
message='Danger - Are you sure you want to continue.'
16+
id='confirm')
17+
```
18+
19+
Keyword arguments:
20+
- children (boolean | number | string | dict | list; optional): The children to hijack clicks from and display the popup.
21+
- id (string; optional)
22+
- message (string; optional): Message to show in the popup.
23+
- submit_n_clicks (number; optional): Number of times the submit was clicked
24+
- submit_n_clicks_timestamp (number; optional): Last time the submit button was clicked.
25+
- cancel_n_clicks (number; optional): Number of times the popup was canceled.
26+
- cancel_n_clicks_timestamp (number; optional): Last time the cancel button was clicked.
27+
- displayed (boolean; optional): Is the modal currently displayed.
28+
29+
Available events: """
30+
@_explicitize_args
31+
def __init__(self, children=None, id=Component.UNDEFINED, message=Component.UNDEFINED, submit_n_clicks=Component.UNDEFINED, submit_n_clicks_timestamp=Component.UNDEFINED, cancel_n_clicks=Component.UNDEFINED, cancel_n_clicks_timestamp=Component.UNDEFINED, displayed=Component.UNDEFINED, **kwargs):
32+
self._prop_names = ['children', 'id', 'message', 'submit_n_clicks', 'submit_n_clicks_timestamp', 'cancel_n_clicks', 'cancel_n_clicks_timestamp', 'displayed']
33+
self._type = 'ConfirmDialogProvider'
34+
self._namespace = 'dash_core_components'
35+
self._valid_wildcard_attributes = []
36+
self.available_events = []
37+
self.available_properties = ['children', 'id', 'message', 'submit_n_clicks', 'submit_n_clicks_timestamp', 'cancel_n_clicks', 'cancel_n_clicks_timestamp', 'displayed']
38+
self.available_wildcard_properties = []
39+
40+
_explicit_args = kwargs.pop('_explicit_args')
41+
_locals = locals()
42+
_locals.update(kwargs) # For wildcard attrs
43+
args = {k: _locals[k] for k in _explicit_args if k != 'children'}
44+
45+
for k in []:
46+
if k not in args:
47+
raise TypeError(
48+
'Required argument `' + k + '` was not specified.')
49+
super(ConfirmDialogProvider, self).__init__(children=children, **args)
50+
51+
def __repr__(self):
52+
if(any(getattr(self, c, None) is not None
53+
for c in self._prop_names
54+
if c is not self._prop_names[0])
55+
or any(getattr(self, c, None) is not None
56+
for c in self.__dict__.keys()
57+
if any(c.startswith(wc_attr)
58+
for wc_attr in self._valid_wildcard_attributes))):
59+
props_string = ', '.join([c+'='+repr(getattr(self, c, None))
60+
for c in self._prop_names
61+
if getattr(self, c, None) is not None])
62+
wilds_string = ', '.join([c+'='+repr(getattr(self, c, None))
63+
for c in self.__dict__.keys()
64+
if any([c.startswith(wc_attr)
65+
for wc_attr in
66+
self._valid_wildcard_attributes])])
67+
return ('ConfirmDialogProvider(' + props_string +
68+
(', ' + wilds_string if wilds_string != '' else '') + ')')
69+
else:
70+
return (
71+
'ConfirmDialogProvider(' +
72+
repr(getattr(self, self._prop_names[0], None)) + ')')

0 commit comments

Comments
 (0)