|
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)) + ')') |
| 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)) + ')') |
0 commit comments