1
1
import dash_core_components as dcc
2
2
import dash_html_components as html
3
- from dash .dependencies import Output , Input , State
3
+ from dash .dependencies import Input , Output , State
4
4
from dash .exceptions import PreventUpdate
5
5
6
6
from crystal_toolkit .core .mpcomponent import MPComponent
7
- from crystal_toolkit .helpers .layouts import Reveal , PRIMARY_COLOR
7
+ from crystal_toolkit .helpers .layouts import PRIMARY_COLOR , Reveal
8
8
9
9
10
10
class PanelComponent (MPComponent ):
@@ -42,6 +42,7 @@ def panel_layout(self, open_by_default=False):
42
42
title = self .title ,
43
43
children = [message , description , html .Br (), initial_contents ],
44
44
id = self .id ("panel" ),
45
+ summary_id = self .id ("panel_summary" ),
45
46
open = open_by_default ,
46
47
)
47
48
@@ -51,9 +52,11 @@ def contents_layout(self) -> html.Div:
51
52
raise NotImplementedError
52
53
53
54
def generate_callbacks (self , app , cache ):
55
+ pass
56
+
54
57
@app .callback (
55
58
Output (self .id ("contents" ), "children" ),
56
- [Input (f" { self .id ('panel' ) } _summary" , "n_clicks" )],
59
+ [Input (self .id ("panel_summary" ) , "n_clicks" )],
57
60
[State (self .id ("contents" ), "children" )],
58
61
)
59
62
def load_panel (panel_n_clicks , current_contents ):
0 commit comments