# d-input

> Input elements for derby.

Latest version **0.0.10** (published 2015-05-16) · 0 weekly downloads

## Install

```sh
npm install d-input
pnpm add d-input
yarn add d-input
bun add d-input
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.10 |
| Published | 2015-05-16 |
| First published | 2015-02-18 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Rui Gonçalves |
| Maintainers | ruimgoncalves |

## Links

- npm: https://www.npmjs.com/package/d-input
- Repository: https://github.com/ruimgoncalves/d-inputex
- Issues: https://github.com/ruimgoncalves/d-inputex/issues
- npm.io page: https://npm.io/package/d-input

## Recent versions

- 0.0.10 (latest) — 2015-05-16
- 0.0.9 — 2015-03-18
- 0.0.8 — 2015-02-24
- 0.0.7 — 2015-02-24
- 0.0.6 — 2015-02-23
- 0.0.5 — 2015-02-23
- 0.0.4 — 2015-02-21
- 0.0.3 — 2015-02-19
- 0.0.2 — 2015-02-18

## README

# D-Input

Derby input elements "emits" changes on every keystroke. This is great in some cases, but not so great for others.

This input elements will throttle changes until a timeout, enter key or a blur event is detected.

A done event is emitted every time the server responds to the changes so here is a good place to put your validation code. Use the ```on-done="func()"``` attribute, func will receive the following parameters.
- element - the input element being referenced
- error - the error object
- op - the result from the server.

See the example below for details.

The input element has some built in classes.
- **onError** : is added when an error occurs.
- **sending** : when values are being sended to the server.

###Install
```sh
$ npm i d-input --save
```

###Usage

index.html
``` html5
<!-- Set timeout to 5 seconds -->
<inputex type="text" name="test1" value="{{value}}" timeout="5000" />
<!-- Use a callback when value changes -->
<textareaex type="text" name="test2" value="{{value}}" on-done="inputDone()" />
```


index.coffee
``` coffeescript
app.use require('d-input')

app.proto.inpuDone = (elm, err, op)->
  if err
    elm.setCustomValidity err.errors[0].message
  else
    elm.setCustomValidity ""
```

##Notes
  - **textareaex** components must supply a value attribute. `<textareaex>{{value}}</textareaex>` is not supported.
  - default **timeout** is 2 seconds
  - disable **timeout** by setting it to 0

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