@@ -51,14 +51,27 @@ class Knob(Component):
51
51
- style (string; optional)
52
52
- label (string; optional)
53
53
- className (string; optional): Class to apply to the root component element.
54
- - style (dict; optional): Style to apply to the root component element."""
54
+ - style (dict; optional): Style to apply to the root component element.
55
+ - persistence (boolean | string | number; optional): Used to allow user interactions in this component to be persisted when
56
+ the component - or the page - is refreshed. If `persisted` is truthy and
57
+ hasn't changed from its previous value, a `value` that the user has
58
+ changed while using the app will keep that change, as long as
59
+ the new `value` also matches what was given originally.
60
+ Used in conjunction with `persistence_type`.
61
+ - persisted_props (list of a value equal to: 'value's; default ['value']): Properties whose user interactions will persist after refreshing the
62
+ component or the page. Since only `value` is allowed this prop can
63
+ normally be ignored.
64
+ - persistence_type (a value equal to: 'local', 'session', 'memory'; default 'local'): Where persisted user changes will be stored:
65
+ memory: only kept in memory, reset on page refresh.
66
+ local: window.localStorage, data is kept after the browser quit.
67
+ session: window.sessionStorage, data is cleared once the browser quit."""
55
68
@_explicitize_args
56
- def __init__ (self , id = Component .UNDEFINED , value = Component .UNDEFINED , color = Component .UNDEFINED , size = Component .UNDEFINED , min = Component .UNDEFINED , max = Component .UNDEFINED , disabled = Component .UNDEFINED , theme = Component .UNDEFINED , label = Component .UNDEFINED , labelPosition = Component .UNDEFINED , scale = Component .UNDEFINED , className = Component .UNDEFINED , style = Component .UNDEFINED , ** kwargs ):
57
- self ._prop_names = ['id' , 'value' , 'color' , 'size' , 'min' , 'max' , 'disabled' , 'theme' , 'label' , 'labelPosition' , 'scale' , 'className' , 'style' ]
69
+ def __init__ (self , id = Component .UNDEFINED , value = Component .UNDEFINED , color = Component .UNDEFINED , size = Component .UNDEFINED , min = Component .UNDEFINED , max = Component .UNDEFINED , disabled = Component .UNDEFINED , theme = Component .UNDEFINED , label = Component .UNDEFINED , labelPosition = Component .UNDEFINED , scale = Component .UNDEFINED , className = Component .UNDEFINED , style = Component .UNDEFINED , persistence = Component . UNDEFINED , persisted_props = Component . UNDEFINED , persistence_type = Component . UNDEFINED , ** kwargs ):
70
+ self ._prop_names = ['id' , 'value' , 'color' , 'size' , 'min' , 'max' , 'disabled' , 'theme' , 'label' , 'labelPosition' , 'scale' , 'className' , 'style' , 'persistence' , 'persisted_props' , 'persistence_type' ]
58
71
self ._type = 'Knob'
59
72
self ._namespace = 'dash_daq'
60
73
self ._valid_wildcard_attributes = []
61
- self .available_properties = ['id' , 'value' , 'color' , 'size' , 'min' , 'max' , 'disabled' , 'theme' , 'label' , 'labelPosition' , 'scale' , 'className' , 'style' ]
74
+ self .available_properties = ['id' , 'value' , 'color' , 'size' , 'min' , 'max' , 'disabled' , 'theme' , 'label' , 'labelPosition' , 'scale' , 'className' , 'style' , 'persistence' , 'persisted_props' , 'persistence_type' ]
62
75
self .available_wildcard_properties = []
63
76
64
77
_explicit_args = kwargs .pop ('_explicit_args' )
0 commit comments