This repository has been archived by the owner on Jun 4, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 81
Generate Dash components at buildtime rather than runtime #47
Closed
Closed
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f34703f
v0.12.0 class files
rmarren1 0efe618
Added 'AUTO GENERATED FILE - DO NOT EDIT' comment to all components.
rmarren1 15b5019
Fix type in changelog.md
rmarren1 39629d8
Update _namespace property of all generated classes.
rmarren1 c5069e8
Update __init__.py to use IDE compatible imports
rmarren1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
from dash.development.base_component import Component | ||
|
||
|
||
class A(Component): | ||
"""A A component. | ||
|
||
|
||
Keyword arguments: | ||
- children (a list of or a singular dash component, string or number; optional): The children of this component | ||
- 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. | ||
- n_clicks (optional): An integer that represents the number of times | ||
that this element has been clicked on. | ||
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970) | ||
at which n_clicks changed. This can be used to tell | ||
which button was changed most recently. | ||
- key (string; optional): A unique identifier for the component, used to improve | ||
performance by React.js while rendering components | ||
See https://reactjs.org/docs/lists-and-keys.html for more info | ||
- role (string; optional): The ARIA role attribute | ||
- data-* (string; optional): A wildcard data attribute | ||
- aria-* (string; optional): A wildcard aria attribute | ||
- download (string; optional): Indicates that the hyperlink is to be used for downloading a resource. | ||
- href (string; optional): The URL of a linked resource. | ||
- hrefLang (string; optional): Specifies the language of the linked resource. | ||
- media (string; optional): Specifies a hint of the media for which the linked resource was designed. | ||
- rel (string; optional): Specifies the relationship of the target object to the link object. | ||
- shape (string; optional) | ||
- target (string; optional) | ||
- accessKey (string; optional): Defines a keyboard shortcut to activate or add focus to the element. | ||
- className (string; optional): Often used with CSS to style elements with common properties. | ||
- contentEditable (string; optional): Indicates whether the element's content is editable. | ||
- contextMenu (string; optional): Defines the ID of a <menu> element which will serve as the element's context menu. | ||
- dir (string; optional): Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) | ||
- draggable (string; optional): Defines whether the element can be dragged. | ||
- hidden (string; optional): Prevents rendering of given element, while keeping child elements, e.g. script elements, active. | ||
- lang (string; optional): Defines the language used in the element. | ||
- spellCheck (string; optional): Indicates whether spell checking is allowed for the element. | ||
- style (dict; optional): Defines CSS styles which will override styles previously set. | ||
- tabIndex (string; optional): Overrides the browser's default tab order and follows the one specified instead. | ||
- title (string; optional): Text to be displayed in a tooltip when hovering over the element. | ||
|
||
Available events: 'click'""" | ||
def __init__(self, children=None, **kwargs): | ||
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'] | ||
self._type = 'A' | ||
self._namespace = 'lib' | ||
self._valid_wildcard_attributes = ['data-', 'aria-'] | ||
self.available_events = ['click'] | ||
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'] | ||
self.available_wildcard_properties = ['data-', 'aria-'] | ||
|
||
for k in []: | ||
if k not in kwargs: | ||
raise TypeError( | ||
'Required argument `' + k + '` was not specified.') | ||
|
||
super(A, self).__init__(children=children, **kwargs) | ||
|
||
def __repr__(self): | ||
if(any(getattr(self, c, None) is not None | ||
for c in self._prop_names | ||
if c is not self._prop_names[0]) | ||
or any(getattr(self, c, None) is not None | ||
for c in self.__dict__.keys() | ||
if any(c.startswith(wc_attr) | ||
for wc_attr in self._valid_wildcard_attributes))): | ||
props_string = ', '.join([c+'='+repr(getattr(self, c, None)) | ||
for c in self._prop_names | ||
if getattr(self, c, None) is not None]) | ||
wilds_string = ', '.join([c+'='+repr(getattr(self, c, None)) | ||
for c in self.__dict__.keys() | ||
if any([c.startswith(wc_attr) | ||
for wc_attr in | ||
self._valid_wildcard_attributes])]) | ||
return ('A(' + props_string + | ||
(', ' + wilds_string if wilds_string != '' else '') + ')') | ||
else: | ||
return ( | ||
'A(' + | ||
repr(getattr(self, self._prop_names[0], None)) + ')') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
from dash.development.base_component import Component | ||
|
||
|
||
class Abbr(Component): | ||
"""A Abbr component. | ||
|
||
|
||
Keyword arguments: | ||
- children (a list of or a singular dash component, string or number; optional): The children of this component | ||
- 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. | ||
- n_clicks (optional): An integer that represents the number of times | ||
that this element has been clicked on. | ||
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970) | ||
at which n_clicks changed. This can be used to tell | ||
which button was changed most recently. | ||
- key (string; optional): A unique identifier for the component, used to improve | ||
performance by React.js while rendering components | ||
See https://reactjs.org/docs/lists-and-keys.html for more info | ||
- role (string; optional): The ARIA role attribute | ||
- data-* (string; optional): A wildcard data attribute | ||
- aria-* (string; optional): A wildcard aria attribute | ||
- accessKey (string; optional): Defines a keyboard shortcut to activate or add focus to the element. | ||
- className (string; optional): Often used with CSS to style elements with common properties. | ||
- contentEditable (string; optional): Indicates whether the element's content is editable. | ||
- contextMenu (string; optional): Defines the ID of a <menu> element which will serve as the element's context menu. | ||
- dir (string; optional): Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) | ||
- draggable (string; optional): Defines whether the element can be dragged. | ||
- hidden (string; optional): Prevents rendering of given element, while keeping child elements, e.g. script elements, active. | ||
- lang (string; optional): Defines the language used in the element. | ||
- spellCheck (string; optional): Indicates whether spell checking is allowed for the element. | ||
- style (dict; optional): Defines CSS styles which will override styles previously set. | ||
- tabIndex (string; optional): Overrides the browser's default tab order and follows the one specified instead. | ||
- title (string; optional): Text to be displayed in a tooltip when hovering over the element. | ||
|
||
Available events: 'click'""" | ||
def __init__(self, children=None, **kwargs): | ||
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'] | ||
self._type = 'Abbr' | ||
self._namespace = 'lib' | ||
self._valid_wildcard_attributes = ['data-', 'aria-'] | ||
self.available_events = ['click'] | ||
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'] | ||
self.available_wildcard_properties = ['data-', 'aria-'] | ||
|
||
for k in []: | ||
if k not in kwargs: | ||
raise TypeError( | ||
'Required argument `' + k + '` was not specified.') | ||
|
||
super(Abbr, self).__init__(children=children, **kwargs) | ||
|
||
def __repr__(self): | ||
if(any(getattr(self, c, None) is not None | ||
for c in self._prop_names | ||
if c is not self._prop_names[0]) | ||
or any(getattr(self, c, None) is not None | ||
for c in self.__dict__.keys() | ||
if any(c.startswith(wc_attr) | ||
for wc_attr in self._valid_wildcard_attributes))): | ||
props_string = ', '.join([c+'='+repr(getattr(self, c, None)) | ||
for c in self._prop_names | ||
if getattr(self, c, None) is not None]) | ||
wilds_string = ', '.join([c+'='+repr(getattr(self, c, None)) | ||
for c in self.__dict__.keys() | ||
if any([c.startswith(wc_attr) | ||
for wc_attr in | ||
self._valid_wildcard_attributes])]) | ||
return ('Abbr(' + props_string + | ||
(', ' + wilds_string if wilds_string != '' else '') + ')') | ||
else: | ||
return ( | ||
'Abbr(' + | ||
repr(getattr(self, self._prop_names[0], None)) + ')') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
from dash.development.base_component import Component | ||
|
||
|
||
class Acronym(Component): | ||
"""A Acronym component. | ||
|
||
|
||
Keyword arguments: | ||
- children (a list of or a singular dash component, string or number; optional): The children of this component | ||
- 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. | ||
- n_clicks (optional): An integer that represents the number of times | ||
that this element has been clicked on. | ||
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970) | ||
at which n_clicks changed. This can be used to tell | ||
which button was changed most recently. | ||
- key (string; optional): A unique identifier for the component, used to improve | ||
performance by React.js while rendering components | ||
See https://reactjs.org/docs/lists-and-keys.html for more info | ||
- role (string; optional): The ARIA role attribute | ||
- data-* (string; optional): A wildcard data attribute | ||
- aria-* (string; optional): A wildcard aria attribute | ||
- accessKey (string; optional): Defines a keyboard shortcut to activate or add focus to the element. | ||
- className (string; optional): Often used with CSS to style elements with common properties. | ||
- contentEditable (string; optional): Indicates whether the element's content is editable. | ||
- contextMenu (string; optional): Defines the ID of a <menu> element which will serve as the element's context menu. | ||
- dir (string; optional): Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) | ||
- draggable (string; optional): Defines whether the element can be dragged. | ||
- hidden (string; optional): Prevents rendering of given element, while keeping child elements, e.g. script elements, active. | ||
- lang (string; optional): Defines the language used in the element. | ||
- spellCheck (string; optional): Indicates whether spell checking is allowed for the element. | ||
- style (dict; optional): Defines CSS styles which will override styles previously set. | ||
- tabIndex (string; optional): Overrides the browser's default tab order and follows the one specified instead. | ||
- title (string; optional): Text to be displayed in a tooltip when hovering over the element. | ||
|
||
Available events: 'click'""" | ||
def __init__(self, children=None, **kwargs): | ||
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'] | ||
self._type = 'Acronym' | ||
self._namespace = 'lib' | ||
self._valid_wildcard_attributes = ['data-', 'aria-'] | ||
self.available_events = ['click'] | ||
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'] | ||
self.available_wildcard_properties = ['data-', 'aria-'] | ||
|
||
for k in []: | ||
if k not in kwargs: | ||
raise TypeError( | ||
'Required argument `' + k + '` was not specified.') | ||
|
||
super(Acronym, self).__init__(children=children, **kwargs) | ||
|
||
def __repr__(self): | ||
if(any(getattr(self, c, None) is not None | ||
for c in self._prop_names | ||
if c is not self._prop_names[0]) | ||
or any(getattr(self, c, None) is not None | ||
for c in self.__dict__.keys() | ||
if any(c.startswith(wc_attr) | ||
for wc_attr in self._valid_wildcard_attributes))): | ||
props_string = ', '.join([c+'='+repr(getattr(self, c, None)) | ||
for c in self._prop_names | ||
if getattr(self, c, None) is not None]) | ||
wilds_string = ', '.join([c+'='+repr(getattr(self, c, None)) | ||
for c in self.__dict__.keys() | ||
if any([c.startswith(wc_attr) | ||
for wc_attr in | ||
self._valid_wildcard_attributes])]) | ||
return ('Acronym(' + props_string + | ||
(', ' + wilds_string if wilds_string != '' else '') + ')') | ||
else: | ||
return ( | ||
'Acronym(' + | ||
repr(getattr(self, self._prop_names[0], None)) + ')') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
from dash.development.base_component import Component | ||
|
||
|
||
class Address(Component): | ||
"""A Address component. | ||
|
||
|
||
Keyword arguments: | ||
- children (a list of or a singular dash component, string or number; optional): The children of this component | ||
- 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. | ||
- n_clicks (optional): An integer that represents the number of times | ||
that this element has been clicked on. | ||
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970) | ||
at which n_clicks changed. This can be used to tell | ||
which button was changed most recently. | ||
- key (string; optional): A unique identifier for the component, used to improve | ||
performance by React.js while rendering components | ||
See https://reactjs.org/docs/lists-and-keys.html for more info | ||
- role (string; optional): The ARIA role attribute | ||
- data-* (string; optional): A wildcard data attribute | ||
- aria-* (string; optional): A wildcard aria attribute | ||
- accessKey (string; optional): Defines a keyboard shortcut to activate or add focus to the element. | ||
- className (string; optional): Often used with CSS to style elements with common properties. | ||
- contentEditable (string; optional): Indicates whether the element's content is editable. | ||
- contextMenu (string; optional): Defines the ID of a <menu> element which will serve as the element's context menu. | ||
- dir (string; optional): Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) | ||
- draggable (string; optional): Defines whether the element can be dragged. | ||
- hidden (string; optional): Prevents rendering of given element, while keeping child elements, e.g. script elements, active. | ||
- lang (string; optional): Defines the language used in the element. | ||
- spellCheck (string; optional): Indicates whether spell checking is allowed for the element. | ||
- style (dict; optional): Defines CSS styles which will override styles previously set. | ||
- tabIndex (string; optional): Overrides the browser's default tab order and follows the one specified instead. | ||
- title (string; optional): Text to be displayed in a tooltip when hovering over the element. | ||
|
||
Available events: 'click'""" | ||
def __init__(self, children=None, **kwargs): | ||
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'] | ||
self._type = 'Address' | ||
self._namespace = 'lib' | ||
self._valid_wildcard_attributes = ['data-', 'aria-'] | ||
self.available_events = ['click'] | ||
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'] | ||
self.available_wildcard_properties = ['data-', 'aria-'] | ||
|
||
for k in []: | ||
if k not in kwargs: | ||
raise TypeError( | ||
'Required argument `' + k + '` was not specified.') | ||
|
||
super(Address, self).__init__(children=children, **kwargs) | ||
|
||
def __repr__(self): | ||
if(any(getattr(self, c, None) is not None | ||
for c in self._prop_names | ||
if c is not self._prop_names[0]) | ||
or any(getattr(self, c, None) is not None | ||
for c in self.__dict__.keys() | ||
if any(c.startswith(wc_attr) | ||
for wc_attr in self._valid_wildcard_attributes))): | ||
props_string = ', '.join([c+'='+repr(getattr(self, c, None)) | ||
for c in self._prop_names | ||
if getattr(self, c, None) is not None]) | ||
wilds_string = ', '.join([c+'='+repr(getattr(self, c, None)) | ||
for c in self.__dict__.keys() | ||
if any([c.startswith(wc_attr) | ||
for wc_attr in | ||
self._valid_wildcard_attributes])]) | ||
return ('Address(' + props_string + | ||
(', ' + wilds_string if wilds_string != '' else '') + ')') | ||
else: | ||
return ( | ||
'Address(' + | ||
repr(getattr(self, self._prop_names[0], None)) + ')') |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*
etc