{"id":49453704,"url":"https://github.com/Lefortov/react-two-way-querybuilder","last_synced_at":"2026-06-18T22:00:59.377Z","repository":{"id":54291066,"uuid":"75823299","full_name":"Lefortov/react-two-way-querybuilder","owner":"Lefortov","description":null,"archived":false,"fork":false,"pushed_at":"2021-02-26T06:49:22.000Z","size":512,"stargazers_count":34,"open_issues_count":8,"forks_count":30,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-12T04:59:25.965Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lefortov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-07T10:02:54.000Z","updated_at":"2025-05-03T16:41:56.000Z","dependencies_parsed_at":"2022-08-13T11:10:25.423Z","dependency_job_id":null,"html_url":"https://github.com/Lefortov/react-two-way-querybuilder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Lefortov/react-two-way-querybuilder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lefortov%2Freact-two-way-querybuilder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lefortov%2Freact-two-way-querybuilder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lefortov%2Freact-two-way-querybuilder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lefortov%2Freact-two-way-querybuilder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lefortov","download_url":"https://codeload.github.com/Lefortov/react-two-way-querybuilder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lefortov%2Freact-two-way-querybuilder/sbom","scorecard":{"id":83153,"data":{"date":"2025-08-11","repo":{"name":"github.com/Lefortov/react-two-way-querybuilder","commit":"2aca623849002c7a22b3dbe87df6e77086c3266b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":2,"reason":"Found 5/18 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 17 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-15T06:19:52.731Z","repository_id":54291066,"created_at":"2025-08-15T06:19:52.731Z","updated_at":"2025-08-15T06:19:52.731Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34508867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-30T04:01:03.703Z","updated_at":"2026-06-18T22:00:59.368Z","avatar_url":"https://github.com/Lefortov.png","language":"JavaScript","funding_links":[],"categories":["📦 Legacy \u0026 Inactive Projects"],"sub_categories":[],"readme":"# React Two Way Querybuilder\n\nA simple react component that lets you build queries dynamically on UI. Doesn't depend on any 3-d party libraries.\n\n![image](https://github.com/Lefortov/react-two-way-querybuilder/blob/master/blob/builder.jpg)\n\n## Installing\n\n```bash\nnpm i react-two-way-querybuilder --save\n```\n\n## Using\n\nTwo way query builder is flexible and configurable component with a set of possible options.\n\nSimple usage:\n\n```\n    import React, { Component } from 'react';\n    import TwoWayQuerybuilder from 'react-two-way-querybuilder';\n\n    const fields = [\n      { name: 'firstName', operators: 'all', label: 'First Name', input: { type: 'text' } },\n      { name: 'lastName', operators: 'all', label: 'Last Name', input: { type: 'text' } },\n      { name: 'age', operators: 'all', label: 'Age', input: { type: 'text' } },\n      { name: 'birthDate', operators: 'all', label: 'Birth date', input: { type: 'text' } },\n    ];\n\n    class App extends Component {\n\n        handleChange(event) {\n          console.log('query', event.query);\n        }\n\n        render() {\n            return (\n                 \u003cTwoWayQuerybuilder fields={fields} onChange={this.handleChange} /\u003e\n            );\n        }\n    }\n\n    export default App;\n```\n\n###Props:\n\n- **`fields`**: your fields used to build a query\n  * name: name of the field that would be used in a query\n  * label: how your field name would be shown in the dropdown\n  * operators: remove this property or set to 'all' if you want to use all operators for this field, else you can limit them by passing the array of the allowed operators `['=', '\u003c', '\u003e']`\n  * input: type of the input, possible options are: `text`, `textarea`, `select`. If you are using `select` input type pass options to the object in the following way:\n    `input: {type: 'select', options: [{value: '1', name: 'one'}, {value: '2', name: 'two'}]}`. Also, it supports validation by passing `pattern` property with regexp pattern and\n    `errorText` property for validation error message text. \n  \n- **`onChange`**: pass here your function that will be called when data was changed\n- **`config`**: configuration object with possible options:\n  * `query`: pass here prepared query, so UI will be built using it.\n  * `operators`: array of operators, the default one is: \n      ```\n      [\n        { operator: '=', label: '=' },\n        { operator: '\u003c\u003e', label: '\u003c\u003e' },\n        { operator: '\u003c', label: '\u003c' },\n        { operator: '\u003e', label: '\u003e' },\n        { operator: '\u003e=', label: '\u003e=' },\n        { operator: '\u003c=', label: '\u003c=' },\n        { operator: 'IS NULL', label: 'Null' },\n        { operator: 'IS NOT NULL', label: 'Not Null' },\n        { operator: 'IN', label: 'In' },\n        { operator: 'NOT IN', label: 'Not In' },\n       ]\n    ```\n   * `combinators`: array of combinators, the default one is: \n    ```\n    [\n        { combinator: 'AND', label: 'And' },\n        { combinator: 'OR', label: 'Or' },\n        { combinator: 'NOT', label: 'Not' },\n    ]\n    ```  \n  * `style`: use this object to redefine styles. Properties:\n    * `primaryBtn`: used for primary button styles,\n    * `deleteBtn`: delete button styles,\n    * `rule`: rule styles,\n    * `condition`: condition styles,\n    * `select`: select styles,\n    * `input`: input styles,\n    * `txtArea`: text area styles :D\n    * `error`: error message styling\n    \n- **`buttonsText`**: text of the buttons, you can redefine it for multilanguage support or because you just want. By default used following text:\n    * addRule: `'Add rule'`,\n    * addGroup: `'Add group'`,\n    * clear: `'Clear'`,\n    * delete: `'Delete'`\n\n## Samples\n\nVisit [DEMO](https://lefortov.github.io/react-two-way-querybuilder) storybook to take a look at basic usage cases: \n\n- **existing query**: \n  ```\n    import React, { Component } from 'react';\n    import TwoWayQuerybuilder from 'react-two-way-querybuilder';;\n\n    const fields = [\n      { name: 'firstName', operators: 'all', label: 'First Name', input: { type: 'text' } },\n      { name: 'lastName', operators: 'all', label: 'Last Name', input: { type: 'text' } },\n      { name: 'age', operators: 'all', label: 'Age', input: { type: 'text' } },\n      { name: 'birthDate', operators: 'all', label: 'Birth date', input: { type: 'text' } },\n    ];\n\n    const config = {\n      query: \"((firstname='Jack' AND lastName='London') OR lastName='Smith')\",\n    };\n\n    class App extends Component {\n\n        handleChange(event) {\n          console.log('query', event.query);\n        }\n\n        render() {\n            return (\n                 \u003cTwoWayQuerybuilder config={config} fields={fields} onChange={this.handleChange} /\u003e\n            );\n        }\n    }\n\n    export default App;\n  ```\n\n- **changed input types**:\n  ```\n    import React, { Component } from 'react';\n    import TwoWayQuerybuilder from 'react-two-way-querybuilder';;\n\n    const changedFields = [\n      { name: 'firstName', operators: 'all', label: 'First Name', input: { type: 'text' } },\n      { name: 'lastName', operators: 'all', label: 'Last Name', input: {\n        type: 'select',\n        options: [\n          { value: 'Smith', name: 'Smith' },\n          { value: 'London', name: 'London' },\n        ] } },\n      { name: 'age', operators: 'all', label: 'Age',\n        input: {\n        type: 'select',\n        options: [\n          { value: '28', name: 'twenty eight' },\n          { value: '30', name: 'thirty' },\n        ] } },\n      { name: 'birthDate', operators: 'all', label: 'Birth date', input: { type: 'text' } },\n    ];\n\n    class App extends Component {\n\n        handleChange(event) {\n          console.log('query', event.query);\n        }\n\n        render() {\n            return (\n                 \u003cTwoWayQuerybuilder config={config} fields={changedFields} onChange={this.handleChange} /\u003e\n            );\n        }\n    }\n\n    export default App;\n  ```\n- **custom styles**\n  ```\n    import React, { Component } from 'react';\n    import TwoWayQuerybuilder from 'react-two-way-querybuilder';;\n\n    const fields = [\n      { name: 'firstName', operators: 'all', label: 'First Name', input: { type: 'text' } },\n      { name: 'lastName', operators: 'all', label: 'Last Name', input: { type: 'text' } },\n      { name: 'age', operators: 'all', label: 'Age', input: { type: 'text' } },\n      { name: 'birthDate', operators: 'all', label: 'Birth date', input: { type: 'text' } },\n    ];\n\n    const styles = {\n      primaryBtn: 'customPrimaryBtn',\n      deleteBtn: 'customDeleteBtn',\n      rule: 'rule',\n      condition: 'condition',\n      select: 'querySelect',\n      input: 'queryInput',\n      txtArea: 'queryText',\n    };\n\n    const changedStyles = {\n      styles,\n    };\n\n    class App extends Component {\n\n        handleChange(event) {\n          console.log('query', event.query);\n        }\n\n        render() {\n            return (\n                 \u003cTwoWayQuerybuilder config={changedStyles} fields={fields} onChange={this.handleChange} /\u003e\n            );\n        }\n    }\n\n    export default App;\n  ```\n- **validation**\n  ```\n    import React, { Component } from 'react';\n    import TwoWayQuerybuilder from 'react-two-way-querybuilder';;\n\n    const validationFields = [\n      { name: 'firstName', operators: 'all', label: 'First Name', input: { \n        type: 'text', errorText: 'Only letters allowed', pattern: new RegExp(\"[a-z]+\", \"gi\") } },\n      { name: 'lastName', operators: 'all', label: 'Last Name', input: {\n        type: 'text', errorText: 'Only letters allowed', pattern: new RegExp(\"[a-z]+\", \"gi\") } },\n      { name: 'age', operators: 'all', label: 'Age', input: {\n        type: 'text', errorText: 'Only nubmers allowed', pattern: new RegExp('[0-9]+', 'gi') } },\n      { name: 'birthDate', operators: 'all', label: 'Birth date', input: { \n        type: 'text', errorText: 'Only nubmers allowed', pattern: new RegExp('[0-9]+', 'gi') }\n      },\n];\n\n    class App extends Component {\n\n        handleChange(event) {\n          console.log('query', event.query);\n        }\n\n        render() {\n            return (\n                 \u003cTwoWayQuerybuilder fields={validationFields} onChange={this.handleChange} /\u003e\n            );\n        }\n    }\n\n    export default App;\n  ```\n\n##License\n\nReact-two-way-quierybuidler is MIT licensed\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLefortov%2Freact-two-way-querybuilder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLefortov%2Freact-two-way-querybuilder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLefortov%2Freact-two-way-querybuilder/lists"}