1.1.6 • Published 5 years ago

joy-query-box v1.1.6

Weekly downloads
7
License
MIT
Repository
github
Last release
5 years ago

joy-query-box

A react-text-box component which will transform simple expression as free-text to object Example

Operators

OperatorsMeaningProperty Name
=/equalEqual$eq
>Greater than$gt
>=Greater than or equal$gte
<Less than$lt
<=Less than or equal$lte
likeLike$like
containsContains$contains
startwithStartWith$startWith
&And$and
|Or$or

Features

  • Syntax highlight
  • Auto-complete on typing
  • Result as object.
  • Speech to text (ex. quantity greater than or equal 18)

Next update

  • Support more operators is, in, between (1.1.x)
  • Filter completions operator based on primary types: number, date, string (1.1.x)
  • Filter completions based on a variable name & it's options (1.2.x)
  • Support complex expression (1.3.x)

NPM Install & use

npm i joy-query-box
import QueryBox from 'joy-query-box';
...
const suggessionwords = [
    {
        word: 'company',
        desc: 'Field: company name'
    },
    {
        word: 'email',
        desc: 'Field: Company Email'
    },
    {
        word: 'vat',
        desc: 'Field: Company VAT number'
    }
];

<QueryBox
    words={suggessionwords}
    onSearch={this.handleOnSeach}
    queryText={"defaultText = 'a text value'"}
/>

Run demo

$ git clone https://github.com/TamVoMinh/joy-query-box.git
$ cd joy-query-box 
$ npm install
$ yarn start

Build component

yarn build:component

Note

joy-query-box use bootstrap as default style.

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago