# filter-editor-view

> Atom filter editor view

Latest version **1.0.6** (published 2016-03-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install filter-editor-view
pnpm add filter-editor-view
yarn add filter-editor-view
bun add filter-editor-view
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2016-03-17 |
| First published | 2016-02-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Charles Wei |
| Maintainers | javacs3 |
| Keywords | atom, filter |

## Links

- npm: https://www.npmjs.com/package/filter-editor-view
- Repository: https://github.com/JavaCS3/filter-editor-view
- Issues: https://github.com/JavaCS3/filter-editor-view/issues
- npm.io page: https://npm.io/package/filter-editor-view

## Dependencies (1)

- [jquery](https://npm.io/package/jquery.md) >2.0.0

## Recent versions

- 1.0.6 (latest) — 2016-03-17
- 1.0.5 — 2016-03-05
- 1.0.4 — 2016-03-01
- 1.0.3 — 2016-02-29
- 1.0.2 — 2016-02-28
- 1.0.1 — 2016-02-27
- 1.0.0 — 2016-02-27
- 0.1.0 — 2016-02-25

## README

# filter-editor-view package

A filter text editor that allow you to filter keywords by the input.

# Screenshot

![A screenshot of your package](http://i.imgur.com/wXYmY8V.png)

## Constructor Params
None (currently)

## Methods
### `::getElement()`
Returns the DOM element.

### `::getText()`
Returns the text of the `filter-editor-view`.

### `::setText(text)`
Set the text of the `filter-editor-view`.
 * `text` the text

### `::confirm()`
Confirm the text of the `filter-editor-view`.  
This will trigger the callback of the `::onConfirmed(callback)`

### `::cancel()`
Cancel the ongoing keywords filter timeout.

### `::onConfirmed(callback)`
Set the confirmed callback when confirming the input.
 * `callback(text)` the callback when confirming the input.
  * `text` the confirmed input text.

### `::onFilter(callback)`
Set the filter callback when beginning filter keywords.
 * `callback(token, text, cb)` the callback when beginning filter keywords.  
  ** the callback is Async **
  * `token` a string that represent the current filter session.
  * `text` the filter text.
  * `cb(token, result)` the callback the must be called when finished filter.
    * `token` the token of the filter session (Usually the token above).
    * `result` an array of the filtered keywords. Each item is a string (currently).

## Example
```coffee
@filterEditor = new FilterEditorView()

@filterEditor.onFilter (token, text, cb) ->
   setTimeout -> # represent an Async HTTP request
     cb(token, [text.toUpperCase()])
   , 1000

@filterEditor.onConfirmed (text) ->
  console.log "confirmed #{text}"

@root.appendChild(@filterEditor.getElement())


```

---
_Source: https://npm.io/package/filter-editor-view · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
