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

Commit ed951fb

Browse files
committed
Update bundles and add Store.py file.
1 parent e4f4db8 commit ed951fb

File tree

5 files changed

+292
-109
lines changed

5 files changed

+292
-109
lines changed

dash_core_components/Store.py

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# AUTO GENERATED FILE - DO NOT EDIT
2+
3+
from dash.development.base_component import Component, _explicitize_args
4+
5+
6+
class Store(Component):
7+
"""A Store component.
8+
Easily keep data on the client side with this component.
9+
The data is not inserted in the DOM.
10+
Data can be in memory, localStorage or sessionStorage.
11+
The data will be kept with the id as key.
12+
13+
Keyword arguments:
14+
- id (string; required): The key of the storage.
15+
- storage_type (a value equal to: 'local', 'session', 'memory'; optional): The type of the web storage.
16+
17+
memory: only kept in memory, reset on page refresh.
18+
local: window.localStorage, data is kept after the browser quit.
19+
session: window.sessionStorage, data is cleared once the browser quit.
20+
- data (dict | list | number | string; optional): The stored data for the id.
21+
- clear_data (boolean; optional): Set to true to remove the data contained in `data_key`.
22+
- modified_timestamp (number; optional): The last time the storage was modified.
23+
24+
Available events: """
25+
@_explicitize_args
26+
def __init__(self, id=Component.REQUIRED, storage_type=Component.UNDEFINED, data=Component.UNDEFINED, clear_data=Component.UNDEFINED, modified_timestamp=Component.UNDEFINED, **kwargs):
27+
self._prop_names = ['id', 'storage_type', 'data', 'clear_data', 'modified_timestamp']
28+
self._type = 'Store'
29+
self._namespace = 'dash_core_components'
30+
self._valid_wildcard_attributes = []
31+
self.available_events = []
32+
self.available_properties = ['id', 'storage_type', 'data', 'clear_data', 'modified_timestamp']
33+
self.available_wildcard_properties = []
34+
35+
_explicit_args = kwargs.pop('_explicit_args')
36+
_locals = locals()
37+
_locals.update(kwargs) # For wildcard attrs
38+
args = {k: _locals[k] for k in _explicit_args if k != 'children'}
39+
40+
for k in ['id']:
41+
if k not in args:
42+
raise TypeError(
43+
'Required argument `' + k + '` was not specified.')
44+
super(Store, self).__init__(**args)
45+
46+
def __repr__(self):
47+
if(any(getattr(self, c, None) is not None
48+
for c in self._prop_names
49+
if c is not self._prop_names[0])
50+
or any(getattr(self, c, None) is not None
51+
for c in self.__dict__.keys()
52+
if any(c.startswith(wc_attr)
53+
for wc_attr in self._valid_wildcard_attributes))):
54+
props_string = ', '.join([c+'='+repr(getattr(self, c, None))
55+
for c in self._prop_names
56+
if getattr(self, c, None) is not None])
57+
wilds_string = ', '.join([c+'='+repr(getattr(self, c, None))
58+
for c in self.__dict__.keys()
59+
if any([c.startswith(wc_attr)
60+
for wc_attr in
61+
self._valid_wildcard_attributes])])
62+
return ('Store(' + props_string +
63+
(', ' + wilds_string if wilds_string != '' else '') + ')')
64+
else:
65+
return (
66+
'Store(' +
67+
repr(getattr(self, self._prop_names[0], None)) + ')')

dash_core_components/_imports_.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from .RadioItems import RadioItems
1414
from .RangeSlider import RangeSlider
1515
from .Slider import Slider
16+
from .Store import Store
1617
from .SyntaxHighlighter import SyntaxHighlighter
1718
from .Tab import Tab
1819
from .Tabs import Tabs
@@ -36,6 +37,7 @@
3637
"RadioItems",
3738
"RangeSlider",
3839
"Slider",
40+
"Store",
3941
"SyntaxHighlighter",
4042
"Tab",
4143
"Tabs",

dash_core_components/dash_core_components.dev.js

Lines changed: 15 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dash_core_components/dash_core_components.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)