bare-select
Advanced tools
Comparing version 0.1.0 to 1.0.0
@@ -12,3 +12,3 @@ var keyCodes = require('../utils/keyCodes'); | ||
* | ||
* @module {Function} bare-select/plugins/keyboardNavigation | ||
* @module {Function} bare-select/plugins/keyboardNavigation | ||
* | ||
@@ -15,0 +15,0 @@ * @returns {pluginMaker} keyboardNavigationPlugin |
@@ -6,3 +6,3 @@ var requestFrame = require('micro-raf'); | ||
* | ||
* @module {Function} bare-select/plugins/mouseNavigation | ||
* @module {Function} bare-select/plugins/mouseNavigation | ||
* | ||
@@ -9,0 +9,0 @@ * @returns {pluginMaker} mouseNavigationPlugin |
@@ -10,3 +10,3 @@ var error = require('1-liners/curry')(require('../utils/error'))({ | ||
* | ||
* @module {Function} bare-select/plugins/unfolded | ||
* @module {Function} bare-select/plugins/unfolded | ||
* | ||
@@ -13,0 +13,0 @@ * @returns {pluginMaker} unfoldedPlugin |
@@ -8,3 +8,3 @@ var arrayFrom = require('array-from'); | ||
* | ||
* @module {Function} bare-select/plugins/updateCaption | ||
* @module {Function} bare-select/plugins/updateCaption | ||
* | ||
@@ -11,0 +11,0 @@ * @returns {pluginMaker} updateCaptionPlugin |
@@ -9,3 +9,3 @@ var error = require('./value/error'); | ||
* | ||
* @module {Function} bare-select/plugins/value | ||
* @module {Function} bare-select/plugins/value | ||
* | ||
@@ -12,0 +12,0 @@ * @returns {pluginMaker} valuePlugin |
@@ -29,3 +29,3 @@ require('es6-set/implement'); | ||
* | ||
* @param {Object} options | ||
* @param {Object} [options={}] | ||
* @param {Object} [options.selectors={}] | ||
@@ -126,2 +126,4 @@ * @param {String} | ||
var optionsSnapshot; | ||
/** | ||
@@ -245,3 +247,2 @@ * The dropdown should be folded or unfolded. | ||
*/ | ||
var optionsSnapshot; | ||
if (optionsQuery.error) throwError(optionsQuery.error); | ||
@@ -248,0 +249,0 @@ else { |
@@ -24,15 +24,17 @@ var arrayFrom = require('array-from'); | ||
if (!options.every( | ||
function(option, index) { | ||
var radio = option.querySelector(selectors.optionRadio); | ||
var label = option.querySelector(selectors.optionLabel); | ||
if (!radio || !label) return false; | ||
var atLeastOneOptionValid = false; | ||
values[index] = radio.value; | ||
radioNodes[index] = radio; | ||
labelNodes[index] = label; | ||
return true; | ||
} | ||
)) return {error: error( | ||
'Wrong markup within options. Make sure every option (`' + | ||
options.forEach(function(option, index) { | ||
var radio = option.querySelector(selectors.optionRadio); | ||
var label = option.querySelector(selectors.optionLabel); | ||
if (!radio || !label) return; | ||
atLeastOneOptionValid = true; | ||
values[index] = radio.value; | ||
radioNodes[index] = radio; | ||
labelNodes[index] = label; | ||
}); | ||
if (!atLeastOneOptionValid) return {error: error( | ||
'Wrong markup within options. Make at least one of the options (`' + | ||
selectors.option + | ||
@@ -39,0 +41,0 @@ '`) has a radio button matching the selector `' + |
159
package.json
@@ -1,81 +0,82 @@ | ||
{ "name": "bare-select" | ||
, "version": "0.1.0" | ||
, "description": "The lean alternative to <select>." | ||
, "homepage": "https://studio-b12.github.io/bare-select" | ||
, "dependencies": | ||
{ "1-liners": "^0.3.5" | ||
, "array-from": "^1.0.0" | ||
, "array-includes": "^2.0.0" | ||
, "as": "^0.4.1" | ||
, "es6-set": "^0.1.1" | ||
, "find-index": "^1.1.0" | ||
, "micro-raf": "^1.0.0" | ||
, "object-assign": "^3.0.0" | ||
, "reassemble-string": "^2.0.0" | ||
, "set-immediate-shim": "^1.0.1" | ||
, "shallow-diff": "^0.0.5" | ||
, "stereo": "^0.4.0" | ||
{ | ||
"name": "bare-select", | ||
"version": "1.0.0", | ||
"description": "The lean alternative to <select>.", | ||
"homepage": "https://studio-b12.github.io/bare-select", | ||
"dependencies": { | ||
"1-liners": "^0.4.0", | ||
"array-from": "^2.0.2", | ||
"array-includes": "^3.0.2", | ||
"as": "^0.4.1", | ||
"es6-set": "^0.1.1", | ||
"find-index": "^1.1.0", | ||
"micro-raf": "^1.0.0", | ||
"object-assign": "^4.0.1", | ||
"reassemble-string": "^2.0.0", | ||
"set-immediate-shim": "^1.0.1", | ||
"shallow-diff": "^0.0.5", | ||
"stereo": "^0.4.0" | ||
}, | ||
"scripts": { | ||
"clean-up": "git reset && echo '/node_modules/' > .gitignore && git add .gitignore && git stash save --include-untracked --keep-index '`npm run clean-up` trash can' && git clean --force -d && git reset --hard && echo '\nclean-up: All unstaged and ignored files within your git repo – except node_modules/* – have been moved to the stash. To restore them run `git stash pop --quiet; git checkout .gitignore`.'", | ||
"coveralls": "npm run coverage && cat coverage/lcov.info | coveralls", | ||
"coverage": "istanbul cover test.js", | ||
"build": "npm run --silent build:pack && npm run --silent build:minify", | ||
"build:minify": "echo 'Minifying…'; uglifyjs dist/bare-select.js --output dist/bare-select.min.js && uglifyjs dist/bare-select.drop-in.js --output dist/bare-select.drop-in.min.js && echo '…done!'", | ||
"build:pack": "npm run build:pack-library && npm run build:pack-drop-in", | ||
"build:pack-drop-in": "webpack --devtool=source-map bare-select.drop-in.js dist/bare-select.drop-in.js", | ||
"build:pack-library": "webpack --devtool=source-map bare-select.js dist/bare-select.js --output-library bareSelect", | ||
"develop": "nodangel --ignore node_modules --ignore coverage --exec 'npm run --silent test:lite'", | ||
"docs": "polydox --raw module/*.js module/*/*.js module/*/*/*.js | doxie --filter --render --inject as public", | ||
"ensure-clean-repo": "if [ -n \"$(git status --porcelain)\" ]; then echo 'Ooops-a-daisy! Make sure the repo is clean.'; exit 1; fi", | ||
"prepublish": "npm run clean-up && npm run build", | ||
"test": "jshint . && npm run test:lite", | ||
"test:lite": "node test.js | tap-spec", | ||
"update-demo": "npm run ensure-clean-repo && npm run build && git checkout gh-pages && cpy dist/bare-select.drop-in.min.js . && git add .; git status", | ||
"view-coverage": "echo 'Generating coverage reports...'; npm run coverage >/dev/null && echo '...done.' && xdg-open ./coverage/lcov-report/index.html >/dev/null" | ||
}, | ||
"devDependencies": { | ||
"async": "^1.5.2", | ||
"camelize-identifier": "1.0.0", | ||
"coveralls": "^2.11.8", | ||
"cpy": "^4.0.0", | ||
"doxie": "^0.2.4", | ||
"doxie.filter": "0.4.1", | ||
"doxie.inject": "0.1.1", | ||
"doxie.render": "^0.3.2", | ||
"es6-weak-map": "^2.0.1", | ||
"is-subset": "0.1.1", | ||
"istanbul": "^0.4.2", | ||
"jsdom": "^8.1.0", | ||
"jshint": "^2.9.1", | ||
"nodangel": "1.3.8", | ||
"node-libs-browser": "^1.0.0", | ||
"polydox": "0.1.0", | ||
"repeat-element": "1.1.2", | ||
"tap-spec": "2.2.2", | ||
"tape-catch": "1.0.4", | ||
"uglify-js": "^2.6.2", | ||
"virtual-dom": "^2.1.1", | ||
"webpack": "^1.12.14" | ||
}, | ||
"main": "bare-select.js", | ||
"files": [ | ||
"/*.js", | ||
"!/test.js", | ||
"/module/", | ||
"/dist/", | ||
"/Readme.md", | ||
"/License.md" | ||
], | ||
"license": "MIT", | ||
"keywords": [ | ||
"…" | ||
], | ||
"contributors": [ | ||
"Tomek Wiszniewski <t.wiszniewski@gmail.com>" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git@github.com:studio-b12/bare-select.git" | ||
} | ||
, "scripts": | ||
{ "clean-up": "git reset && echo '/node_modules/' > .gitignore && git add .gitignore && git stash save --include-untracked --keep-index '`npm run clean-up` trash can' && git clean --force -d && git reset --hard && echo '\nclean-up: All unstaged and ignored files within your git repo – except node_modules/* – have been moved to the stash. To restore them run `git stash pop --quiet; git checkout .gitignore`.'" | ||
, "coveralls": "npm run coverage && cat coverage/lcov.info | coveralls" | ||
, "coverage": "istanbul cover test.js" | ||
, "build": "npm run --silent build:pack && npm run --silent build:minify" | ||
, "build:minify": "echo 'Minifying…'; uglifyjs dist/bare-select.js --output dist/bare-select.min.js && uglifyjs dist/bare-select.drop-in.js --output dist/bare-select.drop-in.min.js && echo '…done!'" | ||
, "build:pack": "npm run build:pack-library && npm run build:pack-drop-in" | ||
, "build:pack-drop-in": "webpack --devtool=source-map bare-select.drop-in.js dist/bare-select.drop-in.js" | ||
, "build:pack-library": "webpack --devtool=source-map bare-select.js dist/bare-select.js --output-library bareSelect" | ||
, "develop": "nodangel --ignore node_modules --ignore coverage --exec 'npm run --silent test:lite'" | ||
, "docs": "polydox --raw module/*.js module/*/*.js module/*/*/*.js | doxie --filter --render --inject as public" | ||
, "ensure-clean-repo": "if [ -n \"$(git status --porcelain)\" ]; then echo 'Ooops-a-daisy! Make sure the repo is clean.'; exit 1; fi" | ||
, "prepublish": "npm run clean-up && npm run build" | ||
, "test": "jshint . && npm run test:lite" | ||
, "test:lite": "node test.js | tap-spec" | ||
, "update-demo": "npm run ensure-clean-repo && npm run build && git checkout gh-pages && cpy dist/bare-select.drop-in.min.js . && git add .; git status" | ||
, "view-coverage": "echo 'Generating coverage reports...'; npm run coverage >/dev/null && echo '...done.' && xdg-open ./coverage/lcov-report/index.html >/dev/null" | ||
} | ||
, "devDependencies": | ||
{ "async": "1.3.0" | ||
, "camelize-identifier": "1.0.0" | ||
, "coveralls": "2.11.2" | ||
, "cpy": "3.3.1" | ||
, "doxie": "0.2.2" | ||
, "doxie.filter": "0.4.1" | ||
, "doxie.inject": "0.1.1" | ||
, "doxie.render": "0.3.0" | ||
, "es6-weak-map": "1.0.2" | ||
, "is-subset": "0.1.1" | ||
, "istanbul": "0.3.17" | ||
, "jsdom": "3.1.2" | ||
, "jshint": "2.8.0" | ||
, "nodangel": "1.3.8" | ||
, "node-libs-browser": "0.5.2" | ||
, "polydox": "0.1.0" | ||
, "repeat-element": "1.1.2" | ||
, "tap-spec": "2.2.2" | ||
, "tape-catch": "1.0.4" | ||
, "uglify-js": "2.4.23" | ||
, "virtual-dom": "2.0.1" | ||
, "webpack": "1.10.1" | ||
} | ||
, "main": "bare-select.js" | ||
, "files": | ||
[ "/*.js" | ||
, "!/test.js" | ||
, "/module/" | ||
, "/dist/" | ||
, "/Readme.md" | ||
, "/License.md" | ||
] | ||
, "license": "MIT" | ||
, "keywords": | ||
[ "…" | ||
] | ||
, "contributors": | ||
[ "Tomek Wiszniewski <t.wiszniewski@gmail.com>" | ||
] | ||
, "repository": | ||
{ "type": "git" | ||
, "url": "git@github.com:studio-b12/bare-select.git" | ||
} | ||
} |
[![Coveralls – test coverage | ||
](https://img.shields.io/coveralls/studio-b12/bare-select.svg?style=flat-square) | ||
](https://coveralls.io/r/studio-b12/bare-select) | ||
[![Travis – build status | ||
](https://img.shields.io/travis/studio-b12/bare-select/master.svg?style=flat-square) | ||
](https://travis-ci.org/studio-b12/bare-select) | ||
[![David – status of dependencies | ||
](https://img.shields.io/david/studio-b12/bare-select.svg?style=flat-square) | ||
](https://david-dm.org/studio-b12/bare-select) | ||
[![Code style: airbnb | ||
](https://img.shields.io/badge/code%20style-airbnb-blue.svg?style=flat-square) | ||
](https://img.shields.io/coveralls/studio-b12/bare-select.svg?style=flat-square | ||
)](https://coveralls.io/r/studio-b12/bare-select | ||
) [![Travis – build status | ||
](https://img.shields.io/travis/studio-b12/bare-select/master.svg?style=flat-square | ||
)](https://travis-ci.org/studio-b12/bare-select | ||
) [![David – status of dependencies | ||
](https://img.shields.io/david/studio-b12/bare-select.svg?style=flat-square | ||
)](https://david-dm.org/studio-b12/bare-select | ||
) [![Code style: airbnb | ||
](https://img.shields.io/badge/code%20style-airbnb-777777.svg?style=flat-square) | ||
](https://github.com/airbnb/javascript) | ||
[![Stability: unstable | ||
](https://img.shields.io/badge/stability-unstable-yellowgreen.svg?style=flat-square) | ||
](https://nodejs.org/api/documentation.html#documentation_stability_index) | ||
@@ -25,10 +22,13 @@ | ||
* Dead easy to style. Just match it to your design. | ||
* Pretty and usable without JavaScript. Usable even without CSS. | ||
* Mimicks the native `<select>`. Keyboard navigation included. | ||
* Event-driven and plugin-based. Hackable from head to toe. | ||
* Dead easy to style. That’s the whole point. | ||
* Great keyboard navigation. | ||
* Drop-in usage. As easy as `<bare-select></bare-select>`. | ||
* Pretty without JavaScript. Usable without CSS. | ||
* [FIRST][]. Hackable from head to toe. | ||
[FIRST]: http://addyosmani.com/first/ | ||
Using a bundler? | ||
@@ -43,3 +43,3 @@ ---------------- | ||
You’ll likely be fine with the default settings. Just execute this to register the `<bare-select>`: | ||
You’ll most likely be fine with the default settings. Just execute this to register the `<bare-select>`: | ||
@@ -61,3 +61,3 @@ ```js | ||
```html | ||
<script src="path/to/bare-select.drop-in.min.js"></script> | ||
<script src="path/to/bare-select.drop-in.min.js"></script> | ||
``` | ||
@@ -207,3 +207,3 @@ | ||
* **`options`** | ||
<sup>type: `Object` | required</sup> | ||
<sup>type: `Object` | default: `{}` | optional</sup> | ||
@@ -210,0 +210,0 @@ * **`options.selectors`** |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
855494
10053
1
+ Added1-liners@0.4.2(transitive)
+ Addedarray-from@2.1.1(transitive)
+ Addedarray-includes@3.1.8(transitive)
+ Addedcall-bind-apply-helpers@1.0.2(transitive)
+ Addedobject-assign@4.1.1(transitive)
- Removed1-liners@0.3.6(transitive)
- Removedarray-from@1.0.0(transitive)
- Removedarray-includes@2.0.0(transitive)
- Removedcall-bind-apply-helpers@1.0.1(transitive)
- Removedobject-assign@3.0.0(transitive)
Updated1-liners@^0.4.0
Updatedarray-from@^2.0.2
Updatedarray-includes@^3.0.2
Updatedobject-assign@^4.0.1