Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thipages/jca-filter
Facilitates filters creation for JS-CRUD-API
https://github.com/thipages/jca-filter
filter helper js-crud-api php-crud-api
Last synced: 25 days ago
JSON representation
Facilitates filters creation for JS-CRUD-API
- Host: GitHub
- URL: https://github.com/thipages/jca-filter
- Owner: thipages
- License: mit
- Created: 2021-03-25T17:36:27.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-14T17:37:36.000Z (almost 2 years ago)
- Last Synced: 2024-12-05T15:17:58.774Z (about 1 month ago)
- Topics: filter, helper, js-crud-api, php-crud-api
- Language: JavaScript
- Homepage:
- Size: 19.5 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JCA-FILTER
Facilitate filters creation for [JS-CRUD-API](https://github.com/thipages/js-crud-api)
# Installation
- via npm : _npm i jca_filter_
```javascript
import jca_filter from 'jca_filter';
// then
jca_filter(logic,otherConditions={});```
- via HTML
```html// then
jca_filter(logic,otherConditions={});```
## Example```javascript
const conditions=jca_filter(
"('field1,eq,val1' OR 'field2,eq,val2') AND 'field3,eq,val3'",
{order:'field1'}
);
/**
* conditions content
*
* {
* filter: ["field1,eq,val1","field3,eq,val3"],
* filter1: ["field2,eq,val2","field3,eq,val3"],
* order: "field1"
* }
*
*/
```
[see live example](https://thipages.github.io/jca-filter/)
## LIMITATION
only OR and AND operators are available