# donejs-typeahead

> Bootstrap typeahead for donejs

Latest version **0.6.0** (published 2016-12-09) · 0 weekly downloads

## Install

```sh
npm install donejs-typeahead
pnpm add donejs-typeahead
yarn add donejs-typeahead
bun add donejs-typeahead
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.6.0 |
| Published | 2016-12-09 |
| First published | 2016-11-14 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 20 |
| Known vulnerabilities | 0 (+14 in 3 direct dependencies) |
| Install scripts | no |
| Author | Nicolas Riesco |
| Maintainers | riesco |

## Links

- npm: https://www.npmjs.com/package/donejs-typeahead
- Repository: https://github.com/riescorp/donejs-typeahead
- Homepage: https://github.com/riescorp/donejs-typeahead#readme
- Issues: https://github.com/riescorp/donejs-typeahead/issues
- npm.io page: https://npm.io/package/donejs-typeahead

## Dependencies (20)

- [can](https://npm.io/package/can.md) ^2.3.16
- [steal](https://npm.io/package/steal.md) ^0.16.0
- [jquery](https://npm.io/package/jquery.md) ~2.2.1
- [can-zone](https://npm.io/package/can-zone.md) ^0.5.0
- [done-css](https://npm.io/package/done-css.md) ~2.0.2
- [funcunit](https://npm.io/package/funcunit.md) ^3.1.0
- [bootstrap](https://npm.io/package/bootstrap.md) ^3.3.7
- [done-serve](https://npm.io/package/done-serve.md) ^0.2.0
- [handlebars](https://npm.io/package/handlebars.md) ^4.0.5
- [can-connect](https://npm.io/package/can-connect.md) ^0.5.0
- [font-awesome](https://npm.io/package/font-awesome.md) ^4.6.3
- [done-component](https://npm.io/package/done-component.md) ^0.4.0
- [steal-platform](https://npm.io/package/steal-platform.md) 0.0.4
- [done-autorender](https://npm.io/package/done-autorender.md) ^0.8.0
- [generator-donejs](https://npm.io/package/generator-donejs.md) ^0.9.0
- [can-connect-feathers](https://npm.io/package/can-connect-feathers.md) ^1.1.7
- [jquery-transport-xdr](https://npm.io/package/jquery-transport-xdr.md) ^1.0.11
- [twitter-typeahead-components-bundle](https://npm.io/package/twitter-typeahead-components-bundle.md) ^1.0.3
- [twitter-typeahead-components-handlebars](https://npm.io/package/twitter-typeahead-components-handlebars.md) ^1.0.3
- [twitter-typeahead-components-xdomainrequest](https://npm.io/package/twitter-typeahead-components-xdomainrequest.md) ^1.0.3

## Recent versions

- 0.6.0 (latest) — 2016-12-09
- 0.5.0 — 2016-12-07
- 0.3.0 — 2016-11-19
- 0.2.1 — 2016-11-19
- 0.1.0 — 2016-11-14
- 0.0.6 — 2016-11-14
- 0.0.5 — 2016-11-14
- 0.0.4 — 2016-11-14
- 0.0.3 — 2016-11-14
- 0.0.1 — 2016-11-14

## README

# Bootstrap typeahead for donejs

[![Build Status](https://circleci.com/gh/riescorp/donejs-typeahead.png?style=shield)](https://circleci.com/gh/riescorp/donejs-typeahead)


## Usage (donejs)

### Install / Configure

1. `npm install donejs-typeahead --save`
1. import it within your stache file, for instance index.stache
`<can-import from="donejs-typeahead/" />`
1. insert it using the options you need

	```
	<donejs-typeahead
      debug=true 
      remote-path="/developers" 
      suggestion-template='<div class="donejs-typeahead-suggestion donejs-typeahead-selectable"><span class="test-1">[[name]]</span> / [[github]]</div>' 
      display-value="name" 
      search-value="github" 
      remote-host="donejs-typeahead-backend-zqqnzgjjre.now.sh" 
      remote-protocol="https://"  
      remote-port="443"
      {(selected-element-value)}="global-variable"/>
```
1. You'll need an API server (@todo: provide a step by step guide for this, probably using feathersjs)
1. You can use `debug=true` to make things easier (actually setting debug to any value will do it)
1. Set the correct name for `your-variable` in order to create a two way binding with your viewmodel. If you want to set the binding using an object use `{(selected-element-object)}="your-variable"`

Remember to start the server using `donejs develop`

### Try it

[http://localhost:8080/src/donejs-typeahead.html](http://localhost:8080/src/donejs-typeahead.html)


### Test it
1. You can either run the tests: [http://localhost:8080/test/test.html](http://localhost:8080/test/test.html)
1. or run the automated tests (no need to start the server)

## Typeahead

- Typeahead project: [http://twitter.github.io/typeahead.js](http://twitter.github.io/typeahead.js)
- Typeahead project samples: [http://twitter.github.io/typeahead.js/examples/](http://twitter.github.io/typeahead.js/examples/)




## Usage (dist)

### ES6 use

With StealJS, you can import this module directly in a template that is autorendered:

```js
import plugin from 'donejs-typeahead';
```

### CommonJS use

Use `require` to load `donejs-typeahead` and everything else
needed to create a template that uses `donejs-typeahead`:

```js
var plugin = require("donejs-typeahead");
```

## AMD use

Configure the `can` and `jquery` paths and the `donejs-typeahead` package:

```html
<script src="require.js"></script>
<script>
	require.config({
	    paths: {
	        "jquery": "node_modules/jquery/dist/jquery",
	        "can": "node_modules/canjs/dist/amd/can"
	    },
	    packages: [{
		    	name: 'donejs-typeahead',
		    	location: 'node_modules/donejs-typeahead/dist/amd',
		    	main: 'lib/donejs-typeahead'
	    }]
	});
	require(["main-amd"], function(){});
</script>
```

### Standalone use

Load the `global` version of the plugin:

```html
<script src='./node_modules/donejs-typeahead/dist/global/donejs-typeahead.js'></script>
```

## Contributing

### Making a Build

To make a build of the distributables into `dist/` in the cloned repository run

```
npm install
node build
```

### Running the tests

Tests can run in the browser by opening a webserver and visiting the `test.html` page.
Automated tests that run the tests from the command line in Firefox can be run with

```
npm test
```

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