Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

cxhub-query-builder

aShelist38MIT1.0.7TypeScript support: included

User-friendly query builder for React. Demo: https://ukrbublik.github.io/react-awesome-query-builder

query-builder, query, builder, query builder, react-query-builder, where, clause, operators, expression, react, reactjs, component, react-component, ui, antd, antdesign, ant-design, material, material-ui, material-design, configurable

readme

<! -- [![travis](https://travis-ci.org/ukrbublik/react-awesome-query-builder.svg?branch=master)](https://travis-ci.com/github/ukrbublik/react-awesome-query-builder) [![Financial Contributors on Open Collective](https://opencollective.com/react-awesome-query-builder/all/badge.svg?label=financial+contributors)](https://opencollective.com/react-awesome-query-builder) -->

npm Smoke travis codecov antd mui demo sandbox TS sandbox JS

User-friendly React component to build queries (filters).

Inspired by jQuery QueryBuilder. Using awesome Ant Design v4 for widgets. Now Material-UI is also supported!

See live demo

Open in codesandbox.io

Features

Screenshot

  • Highly configurable
  • Fields can be of type:
    • simple (string, number, bool, date/time/datetime, list)
    • structs (will be displayed in selectbox as tree)
    • custom type (dev should add its own widget component in config for this)
  • Comparison operators can be:
    • binary (== != < > ..)
    • unary (is empty, is null)
    • 'between' (for numbers, dates, times)
    • complex operators like 'proximity'
  • Values of fields can be compared with:
    • values
    • another fields (of same type)
    • function (arguments also can be values/fields/funcs)
  • Reordering (drag-n-drop) support for rules and groups of rules
  • Using awesome Ant Design as UI framework with rich features.
    Now Material-UI is also supported!
    (Using another UI framework and custom widgets is possible, see below)
  • Export to MongoDb, SQL, JsonLogic, ElasticSearch or your custom format
  • Import from JsonLogic
  • TypeScript support (see types and demo in TS)

Getting started

Install:

npm i react-awesome-query-builder --save

For AntDesign widgets only:

npm i antd --save

For Material-UI widgets only:

npm i @material-ui/core @material-ui/lab @material-ui/icons @material-ui/pickers material-ui-confirm --save

See basic usage for minimum code example.

See API and config for documentation.

Demo apps:

  • npm start - demo app with hot reload of demo code and local library code, uses TS, uses complex config to demonstrate anvanced usage.
  • npm run sandbox-ts - demo app with hot reload of only demo code (uses latest version of library from npm), uses TS, uses AntDesign widgets.
  • npm run sandbox-js - demo app with hot reload of only demo code (uses latest version of library from npm), not uses TS, uses vanilla widgets.

Usage

Minimal JavaScript example with class component

import React, {Component} from 'react';
import {Query, Builder, BasicConfig, Utils as QbUtils} from 'react-awesome-query-builder';

// For AntDesign widgets only:
import AntdConfig from 'react-awesome-query-builder/lib/config/antd';
import 'antd/dist/antd.css'; // or import "react-awesome-query-builder/css/antd.less";
// For Material-UI widgets only:
import MaterialConfig from 'react-awesome-query-builder/lib/config/material';

import 'react-awesome-query-builder/lib/css/styles.css';
import 'react-awesome-query-builder/lib/css/compact_styles.css'; //optional, for more compact styles

// Choose your skin (ant/material/vanilla):
const InitialConfig = AntdConfig; // or MaterialConfig or BasicConfig

// You need to provide your own config. See below 'Config format'
const config = {
  ...InitialConfig,
  fields: {
    qty: {
        label: 'Qty',
        type: 'number',
        fieldSettings: {
            min: 0,
        },
        valueSources: ['value'],
        preferWidgets: ['number'],
    },
    price: {
        label: 'Price',
        type: 'number',
        valueSources: ['value'],
        fieldSettings: {
            min: 10,
            max: 100,
        },
        preferWidgets: ['slider', 'rangeslider'],
    },
    color: {
        label: 'Color',
        type: 'select',
        valueSources: ['value'],
        fieldSettings: {
          listValues: [
            { value: 'yellow', title: 'Yellow' },
            { value: 'green', title: 'Green' },
            { value: 'orange', title: 'Orange' }
          ],
        }
    },
    is_promotion: {
        label: 'Promo?',
        type: 'boolean',
        operators: ['equal'],
        valueSources: ['value'],
    },
  }
};

// You can load query value from your backend storage (for saving see `Query.onChange()`)
const queryValue = {"id": QbUtils.uuid(), "type": "group"};


class DemoQueryBuilder extends Component {
    state = {
      tree: QbUtils.checkTree(QbUtils.loadTree(queryValue), config),
      config: config
    };

    render = () => (
      <div>
        <Query
            {...config} 
            value={this.state.tree}
            onChange={this.onChange}
            renderBuilder={this.renderBuilder}
        />
        {this.renderResult(this.state)}
      </div>
    )

    renderBuilder = (props) => (
      <div className="query-builder-container" style={{padding: '10px'}}>
        <div className="query-builder qb-lite">
            <Builder {...props} />
        </div>
      </div>
    )

    renderResult = ({tree: immutableTree, config}) => (
      <div className="query-builder-result">
          <div>Query string: <pre>{JSON.stringify(QbUtils.queryString(immutableTree, config))}</pre></div>
          <div>MongoDb query: <pre>{JSON.stringify(QbUtils.mongodbFormat(immutableTree, config))}</pre></div>
          <div>SQL where: <pre>{JSON.stringify(QbUtils.sqlFormat(immutableTree, config))}</pre></div>
          <div>JsonLogic: <pre>{JSON.stringify(QbUtils.jsonLogicFormat(immutableTree, config))}</pre></div>
      </div>
    )

    onChange = (immutableTree, config) => {
      // Tip: for better performance you can apply `throttle` - see `examples/demo`
      this.setState({tree: immutableTree, config: config});

      const jsonTree = QbUtils.getTree(immutableTree);
      console.log(jsonTree);
      // `jsonTree` can be saved to backend, and later loaded to `queryValue`
    }
}

Minimal TypeScript example with function component

(Codesandbox)

import React, { useState } from "react";
import { Query, Builder, Utils as QbUtils } from "react-awesome-query-builder";
// types
import {
  JsonGroup,
  Config,
  ImmutableTree,
  BuilderProps
} from "react-awesome-query-builder";

// For AntDesign widgets only:
import AntdConfig from "react-awesome-query-builder/lib/config/antd";
import "antd/dist/antd.css"; // or import "react-awesome-query-builder/css/antd.less";
// For Material-UI widgets only:
//import MaterialConfig from "react-awesome-query-builder/lib/config/material";

import "react-awesome-query-builder/lib/css/styles.css";
import "react-awesome-query-builder/lib/css/compact_styles.css"; //optional, for more compact styles

// Choose your skin (ant/material/vanilla):
const InitialConfig = AntdConfig; // or MaterialConfig or BasicConfig

// You need to provide your own config. See below 'Config format'
const config: Config = {
  ...InitialConfig,
  fields: {
    qty: {
      label: "Qty",
      type: "number",
      fieldSettings: {
        min: 0
      },
      valueSources: ["value"],
      preferWidgets: ["number"]
    },
    price: {
      label: "Price",
      type: "number",
      valueSources: ["value"],
      fieldSettings: {
        min: 10,
        max: 100
      },
      preferWidgets: ["slider", "rangeslider"]
    },
    color: {
      label: "Color",
      type: "select",
      valueSources: ["value"],
      fieldSettings: {
        listValues: [
          { value: "yellow", title: "Yellow" },
          { value: "green", title: "Green" },
          { value: "orange", title: "Orange" }
        ]
      }
    },
    is_promotion: {
      label: "Promo?",
      type: "boolean",
      operators: ["equal"],
      valueSources: ["value"]
    }
  }
};

// You can load query value from your backend storage (for saving see `Query.onChange()`)
const queryValue: JsonGroup = { id: QbUtils.uuid(), type: "group" };

export const Demo: React.FC = () => {
  const [state, setState] = useState({
    tree: QbUtils.checkTree(QbUtils.loadTree(queryValue), config),
    config: config
  });

  const onChange = (immutableTree: ImmutableTree, config: Config) => {
    // Tip: for better performance you can apply `throttle` - see `examples/demo`
    setState({ tree: immutableTree, config: config });

    const jsonTree = QbUtils.getTree(immutableTree);
    console.log(jsonTree);
    // `jsonTree` can be saved to backend, and later loaded to `queryValue`
  };

  const renderBuilder = (props: BuilderProps) => (
    <div className="query-builder-container" style={{ padding: "10px" }}>
      <div className="query-builder qb-lite">
        <Builder {...props} />
      </div>
    </div>
  );

  return (
    <div>
      <Query
        {...config}
        value={state.tree}
        onChange={onChange}
        renderBuilder={renderBuilder}
      />
      <div className="query-builder-result">
        <div>
          Query string:{" "}
          <pre>
            {JSON.stringify(QbUtils.queryString(state.tree, state.config))}
          </pre>
        </div>
        <div>
          MongoDb query:{" "}
          <pre>
            {JSON.stringify(QbUtils.mongodbFormat(state.tree, state.config))}
          </pre>
        </div>
        <div>
          SQL where:{" "}
          <pre>
            {JSON.stringify(QbUtils.sqlFormat(state.tree, state.config))}
          </pre>
        </div>
        <div>
          JsonLogic:{" "}
          <pre>
            {JSON.stringify(QbUtils.jsonLogicFormat(state.tree, state.config))}
          </pre>
        </div>
      </div>
    </div>
  );
};

API

<Query />

Props:

  • {...config} - destructured query CONFIG
  • value - query value in internal Immutable format
  • onChange - callback when query value changed. Params: value (in Immutable format), config, actionMeta (details about action which led to the change, see ActionMeta in index.d.ts).
  • renderBuilder - function to render query builder itself. Takes 1 param props you need to pass into <Builder {...props} />.

Notes:

  • If you put query builder component inside Material-UI's <Dialog /> or <Popover />, please:
    • use prop disableEnforceFocus={true} for dialog or popver
    • set css .MuiPopover-root, .MuiDialog-root { z-index: 900 !important; } (or 1000 for AntDesign v3)
  • props arg in renderBuilder have actions and dispatch you can use to run actions programmatically (for list of actions see Actions in index.d.ts).

<Builder />

Render this component only inside Query.renderBuilder() like in example above:

  renderBuilder = (props) => (
    <div className="query-builder-container">
      <div className="query-builder qb-lite">
          <Builder {...props} />
      </div>
    </div>
  )

Wrapping <Builder /> in div.query-builder is necessary.
Optionally you can add class .qb-lite to it for showing action buttons (like delete rule/group, add, etc.) only on hover, which will look cleaner.
Wrapping in div.query-builder-container is necessary if you put query builder inside scrollable block.

Utils

  • Save, load:

    getTree (immutableValue, light = true) -> Object

    Convert query value from internal Immutable format to JS format. You can use it to save value on backend in onChange callback of <Query>.
    Tip: Use light = false in case if you want to store query value in your state in JS format and pass it as value of <Query> after applying loadTree() (which is not recommended because of double conversion). See issue #190

    loadTree (jsValue, config) -> Immutable

    Convert query value from JS format to internal Immutable format. You can use it to load saved value from backend and pass as value prop to <Query> (don't forget to also apply checkTree()).

    checkTree (immutableValue, config) -> Immutable

    Validate query value corresponding to config. Invalid parts of query (eg. if field was removed from config) will be always deleted. Invalid values (values not passing validateValue in config, bad ranges) will be deleted if showErrorMessage is false OR marked with errors if showErrorMessage is true.

    isValidTree (immutableValue) -> Boolean

    If showErrorMessage in config.settings is true, use this method to check is query has bad values.
  • Export:

    queryString (immutableValue, config, isForDisplay = false) -> String

    Convert query value to custom string representation. isForDisplay = true can be used to make string more "human readable".

    mongodbFormat (immutableValue, config) -> Object

    Convert query value to MongoDb query object.

    sqlFormat (immutableValue, config) -> String

    Convert query value to SQL where string.

    elasticSearchFormat (immutableValue, config) -> Object

    Convert query value to ElasticSearch query object.

    jsonLogicFormat (immutableValue, config) -> {logic, data, errors}

    Convert query value to JsonLogic format. If there are no errors, logic will be rule object and data will contain all used fields with null values ("template" data).
  • Import:

    loadFromJsonLogic (jsonLogicObject, config) -> Immutable

    Convert query value from JsonLogic format to internal Immutable format.

Config format

This library uses configarion driven aprroach. Config defines what value types, operators are supported, how they are rendered, imported, exported. At minimum, you need to provide your own set of fields as in basic usage. See CONFIG for full documentation.

Versions

Versions 4.x are backward-compatible with 2.x and 3.x. It's recommended to update your version.

Supported versions

Version Supported
4.x :white_check_mark:
3.x :white_check_mark:
2.x :white_check_mark:
1.x :warning:
0.x :x:

Changelog

See CHANGELOG

Migration to 4.9.0

Version 4.9.0 has a breaking change for operators is_empty and is_not_empty. Now these operstors can be used for text type only (for other types they will be auto converted to is_null/is_not_null during loading of query value created with previous versions). Changed meaning of is_empty - now it's just strict comparing with empty string. Before change the meaning was similar to is_null. If you used is_empty for text types with intention of comparing with null, please replace is_empty -> is_null, is_not_empty -> is_not_null in saved query values. If you used JsonLogic for saving, you need to replace {"!": {"var": "your_field"}} -> {"==": [{"var": "your_field"}, null]} and {"!!": {"var": "your_field"}} -> {"!=": [{"var": "your_field"}, null]}.

Migration from v1 to v2

From v2.0 of this lib AntDesign is now optional (peer) dependency, so you need to explicitly include antd (4.x) in package.json of your project if you want to use AntDesign UI.
Please import AntdConfig from react-awesome-query-builder/lib/config/antd and use it as base for your config (see below in usage).
Alternatively you can use BasicConfig for simple vanilla UI, which is by default.
Support of other UI frameworks (like Bootstrap) are planned for future, see Other UI frameworks.

Contributing

Code Contributing

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributing

Become a financial contributor and help us sustain our community. [Contribute]

If you mention in an GitHub issue that you are a sponsor, we will prioritize helping you.

As a sponsor you can ask to implement a feature that is not in a todo list or motivate for faster implementation.

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

License

MIT. See also LICENSE.txt

Forked from https://github.com/fubhy/react-query-builder

changelog

Changelog

  • 4.9.0
    • Added is_null and is_not_null operators (issue #494) (PR #522)
    • ! Breaking change for operators is_empty and is_not_empty. Left for text type only, for other types will be auto converted to is_null/is_not_null. Changed meaning of is_empty - now it's just strict comparing with empty string. Before change meaning was similar to is_null (and export to SQL was wrong because of non-existent operator IS EMPTY). (issue #494) (PR #573)
    • Fixed order of operators for field when merging operators from 2+ widgets (PR #573)
    • Added last param fieldDef for functions to format operators (PR #573)
    • Added jsonLogic to widget TS def (PR #572)
  • 4.8.0
    • Added read-only mode switch for rules and groups. See showLock and canDeleteLocked config options, custom JsonLogic op locked, setLock action, lockLabel and lockedLabel. Added Switch components, see renderSwitch. (issue #377) (PR #490)
    • Fixed issue with frozen config (Object.freeze) by using clone (issue #345) (PR #490)
    • Fix: Filter value sources for func args correctly. LHS field can be used as arg in RHS function. (PR #490)
    • MUI - Support showSearch (autocomplete) for field select widget (issue #479 #521) (PR #563)
    • AntDesign - Fix FieldSelect with 3+ level !struct nesting (issue #224) (PR #564)
  • 4.7.2
    • Fixed import of rule_group with not (issue #548) (PR #559)
  • 4.7.1
    • Fixed potential inconsistent order of fields (issue #335) (PR #553)
    • Bump webpack-dev-server from 3.11.2 to 4.4.0 (PR #540)
    • Change FieldItems type definition from map to array (issues #550, #363) (PR #551)
    • Spreading customProps to vanilla widgets (PR #546)
    • Fix for allowCustomValues (PR #545)
    • Use minimum material-ui version 4.12.3 and use new createTheme instead of deprecated createMuiTheme (issue #463) (PR #531)
  • 4.7.0
    • Add explicit not: false in new group (issue #512)
    • Fix: don't automatically add one rule to query when it become empty when canLeaveEmptyGroup=true (issue #504)
    • Added config forceShowConj (issue #474)
    • Fixed import of complex hierarchy fields (combination of !group and !struct) from JsonLogic (issues #517, #333)
    • Fixed non-ordered map bug (issue #501)
  • 4.6.0
    • Added groupId (id of the parent Item - Group, RuleGroup, RuleGroupExt etc) to field's, operartor's and widget's props (PR #510)
    • Fixed export to ES when group is empty (broken 'Clear' button in demo app) (PR #511)
    • Added 3rd param actionMeta to onChange() to get info about action (PR #445) (issue #351)
    • Added demo of using actions programmatically (see run actions in demo app) (PR #445)
    • Added config shouldCreateEmptyGroup (default false) (PR #445)
    • Now config canLeaveEmptyGroup is true by default (PR #445) (issue #504)
    • Breaking changes for format with isForDisplay=true - don't wrap strings with ", replace == with = (PR #518)
    • Fixed type definition for export utils - can return undefined (PR #516)
    • Fixed use of hideOperator (PR #523) (issue #292)
    • Documented cancelText (PR #524) (issue #520)
  • 4.5.2
    • Added rule id to field's, operartor's and widget's props. Added config of the selected field to the operator props as fieldConfig (issue #502) (PR #503)
  • 4.5.1
    • Fixed export of field name to ES (broken demo app)
  • 4.5.0
    • Added basic support of export to ElasticSearch (PR #469)
    • Export all helper funcs from configUtils (PR #493)
    • Fixed bug with zero value in MaterialSelect (PR #392)
  • 4.4.3
    • babel: use "@babel/plugin-transform-runtime" to avoid globally defined regenerator runtime (PR #480)
    • Fix export of not in some!group into JsonLogic (issue #476) (PR #484)
    • Fixed issue with default import/export in Vite build (PR #481)
  • 4.4.2
    • Added support of autocomplete for multiselect widget in MUI (PR #475)
  • 4.4.1
    • feat: possibility to add custom operators for groups (PR #462)
  • 4.4.0
    • Added support of server-side load of values for select (MaterialUI only) (PR #471)
  • 4.3.0
    • Improved function support
    • Functions used in examples now moved to BasicFuncs (exported with lib)
    • Added funcs RELATIVE_DATETIME, NOW, UPPER
    • Added option showPrefix for func args (false by default)
    • Added missing mongoFormatValue for all types in basic config (now dates are exported as Date objects)
  • 4.2.0
    • Added textarea widget
  • 4.1.1
    • Fix warning about showSearch in MUI theme
    • Fix incorrect override of vanilla button label (issue #347)
    • Fix display default conj (issue #426)
    • Don't wrap in MUI ThemeProvider if no theme or locale provided (issue #325)
    • Fix canLeaveEmptyGroup logic (issue #378)
  • 4.1.0
    • Fixed lint errors in code
    • Reorganized files in tests
    • Updated packages
    • Now minimum supported NodeJs is 12.13
    • Added TSC linting
    • Now ESLint checks types in TS files
    • Added new scripts: install-all, clean, reinstall, build-all, check-hot, tsc, eslint, smoke, resmoke. Renamed sandbox_ts to sandbox-ts, sandbox_js to sandbox-js.
    • Fixed problems with VSCode's TSLint plugin
    • Moved from deprecated prepublish to prepare in package.json
  • 4.0.4
    • Fixed issue #349 with drag-n-drop and office-ui-fabric-react
    • Fixed issue #413 with func arg with 1 value source which is not value
  • 4.0.3
    • Fixed issue #386 with import select field from JsonLogic (reason: bug with func/field widget in getWidgetForFieldOp)
    • Fixed issue #387 with subgroups in Material UI
  • 4.0.2
    • Fixed MaterialConfig import for TS projects (issue #368)
  • 4.0.1
    • Added custom context to isolate Query Builder store (PR #350)
    • Added support for React 17 as a peer dependency
  • 4.0.0
    • Removed setting useGroupsAsArrays. Instead added field config mode for type !group with values: some (default, corresponding useGroupsAsArrays = true), array (new, user can choose one of group operators), struct (obsolete, corresponding useGroupsAsArrays = false).
    • For type=!group and mode=array:
      • new field configs are available: conjunctions, showNot, operators, defaultOperator, initialEmptyWhere
      • you can use group operators some, none, all or operators with 1 integer opearnd (for count): equal, not_equal, less, between, ..
      • localization setting addSubRuleLabel
    • Removed obsolete setting hideConjForOne
    • (rare) Added field config fieldName to override field key for import/export
    • (rare) Added field config jsonLogicVar and settings jsonLogic.groupVarKey, jsonLogic.altVarKey to override JsonLogic var key if need
  • 3.0.0
  • 2.2.2
    • Fix issue #306: Wrong import from JsonLogic and export to MongoDb for negated single-item group
  • 2.2.1
    • Fix issue #300: If using query builder inside a form element, buttons try to submit the form
  • 2.2.0
    • Fixed issues #246 and #176 related to wrong export and import from JsonLogic for multi-nested group fields
      Now !group fields are treated as arrays (added setting useGroupsAsArrays = true)
  • 2.1.19
    • Fixed issue #252 ("Cannot update a component from inside the function body of a different component")
    • Issue #190: Fixed TS def for getTree/2 - added 2nd param light?
  • 2.1.17
    • Dropped support of loading query in obsolete Immutable string format used in versions 0.* (issue #254)
  • 2.1.16
    • Fixed issues with export to Mongo and JsonLogic of queries with nested groups (#279, #279)
  • 2.1.15
    • Fixed issue #276 with TS definitions
  • 2.1.14
    • Require Node v10+ (for karma)
    • Fixed "SyntaxError Unexpected token '<'" in sandboxes
    • Fixed requirement of sass in sandboxes
    • Fixed eslint warnings in sandboxes
    • Improved Travis config: fixed ENOSPC, removed excess testing during install
  • 2.1.12
    • Added sandbox with vanilla widgets and without TS
  • 2.1.11
    • Minor fix for some/not JsonLogic operators can be potentially used for array types
  • 2.1.10
    • Fixed issues #249, #246 regarding export/import from jsonLogic and groups
    • Fixed issue #272 with float numbers for vanilla widgets
  • 2.1.8
    • Fixed issue #263
  • 2.1.7
    • Fixed TS def for conjunctionOptions (#247)
  • 2.1.6
    • Temporary disable AntDesign 4.5.0+ because of "Invalid hook call" problem
  • 2.1.4
    • Fixed issue #249 with importing rules with group fields from JsonLogic format
  • 2.1.3
    • Fixed issue #255 with reordering
  • 2.1.2
    • Added config maxNumberOfRules
    • Bugfix: respect maxNesting and canLeaveEmptyGroup settings during drag-n-drop
    • Enabled ESLint for examples with TS
  • 2.1.1
    • Fixed export of not_like op to JsonLogic
  • 2.1.0
    • Added displaying of rule validation errors, see showErrorMessage in config.settings
    • Added QbUtils.isValidTree()
    • validateValue moved from widget settings to field's fieldSettings
    • Added ESLint (unused vars & props are off for now)
  • 2.0.11
    • Added starts_with, ends_with operators for text type
  • 2.0.10
    • Fixed bug with missing funcs in config
  • 2.0.9
    • Fixed issues #215, #214, #208
    • Fixed validateValue
    • Simpler sandbox demo
  • 2.0.8
    • Fixed issue #207
  • 2.0.7
    • Added canShortMongoQuery to config.settings
  • 2.0.6
    • Fixed issue #176
  • 2.0.5
    • Fixed TS types. Updated sandbox to TS
  • 2.0.4
    • Fixed import
  • 2.0.2
    • Fix for TS
  • 2.0.1
    • Fixed issues #187, #194, #182
  • 2.0.0
    • Added renderConjs, renderButton, renderButtonGroup, renderProvider, renderValueSources, renderConfirm
    • Removed coupling with AntDesign. Now it should be possible to use another UI framework.
    • Added vanilla widgets. Added switcher between antd and vanilla in demo.
  • 1.3.7
    • Fixed issue #168 with dot in field name
  • 1.3.6
    • Added config options to disable inputs: immutableFieldsMode, immutableOpsMode, immutableValuesMode
  • 1.3.5
    • Issue #158
  • 1.3.3
    • Bugfix
  • 1.3.2
    • Bugfix
  • 1.3.1
    • Added FieldTreeSelect
  • 1.3.0
    • Added support of !group
  • 1.2.0
    • Added treeselect and treemultiselect types
    • Changed format of listValues from {<value>: <title>} to [{value, title}] (old is supported). Tree select also use listValues, format is compatible with simple select - [{value, title, parent}]
  • 1.1.3
    • Fixed console warnings
    • Fixed dev hot reload: now state is preserving
    • Added render hoooks to config.settings: renderBeforeWidget, renderAfterWidget, renderBeforeActions, renderAfterActions
  • 1.1.2
  • 1.1.1
    • Optimized $eq and $and in MongoDb query export
    • Fixed error if query value is empty
    • Added API in readme
  • 1.1.0
  • 1.0.12
    • Added sqlFormatFunc, mongoFormatFunc, renderBrackets, renderSeps (for func), funcs (for field)
  • 1.0.11
    • Added css-class qb-lite for query builder (see readme if you wanna use it)
  • 1.0.10
    • Fix when using cascader for func selection
  • 1.0.9
    • Allow group of functions (like with fields - type == '!struct' and subfields)
  • 1.0.8
    • Added support for your custom functions as value source (args can be values/fields/funcs), see new section funcs in config
    • Improved Mongo format: now can compare with field & use funcs with help of $expr
    • (breaking) mongoFormatOp - inserted arg useExpr at 4th position
    • Added hideForSelect, hideForCompare for field config
  • 1.0.7
    • Fixed Babel
  • 1.0.6
    • Added TypeScript support (examples uses TS, sandbox uses JS)
    • Updated Babel, Webpack
    • For field widget slightly changed format of formatValue() and sqlFormatValue() functions - argument rightFieldDef is now last one
    • Added defaultValue in field config
    • All fieldSettings will be now passed to widget props
    • listValues and allowCustomValues moved inside fieldSettings
  • 1.0.4
    • Added QbUtils.sqlFormat() (issue #29)
    • Added like and not_like operators
    • Added 2 params string op, Object opDef to end of formatValue(), mongoFormatValue()
  • 1.0.3
    • Completely removed auto-loading of antd styles (issue #50)
  • 1.0.2
    • Fixed bug with running examples app via react-scripts
  • 1.0.1
    • Fixed bug with importing React
  • 1.0.0
    • Don't include AntDesign styles automatically (issues #50, #93)
    • added: allowCustomValues (issue #88)
    • change: removed renderFieldAndOpAsDropdown, replaced by renderField (issue #109)
    • added renderOperator (issue #89)
    • change: query value now can be exported to JSON (instead of Immutable.Map), and loaded with loadTree (old format is supported) (issue #61)
    • added: canRegroup
    • rename: readonlyMode -> immutableGroupsMode
    • rename: get_children -> renderBuilder
    • removed: unused <Preview /> component and .query-preview class
    • optimized renders & dragging