{"id":13422041,"url":"https://github.com/komarovalexander/react-filter-control","last_synced_at":"2025-03-15T10:31:37.237Z","repository":{"id":57333273,"uuid":"157028681","full_name":"komarovalexander/react-filter-control","owner":"komarovalexander","description":" The react UI component for building complex filter criteria","archived":false,"fork":false,"pushed_at":"2020-01-29T21:05:56.000Z","size":62,"stargazers_count":51,"open_issues_count":0,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-24T20:08:50.103Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/komarovalexander.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":"2018-11-10T22:52:27.000Z","updated_at":"2024-08-26T02:32:40.000Z","dependencies_parsed_at":"2022-08-24T21:02:07.219Z","dependency_job_id":null,"html_url":"https://github.com/komarovalexander/react-filter-control","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komarovalexander%2Freact-filter-control","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komarovalexander%2Freact-filter-control/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komarovalexander%2Freact-filter-control/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komarovalexander%2Freact-filter-control/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/komarovalexander","download_url":"https://codeload.github.com/komarovalexander/react-filter-control/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243719102,"owners_count":20336591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-07-30T23:00:35.962Z","updated_at":"2025-03-15T10:31:36.758Z","avatar_url":"https://github.com/komarovalexander.png","language":"JavaScript","funding_links":[],"categories":["UI Components","\u003csummary\u003eUI Components\u003c/summary\u003e"],"sub_categories":["Miscellaneous"],"readme":"[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/komarovalexander/react-filter-control/blob/master/LICENSE) [![Build Status](https://travis-ci.com/komarovalexander/react-filter-control.svg?branch=master)](https://travis-ci.com/komarovalexander/react-filter-control)\n[![Coverage Status](https://coveralls.io/repos/github/komarovalexander/react-filter-control/badge.svg?branch=master)](https://coveralls.io/github/komarovalexander/react-filter-control?branch=master)\n# React Filter Control\nThe React component for building the composite filter criteria\n\n[Demo (JS)](https://codesandbox.io/s/4xk994jovw)    |    [Demo (TS)](https://codesandbox.io/s/react-typescript-uhtxt)   \n\n[Together With Data Table](https://komarovalexander.github.io/ka-table/#/filter-extended)\n\n## Overview\n![Filter Control](https://github.com/komarovalexander/react-filter-control/raw/master/static/filter-control.png)\n\n## Installation\nnpm\n```sh\nnpm install react-filter-control\n```\nyarn\n```sh\nyarn add react-filter-control\n```\n\n## Usage\n### A basic example\n\n```js\nimport React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport FilterControl from \"react-filter-control\";\nimport { fields, filterValue } from \"./data.js\";\n\nconst handleFilterValueChange = filterValue =\u003e {\n  // ...\n};\n\nconst App = () =\u003e {\n  return (\n    \u003cFilterControl\n      filterValue={filterValue}\n      fields={fields}\n      onFilterValueChanged={handleFilterValueChange}\n    /\u003e\n  );\n};\n\nReactDOM.render(\u003cApp /\u003e, document.querySelector(\"#root\"));\n```\n\n[Open Example in CodeSandbox](https://codesandbox.io/s/mqnmlypmkp)\n\n## API\n\n\u003ca name=\"FilterControl\"\u003e\u003c/a\u003e\n### FilterControl\n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| fields | [\u003ccode\u003eArray.\u0026lt;Field\u0026gt;\u003c/code\u003e](#Field) | The fields settings |\n| filterValue | [\u003ccode\u003eFilterValue\u003c/code\u003e](#FilterValue) | The filterValue settings |\n| groups | [\u003ccode\u003eArray.\u0026lt;Group\u0026gt;\u003c/code\u003e](#Group) | The groups settings |\n| onFilterValueChanged | \u003ccode\u003eevent\u003c/code\u003e | The filter value changed handler |\n\n\u003ca name=\"FilterValue\"\u003e\u003c/a\u003e\n\n### FilterValue : \u003ccode\u003eObject\u003c/code\u003e\n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| groupName | \u003ccode\u003estring\u003c/code\u003e | Group name |\n| items | \u003ccode\u003eArray.\u0026lt;(FilterValueGroup\\|FilterValueItem)\u0026gt;\u003c/code\u003e | Items in group |\n\n\u003ca name=\"FilterValueGroup\"\u003e\u003c/a\u003e\n\n### FilterValueGroup : \u003ccode\u003eObject\u003c/code\u003e\n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| key | \u003ccode\u003ekey\u003c/code\u003e | Item key |\n| groupName | \u003ccode\u003estring\u003c/code\u003e | Group name |\n| items | \u003ccode\u003eArray.\u0026lt;(FilterValueGroup\\|FilterValueItem)\u0026gt;\u003c/code\u003e | Items in group |\n\n\u003ca name=\"FilterValueItem\"\u003e\u003c/a\u003e\n\n### FilterValueItem : \u003ccode\u003eObject\u003c/code\u003e\n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| key | \u003ccode\u003ekey\u003c/code\u003e | Item key |\n| field | \u003ccode\u003estring\u003c/code\u003e | Field |\n| operator | \u003ccode\u003estring\u003c/code\u003e | Operator |\n| value | \u003ccode\u003eany\u003c/code\u003e | Value |\n\n\u003ca name=\"Field\"\u003e\u003c/a\u003e\n\n### Field : \u003ccode\u003eObject\u003c/code\u003e\n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| name | \u003ccode\u003estring\u003c/code\u003e | Field name |\n| caption | \u003ccode\u003estring\u003c/code\u003e | Field caption |\n| operators | [\u003ccode\u003eArray.\u0026lt;Operator\u0026gt;\u003c/code\u003e](#Operator) | Field operators |\n\n\u003ca name=\"Group\"\u003e\u003c/a\u003e\n\n### Group : \u003ccode\u003eObject\u003c/code\u003e\n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| name | \u003ccode\u003estring\u003c/code\u003e | Group name |\n| caption | \u003ccode\u003estring\u003c/code\u003e | Group caption |\n\n\u003ca name=\"Operator\"\u003e\u003c/a\u003e\n\n### Operator : \u003ccode\u003eObject\u003c/code\u003e\n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| name | \u003ccode\u003estring\u003c/code\u003e | Operator name |\n| caption | \u003ccode\u003estring\u003c/code\u003e | Operator caption |\n\n## License\nThis project is licensed under the terms of the [MIT license](/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkomarovalexander%2Freact-filter-control","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkomarovalexander%2Freact-filter-control","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkomarovalexander%2Freact-filter-control/lists"}