fancy-select
Advanced tools
Comparing version 0.8.1 to 1.0.0
12
index.js
@@ -12,2 +12,6 @@ var mercury = require('mercury') | ||
FancySelect.render = render.default | ||
FancySelect.customRender = render.custom | ||
module.exports = FancySelect | ||
@@ -92,5 +96,2 @@ | ||
return { | ||
render: function (state) { | ||
return render(data.templates, state) | ||
}, | ||
state: state, | ||
@@ -102,7 +103,4 @@ | ||
setActions: tree.setActions, | ||
setQuery: tree.setQuery, | ||
setTemplates: function (templates) { | ||
data.templates = templates | ||
} | ||
setQuery: tree.setQuery | ||
} | ||
} |
{ | ||
"name": "fancy-select", | ||
"description": "a unidirectional combobox component based on the aria spec", | ||
"version": "0.8.1", | ||
"version": "1.0.0", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "url": "nrw/fancy-select" |
@@ -28,3 +28,3 @@ # fancy-select [![build status](https://secure.travis-ci.org/nrw/fancy-select.png)](http://travis-ci.org/nrw/fancy-select) | ||
mercury.app(document.body, component.state, component.render) | ||
mercury.app(document.body, component.state, FancySelect.render) | ||
``` | ||
@@ -49,3 +49,3 @@ | ||
### component.render | ||
### FancySelect.render | ||
@@ -63,4 +63,7 @@ The render function to be passed to a `main-loop` or placed into another template. | ||
- `component.setQuery(query)` | ||
- `component.setTemplates(templates)` | ||
To create a custom render function, call FancySelect.customRender(templates) | ||
- `var render = FancySelect.customRender(templates)` | ||
### config.options = [] | ||
@@ -92,3 +95,3 @@ | ||
### config.templates = {} | ||
### templates = {} | ||
@@ -110,2 +113,4 @@ A hash of template names to render functions. The tree of default templates is nested in this order with these names: | ||
```js | ||
var h = require('virtual-hyperscript') | ||
var templates = { | ||
@@ -121,2 +126,4 @@ option: function (state, template, option, path) { | ||
} | ||
var render = FancySelect.customRender(templates) | ||
``` | ||
@@ -123,0 +130,0 @@ |
@@ -11,9 +11,15 @@ var fs = require('fs') | ||
module.exports = render | ||
module.exports = { | ||
custom: custom, | ||
'default': render.bind(null, {}) | ||
} | ||
function render (overrides, state) { | ||
var temp = template.bind(null, state) | ||
return template(overrides, state, 'combobox') | ||
} | ||
function custom (overrides) { | ||
return render.bind(null, overrides) | ||
} | ||
function template (overrides, state, name) { | ||
@@ -20,0 +26,0 @@ var temp = overrides && overrides[name] ? |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
17237
353
1
136