@react-querybuilder/bulma
Advanced tools
Changelog
[v5.3.2] - 2022-12-26
jsonLogicOperations
option to parseJsonLogic
to enable parsing of custom operations.Changelog
[v5.3.1] - 2022-12-23
crypto
package was used in a way that didn't work in some Node environments.Changelog
[v5.3.0] - 2022-12-23
id
s are now generated as valid v4 UUIDs using crypto.getRandomValues()
instead of Math.random()
. The generateID
function used internally is exported.NameLabelPair
has been deprecated and is now an alias for the Option
interface.showCombinatorsBetweenRules
is enabled, a combinator selector immediately above a locked rule/group will no longer be locked unless the group it belongs to is locked.jsonLogicAdditionalOperators
is exported again (documentation).queryBuilder-branches
displays "tree view" branch lines.getRuleClassname
and getRuleGroupClassname
are passed the rule or group, and the return value will be added as a class to the surrounding div
.Field
, Operator
, and new interface Combinator
now have an optional className
property that will be applied to rules or groups that specify the appropriate attribute.arity
property for operators. When arity
is either "unary" or a number less than 2, the value editor will not render when that operator is selected (similar to the standard "null"/"notNull" operators).Option
(née NameLabelPair
), Field
, and ValueEditorProps
now accept generics for name
and other properties.OptionList
type covers the options
property for all standard selection lists (field, operator, combinator, etc.). Previously this was a union type: NameLabelPair[] | OptionGroup<NameLabelPair>[]
. OptionList
is equivalent to this type, but 1) doesn't require typing the base type twice, and 2) uses the new Option
name instead of the deprecated NameLabelPair
.independentCombinators
is enabled, custom onAddRule
and onAddGroup
callbacks can add a combinatorPreceding
property to the rule/group which will end up being the combinator inserted above the new rule/group (if the parent group is not empty).Changelog
[v5.2.0] - 2022-11-26
onRemove
prop and pass rule/group to all ActionElement
s (buttons).Changelog
[v5.1.3] - 2022-11-23
antd
version 5.Changelog
[v5.1.2] - 2022-11-21
dndOver
class is no longer applied to child group headers.Changelog
[v5.1.1] - 2022-10-27
parseMongoDB
and parseJsonLogic
now respect independentCombinators
option.DefaultRuleGroupType
and DefaultRuleGroupTypeIC
, are respected by convertFromIC
and convertToIC
.Changelog
[v5.0.0] - 2022-10-22
defaultQuery
is defined, an id
property will be added to each rule and group in the query hierarchy. This will be reflected in the onQueryChange
callback parameter. In previous versions defaultQuery
was not modified by the component itself, but id
is now added because it is a required attribute internally.prepareRuleGroup
utility function will no longer coerce the not
property of groups to be a boolean
type (or even defined at all).$eq
and $and
operators are only used when necessary.react-dnd
dependency completely optional when the enableDragAndDrop
prop was not set to true
, drag-and-drop functionality was extracted from react-querybuilder
into a new package called @react-querybuilder/dnd
.peerDependencies
of react-dnd
and react-dnd-html5-backend
(each of which can be any version >= 14, as long as they match), but no hard dependencies
. The only external dependencies in the main package now are immer
and clsx
.<QueryBuilder />
within a <QueryBuilderDnD />
element. The enableDragAndDrop
prop is implicitly true
when using QueryBuilderDnD
, so you no longer need to set it explicitly unless it should be false
(which can be set on QueryBuilderDnD
or QueryBuilder
).
export function App() {
return (
- <QueryBuilder enableDragAndDrop />
+ <QueryBuilderDnD>
+ <QueryBuilder />
+ </QueryBuilderDnD>
);
}
react-dnd
and renders DndProvider
higher in the component tree, replace QueryBuilderDnD
with QueryBuilderDndWithoutProvider
.@react-querybuilder/material
package now properly inherits the theme configuration from ancestor ThemeProvider
s. Note: the @mui/material
components are now loaded asynchronously by default, so the query builder will initially be rendered with the default components. See the documentation or the README to find out how to render the MUI components immediately.parseCEL
now handles strings correctly (including multi-line strings).AntDValueSelector
properly handles empty string values in multiselect mode.controlElements
and controlClassnames
properties into any descendant QueryBuilder
components (composition FTW!). This is now the recommended usage for all compatibility packages.onAddRule
and onAddGroup
callback props now receive an optional "context" parameter as the fourth argument. This parameter can be provided by a custom addRuleAction
/addGroupAction
component to its handleOnClick
prop. This allows users to alter or replace the default rule based on arbitrary data. For example, the addRuleAction
component could render two "add rule" buttons which add different rules depending on which one was clicked, as long as they provided a different context
parameter.formatQuery
has a new ruleProcessor
configuration option applicable to non-SQL query language formats. When provided, the entire rule output will be determined by the function. For the relevant formats, valueProcessor
already behaved this way; the default "value" processors have been renamed to defaultRuleProcessor[Format]
to clarify the behavior. The default processors' original "value" names are deprecated but still available (with no immediate plans to remove them).parseSQL
will now ignore a leading WHERE
keyword, e.g. parseSQL("WHERE firstName = 'Steve'")
will not fail to produce a query rule like in v4.controlElements
prop has a new option: inlineCombinator
. By default, this is a small wrapper around the combinatorSelector
component that is used when either showCombinatorsBetweenRules
or independentCombinators
is true
. The inlineCombinator
option was only added to support @react-querybuilder/dnd
, so there is almost certainly no reason to use it directly.