Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@react-querybuilder/antd

Package Overview
Dependencies
Maintainers
1
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-querybuilder/antd - npm Package Versions

1
13

4.5.2

Diff

Changelog

Source

[v4.5.2] - 2022-08-19

Fixed

  • Backslashes are now properly escaped when formatQuery generates JSON.parse-able strings ("mongodb" and "json_without_ids" formats).
  • The parse* import methods properly handle backslashes.
  • [#353] The moment package is no longer included in the build for @react-querybuilder/antd.

Added

  • [#333] When a rule has an operator of "between"/"notBetween" and either valueSource: "field" or valueEditorType: "select", the default ValueEditor will display two drop-down lists. The values of the drop-down lists will be joined with a comma when the rule's value property is updated.
  • [#337] In conjunction with the "between"-related enhancements above, a new Boolean prop has been added to <QueryBuilder /> called listsAsArrays. This prop works in a similar manner to the parse* option of the same name. When the prop is true, ValueEditor (and ValueSelector for multiple: true) will store lists of values, including "between" value pairs, as proper arrays instead of comma-separated strings.
    • Existing, default format:
      • { field: "f1", operator: "between", value: "f2,f3", valueSource: "field" }
    • listsAsArrays format:
      • { field: "f1", operator: "between", value: ["f2", "f3"], valueSource: "field" }
jakeboone02
published 4.5.1 •

Changelog

Source

[v4.5.1] - 2022-06-21

Fixed

  • The type ValueProcessor was incorrectly including the new ValueProcessorByRule type. ValueProcessor is now simply an alias for ValueProcessorLegacy, which should undo a breaking change from [v4.5.0].
jakeboone02
published 4.5.0 •

Changelog

Source

[v4.5.0] - 2022-06-19

Changed

TL;DR: These are probably not breaking changes.

<details> <summary>While a breaking change in a minor release technically violates <a href="https://semver.org/">semver</a>, the change in question is only "breaking" in a very rare--possibly non-existent--case. The <em>only</em> case where this change will break anything is if you use <code>formatQuery</code> with a custom <code>valueProcessor</code> that accepts fewer than three (3) arguments. Click for details...</summary>
  • [#319] formatQuery will now invoke custom valueProcessor functions with different arguments based on the function's .length property, which is the number of arguments a function accepts excluding those with default values:
    • If the valueProcessor function accepts fewer than three (3) arguments, it will be called like this:
    valueProcessor(rule, { parseNumbers });
    
    The first argument is the RuleType object directly from the query. The second argument is of type ValueProcessorOptions, which is a subset of FormatQueryOptions (currently { parseNumbers?: boolean; }).
    • To maintain the current behavior (valueProcessor(field, operator, value, valueSource)), make sure the valueProcessor function accepts at least three arguments with no default values (do not use = for the first three arguments). For example, the following code will log length: 1:
    const valueProcessor = (field: string, operator = '=', value = '') => '...';
    console.log(`length: ${valueProcessor.length}`);
    
    • If you use TypeScript, these conditions will be enforced automatically.
</details>

Added

  • [#319] Invoking valueProcessor with the full RuleType object provides access to much more information about specific rules. Standard properties that were previously unavailable include path, id, and disabled, but any custom properties will also be accessible.
    • The default value processors for "sql", "parameterized", "parameterized_named", "mongodb", "cel", and "spel" formats have not changed, but alternate functions using the new fn(rule, options) signature are now available:
      • defaultValueProcessorByRule
      • defaultValueProcessorCELByRule
      • defaultValueProcessorMongoDBByRule
      • defaultValueProcessorSpELByRule
  • [#320]/[#323] New parser functions (also available as standalone builds in the dist folder). Click the respective "Import from [format]" button in the demo to try them out.
    • parseJsonLogic takes a JsonLogic object and converts it to RuleGroupType.
    • parseCEL takes a CEL string and converts it to RuleGroupType. Click the "Import from CEL" button in the demo.
  • [#328] New utility function transformQuery recursively processes rule groups and rules with the provided ruleProcessor, ruleGroupProcessor, and other options (documentation).

Fixed

  • [#323] formatQuery outputs will now escape quotation marks when appropriate:
    • For SQL ("sql", "parameterized", "parameterized_named"), single quotes will be doubled up, e.g. (firstName = 'Ra''s')
    • For other formats, double or single quotes will be escaped with a backslash if necessary (firstName == 'Ra\'s' or firstName == "Ra\"s").
  • [#323] The standalone builds of formatQuery and parseSQL no longer include React and are not minified.
jakeboone02
published 4.4.1 •

Changelog

Source

[v4.4.1] - 2022-06-03

Added

jakeboone02
published 4.4.0 •

Changelog

Source

[v4.4.0] - 2022-05-30

Changed

(This list may look long, but the breaking changes should only affect a small minority of users.)

  • Several utility functions that were trivial or only really useful internal to this package are no longer exported from react-querybuilder. To see which ones, check the internal folder. All exports from that folder were previously exported from the utils folder, which is re-exported in its entirety from the main entry point.
  • The RuleProps and RuleGroupProps interfaces have deprecated the props that were individual properties of rules/groups, and have added a prop containing the full rule or group object. This should only affect users that implement a custom <RuleGroup /> component but use the default <Rule /> component, since <Rule /> now expects a rule prop.
    • In RuleProps: field, operator, value, and valueSource are deprecated and replaced by rule: RuleType.
    • In RuleGroupProps: combinator, rules, and not are deprecated and replaced by ruleGroup: RuleGroupTypeAny.
  • Internal methods for immutably updating queries have been moved from the schema prop to the new actions prop on both RuleProps and RuleGroupProps. Custom <Rule /> and <RuleGroup /> components will need to adjust their prop declarations.

Fixed

  • vite-tsconfig-paths was mistakenly added to the dependencies list instead of devDependencies for the main package in [v4.1.3].

Added

  • debugMode now triggers logging when the query or options are updated and when a query update fails for some reason (e.g. the path is disabled).
  • New onLog callback prop is used instead of console.log when debugMode is true.
  • As a consequence of the new properties on RuleProps and RuleGroupProps (rule and ruleGroup, respectively), custom <Rule /> and <RuleGroup /> components now have access to their full rule/group objects, including any non-standard properties. This can greatly simplify the use of customized query objects.
  • <QueryBuilder /> will detect potential problems with using the component in a controlled vs uncontrolled manner and will log errors to the console (in "development" mode only). This includes the following situations:
    • Both query and defaultQuery props are defined (TypeScript will complain about this at compile time, errors will be logged at run time)
    • query prop is undefined in one render and then defined in the next render
    • query prop is defined in one render and then undefined in the next render
jakeboone02
published 4.3.1 •

Changelog

Source

[v4.3.1] - 2022-05-21

Changed

  • If using TypeScript, custom operatorSelector components will now need to accommodate OptionGroup<NameLabelPair>[] in addition to the normal NameLabelPair[].

Added

  • [#304] Many compatibility components now accept the props of the rendered library component in addition to the standard props (see documentation), allowing customization specific to the style library.
  • [#306] New prop autoSelectOperator (documentation) behaves like autoSelectField but for the operator selector.
    • The fields and operators properties of the translations prop object now accept placeholderName, placeholderLabel, and placeholderGroupLabel properties (documentation). These translatable strings set the default field and operator values and labels when autoSelectField and/or autoSelectOperator are set to false.
    • Corresponding options were also added to formatQuery, which will now ignore rules where the field or operator match the placeholder values for most export formats.
  • [#303] Added support for wildcards concatenated to field names in parseSQL. Examples:
<table> <tr> <th>

SQL

</th> <th>

Generated RuleType object

</th> </tr> <tr> <td>

"lastName LIKE firstName || '%'"

</td> <td>
{
  "field": "lastName",
  "operator": "beginsWith",
  "value": "firstName",
  "valueSource": "field"
}
</td> </tr> <tr> <td>

"lastName NOT LIKE '%' || firstName || '%'"

</td> <td>
{
  "field": "lastName",
  "operator": "doesNotContain",
  "value": "firstName",
  "valueSource": "field"
}
</td> </tr> </table>

Fixed

  • [#301] react-querybuilder and the compatibility packages are all built with React v18 now (the peerDependencies version is still ">=16.8.0"). Previous 4.x versions were usable within React 18 applications, but now the build and tests explicitly use it.
  • [#308] The CodeSandbox CI template is now located within the repository, and several other CodeSandbox-compatible examples have been added as well (see examples folder).
jakeboone02
published 4.3.0 •

jakeboone02
published 4.2.5 •

Changelog

Source

[v4.2.5] - 2022-05-12

Added

  • Added two options to the translations prop: fields.placeholderLabel and fields.placeholderGroupLabel. These will be used in place of the default "------" when the autoSelectField prop is set to false.
  • All translation properties are now optional.
jakeboone02
published 4.2.4 •

Changelog

Source

[v4.2.4] - 2022-05-12

Added

  • Added a parseNumbers option for formatQuery.
  • Added a debugMode prop on <QueryBuilder />.
jakeboone02
published 4.2.3 •

Changelog

Source

[v4.2.3] - 2022-04-05

Added

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc