https://github.com/kvnol/input-filter
A tiny library for filtering content based in the input value.
https://github.com/kvnol/input-filter
filter javascript tiny-library
Last synced: about 1 year ago
JSON representation
A tiny library for filtering content based in the input value.
- Host: GitHub
- URL: https://github.com/kvnol/input-filter
- Owner: kvnol
- License: mit
- Created: 2018-03-03T16:16:44.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-05T17:46:44.000Z (about 8 years ago)
- Last Synced: 2023-03-07T04:47:55.035Z (about 3 years ago)
- Topics: filter, javascript, tiny-library
- Language: JavaScript
- Homepage:
- Size: 19.5 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Input Filter
A tiny library for filtering content based in the input value.
## Sumary
- [Configuration](#configuration)
- [Select filter](#select-filter)
- [Options](#options)
- [hasSiblings](#hassiblings)
- [TODO](#to-do)
- [License](#license)
## Configuration
### Select filter
Configure the select filter using `[data-type="select"]` on the `` tag:
```html
Filter
Red
Green
Blue
```
And the items that will be filtered with `data-type="filter-item"` and `data-value=""`:
```html
```
Initialize the filter call the `filter` function:
```javascript
filter('[data-type="select"]', false);
```
#### [View the example here](https://codepen.io/kvnol/pen/vdqYYE)
## Options
The input filter has some options:
#### hasSiblings
The `hasSiblings` is a boolean option to filter with more than one ``.
```javascript
filter('[data-type="select"]', hasSiblings);
```
## TODO
- [x] Create filter for select input
- [ ] Create filter for text input
- [ ] Remove libDOM dependency
- [ ] Publish on NPM
## License
Kevin Oliveira © MIT