Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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