+
+
+ {empty && this.props.args['placeholder']}
+
+
+ )
+ }
+
+ componentDidUpdate = () => {
+ // Class to apply custom css on rule_groups with a single child
+ document
+ .querySelectorAll('.rule_group>.group--children:has(> :nth-child(1):last-child)')
+ .forEach((x) => x.classList.add('single-child'))
+
+ // Set frame height
+ const height = Math.max(
+ document.body.scrollHeight + 20,
+ this.props.args['min_height']
+ );
+ Streamlit.setFrameHeight(height);
}
- this.state = { config, tree }
- this.setStreamlitValue(tree)
- }
-
- public render = (): ReactNode => {
- const {theme} = this.props
- const tree = QbUtils.getTree(this.state.tree)
- const empty = !tree.children1 || !tree.children1.length
-
- return(
-