File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 5
5
import flask
6
6
7
7
from . import exceptions
8
- from ._utils import stringify_id
8
+ from ._utils import stringify_id , AttributeDict
9
9
10
10
11
11
def has_context (func ):
@@ -60,12 +60,12 @@ def triggered(self):
60
60
@has_context
61
61
def triggered_ids (self ):
62
62
triggered = getattr (flask .g , "triggered_inputs" , [])
63
- ids = {}
63
+ ids = AttributeDict ({})
64
64
for item in triggered :
65
65
component_id , _ , _ = item ["prop_id" ].rpartition ("." )
66
66
ids [item ["prop_id" ]] = component_id
67
67
if component_id .startswith ("{" ):
68
- ids [item ["prop_id" ]] = json .loads (component_id )
68
+ ids [item ["prop_id" ]] = AttributeDict ( json .loads (component_id ) )
69
69
return ids
70
70
71
71
@property
@@ -84,6 +84,9 @@ def update_args_grouping(g):
84
84
"value" : g .get ("value" ),
85
85
"str_id" : str_id ,
86
86
"triggered" : prop_id in triggered ,
87
+ "id" : AttributeDict (g ["id" ])
88
+ if isinstance (g ["id" ], dict )
89
+ else g ["id" ],
87
90
}
88
91
g .update (new_values )
89
92
Original file line number Diff line number Diff line change @@ -119,6 +119,8 @@ def first(self, *names):
119
119
value = self .get (name )
120
120
if value :
121
121
return value
122
+ if names == ():
123
+ return next (iter (self ), {})
122
124
123
125
124
126
def create_callback_id (output ):
You can’t perform that action at this time.
0 commit comments