File tree Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -101,11 +101,12 @@ st.write(return_val)
101
101
``` python
102
102
def condition_tree (
103
103
config : dict ,
104
- return_type : str ,
105
- tree : dict ,
106
- min_height : int ,
107
- placeholder : str ,
108
- key : str
104
+ return_type : str [Optional],
105
+ tree : dict [Optional],
106
+ min_height : int [Optional],
107
+ placeholder : str [Optional],
108
+ always_show_buttons : bool [Optional],
109
+ key : str [Optional]
109
110
)
110
111
```
111
112
@@ -144,6 +145,11 @@ and [demo](https://ukrbublik.github.io/react-awesome-query-builder/).
144
145
Default : None
145
146
146
147
148
+ - ** always_show_buttons** : Show buttons (create rule, etc.) even when they are not hovered
149
+
150
+ Default: False
151
+
152
+
147
153
- ** key** : Fixed identity if you want to change its arguments over time and not have it be re-created.
148
154
Can also be used to access the generated condition tree (see section below).
149
155
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ def condition_tree(config: dict,
57
57
tree : dict = None ,
58
58
min_height : int = 400 ,
59
59
placeholder : str = '' ,
60
+ always_show_buttons : bool = False ,
60
61
key : str = None ):
61
62
"""Create a new instance of condition_tree.
62
63
@@ -79,6 +80,9 @@ def condition_tree(config: dict,
79
80
placeholder: str
80
81
Text displayed when the condition tree is empty
81
82
Default: empty
83
+ always_show_buttons: false
84
+ If false, buttons (add rule, etc.) will be shown only on hover
85
+ Default: true
82
86
key: str or None
83
87
An optional key that uniquely identifies this component. If this is
84
88
None, and the component's arguments are changed, the component will
@@ -109,6 +113,7 @@ def condition_tree(config: dict,
109
113
key = '_' + key if key else None ,
110
114
min_height = min_height ,
111
115
placeholder = placeholder ,
116
+ always_show_buttons = always_show_buttons ,
112
117
default = ['' , '' ]
113
118
)
114
119
Original file line number Diff line number Diff line change @@ -146,7 +146,8 @@ class ConditionTree extends StreamlitComponentBase<State> {
146
146
147
147
private renderBuilder = ( props : BuilderProps ) => (
148
148
< div className = "query-builder-container" >
149
- < div className = "query-builder qb-lite" >
149
+ < div className = { 'query-builder ' +
150
+ ( this . props . args [ 'always_show_buttons' ] ? '' :'qb-lite' ) } >
150
151
< Builder { ...props } />
151
152
</ div >
152
153
</ div >
You can’t perform that action at this time.
0 commit comments