From ef73c6df8d9c2fbeaede991528a67c187a188c6b Mon Sep 17 00:00:00 2001 From: cedricvlt Date: Thu, 18 Jul 2024 19:31:01 +0200 Subject: [PATCH] Update README --- README.md | 15 +++++---------- .../frontend/src/ConditionTree.tsx | 1 - 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 0e93e59..8713f1f 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,8 @@ This component allows users to build complex condition trees that can be used to - RHS can be: - values - another fields (of same type) - - ~~functions (arguments also can be values/fields/funcs)~~ (not implemented yet) -- LHS can be field ~~or function~~ + - functions (arguments also can be values/fields/funcs) +- LHS can be field or function - Reordering (drag-n-drop) support for rules and groups of rules - Export to MongoDb, SQL, JsonLogic, SpEL or ElasticSearch @@ -74,7 +74,7 @@ config = { 'label': 'Name', 'type': 'text', }, - 'qty': { + 'age': { 'label': 'Age', 'type': 'number', 'fieldSettings': { @@ -119,9 +119,8 @@ def condition_tree( A basic configuration can be built from a DataFrame with `config_from_dataframe`. For a more advanced configuration, see the component [doc](https://github.com/ukrbublik/react-awesome-query-builder/blob/master/CONFIG.adoc) -and [demo](https://ukrbublik.github.io/react-awesome-query-builder/). - *Note*: Javascript functions (ex: validators) are not yet supported. - +and [demo](https://ukrbublik.github.io/react-awesome-query-builder/). +Custom javascript functions must be wrapped into the JsCode class (see [Advanced config](https://condition-tree-demo.streamlit.app/Advanced_config)) - **return_type**: Format of the returned value : - queryString @@ -164,7 +163,3 @@ Can also be used to access the generated condition tree (see section below). When a key is defined for the component, the condition tree generated is accessible through `st.session_state[key]` as a dictionary. It can be loaded as an input tree through the `tree` parameter. - - -## Potential future improvements -- **Javascript support**: allow injection of javascript code in the configuration (e.g. validators) diff --git a/streamlit_condition_tree/frontend/src/ConditionTree.tsx b/streamlit_condition_tree/frontend/src/ConditionTree.tsx index a225354..dd64447 100644 --- a/streamlit_condition_tree/frontend/src/ConditionTree.tsx +++ b/streamlit_condition_tree/frontend/src/ConditionTree.tsx @@ -79,7 +79,6 @@ class ConditionTree extends StreamlitComponentBase { const config: Config = _.merge({}, defaultConfig, userConfig); - // Load input tree let tree: ImmutableTree = QbUtils.loadTree(defaultTree) if (props.args['tree'] != null) {