# donejs-select

> Knockoutjs-style select for donejs

Latest version **1.1.1** (published 2017-01-21) · 0 weekly downloads

## Install

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

## 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.1.1 |
| Published | 2017-01-21 |
| First published | 2017-01-19 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+6 in 2 direct dependencies) |
| Install scripts | no |
| Author | Nico Riesco |
| Maintainers | riesco |

## Links

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

## Dependencies (4)

- [can](https://npm.io/package/can.md) ^2.3.16
- [cssify](https://npm.io/package/cssify.md) ^0.6.0
- [jquery](https://npm.io/package/jquery.md) ~2.2.1
- [bootstrap](https://npm.io/package/bootstrap.md) ^3.3.7

## Recent versions

- 1.1.1 (latest) — 2017-01-21
- 1.1.0 — 2017-01-19
- 1.0.0 — 2017-01-19
- 0.0.0 — 2017-01-19

## README

# donejs-select

Knockoutjs-style select for donejs

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

[http://knockoutjs.com/documentation/options-binding.html](http://knockoutjs.com/documentation/options-binding.html)

## How to use it

1. install it in your project `npm install donejs-select --save`
1. import it in your stache file `<can-import from="donejs-select/" />`
1. finally insert it including the options, example:

```
<donejs-select 
	{(options)}=optionsArrayOfObject 
	{(selected-element-value)}=yourOwnVariable
	debug=true
	options-caption="choose an element:"
  options-caption-separator=true
  options-caption-separator-text="//////////"
	options-text="text" 
	options-value="value"
/>
```

NOTE: optionsArrayOfObject must be an array of objects

Assume you have:

`[{text: "hello", value: 1}, {text: "good bye", value: 999}]`

then the select will show "hello" and "good bye" and the selected value will be either 1 or 999

## How to test it

1. `npm test`
1. or http://localhost:8100/test/test.html
1. or http://localhost:8100/src/donejs-select.html

---

## Usage

### ES6 use

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

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

### CommonJS use

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

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

## AMD use

Configure the `can` and `jquery` paths and the `donejs-select` 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-select',
		    	location: 'node_modules/donejs-select/dist/amd',
		    	main: 'lib/donejs-select'
	    }]
	});
	require(["main-amd"], function(){});
</script>
```

### Standalone use

Load the `global` version of the plugin:

```html
<script src='./node_modules/donejs-select/dist/global/donejs-select.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-select · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
