react-querybuilder
Advanced tools
Comparing version 1.0.8 to 1.0.9
{ | ||
"name": "react-querybuilder", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "The React <QueryBuilder /> component for constructing queries", | ||
@@ -26,2 +26,3 @@ "main": "dist/index.js", | ||
"babel-preset-react": "^6.5.0", | ||
"chai": "^3.5.0", | ||
"copy-webpack-plugin": "^3.0.1", | ||
@@ -32,4 +33,13 @@ "css-loader": "^0.23.1", | ||
"html-webpack-plugin": "^2.21.0", | ||
"karma": "^0.13.22", | ||
"karma-chai": "^0.1.0", | ||
"karma-mocha": "^1.0.1", | ||
"karma-mocha-reporter": "^2.0.4", | ||
"karma-phantomjs-launcher": "^1.0.0", | ||
"karma-webpack": "^1.7.0", | ||
"mocha": "^2.5.3", | ||
"node-sass": "^3.8.0", | ||
"phantomjs-prebuilt": "^2.1.7", | ||
"react": "^15.1.0", | ||
"react-addons-test-utils": "^15.1.0", | ||
"react-dom": "^15.1.0", | ||
@@ -49,5 +59,7 @@ "sass-loader": "^3.2.0", | ||
"scripts": { | ||
"start": "webpack-dev-server --config webpack-dev.config.js", | ||
"dist": "del dist; webpack --config webpack-dev.config.js" | ||
"start": "webpack-dev-server", | ||
"dist": "del dist; webpack", | ||
"test": "karma start", | ||
"test:watch": "karma start --no-single-run --auto-watch" | ||
} | ||
} |
@@ -54,1 +54,83 @@ # react-querybuilder | ||
### API | ||
`<QueryBuilder />` is the only top-level component exposed from this library. It supports the following properties: | ||
*(Required)* **fields** : [ {name:String, label:String} ] | ||
The array of fields that should be used. Each field should be an object with | ||
`{name:String, label:String}` | | ||
*(Optional)* **operators** : [ {name:String, label:String} ] | ||
The array of operators that should be used. The default operators include: | ||
```js | ||
[ | ||
{name: 'null', label: 'Is Null'}, | ||
{name: 'notNull', label: 'Is Not Null'}, | ||
{name: 'in', label: 'In'}, | ||
{name: 'notIn', label: 'Not In'}, | ||
{name: '=', label: '='}, | ||
{name: '!=', label: '!='}, | ||
{name: '<', label: '<'}, | ||
{name: '>', label: '>'}, | ||
{name: '<=', label: '<='}, | ||
{name: '>=', label: '>='}, | ||
] | ||
``` | ||
*(Optional)* **combinators** : [ {name:String, label:String} ] | ||
The array of combinators that should be used for RuleGroups. | ||
The default set includes: | ||
```js | ||
[ | ||
{name: 'and', label: 'AND'}, | ||
{name: 'or', label: 'OR'}, | ||
] | ||
``` | ||
*(Optional)* **getEditor** : function({field, operator, value, onChange}):ReactElement | ||
This is a callback function invoked by the internal `<Rule />` component to determine the | ||
editor for the field value. By default a `<input type="text" />` is used. | ||
*(Optional)* **getOperators** : function(field):[] | ||
This is a callback function invoked to get the list of allowed operators | ||
for the given field | ||
*(Optional)* **onQueryChange** : function(queryJSON):void | ||
This is a notification that is invoked anytime the query configuration changes. The | ||
query is provided as a JSON structure, as shown below: | ||
```json | ||
{ | ||
"combinator": "and", | ||
"rules": [ | ||
{ | ||
"field": "firstName", | ||
"operator": "null", | ||
"value": "" | ||
}, | ||
{ | ||
"field": "lastName", | ||
"operator": "null", | ||
"value": "" | ||
}, | ||
{ | ||
"combinator": "and", | ||
"rules": [ | ||
{ | ||
"field": "age", | ||
"operator": ">", | ||
"value": "30" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1767592
25
20181
135
26