Version 2.8.5

This commit is contained in:
Josh Johnson 2017-06-27 16:39:08 +01:00
parent 8485137121
commit 1eaceb1345
6 changed files with 31 additions and 18 deletions

View file

@ -1,4 +1,4 @@
/*! choices.js v2.8.4 | (c) 2017 Josh Johnson | https://github.com/jshjohnson/Choices#readme */ /*! choices.js v2.8.5 | (c) 2017 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
(function webpackUniversalModuleDefinition(root, factory) { (function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object') if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(); module.exports = factory();
@ -131,6 +131,7 @@ return /******/ (function(modules) { // webpackBootstrap
searchEnabled: true, searchEnabled: true,
searchChoices: true, searchChoices: true,
searchFloor: 1, searchFloor: 1,
searchResultLimit: 4,
searchFields: ['label', 'value'], searchFields: ['label', 'value'],
position: 'auto', position: 'auto',
resetScrollPosition: true, resetScrollPosition: true,
@ -417,19 +418,31 @@ return /******/ (function(modules) { // webpackBootstrap
// Create a fragment to store our list items (so we don't have to update the DOM for each item) // Create a fragment to store our list items (so we don't have to update the DOM for each item)
var choicesFragment = fragment || document.createDocumentFragment(); var choicesFragment = fragment || document.createDocumentFragment();
var filter = this.isSearching ? _utils.sortByScore : this.config.sortFilter; var filter = this.isSearching ? _utils.sortByScore : this.config.sortFilter;
var appendChoice = function appendChoice(choice) {
var dropdownItem = _this3._getTemplate('choice', choice);
var shouldRender = _this3.passedElement.type === 'select-one' || !choice.selected;
if (shouldRender) {
choicesFragment.appendChild(dropdownItem);
}
};
// If sorting is enabled or the user is searching, filter choices // If sorting is enabled or the user is searching, filter choices
if (this.config.shouldSort || this.isSearching) { if (this.config.shouldSort || this.isSearching) {
choices.sort(filter); choices.sort(filter);
} }
choices.forEach(function (choice) { if (this.isSearching) {
var dropdownItem = _this3._getTemplate('choice', choice); for (var i = 0; i < this.config.searchResultLimit; i++) {
var shouldRender = _this3.passedElement.type === 'select-one' || !choice.selected; var choice = choices[i];
if (shouldRender) { if (choice) {
choicesFragment.appendChild(dropdownItem); appendChoice(choice);
} }
}
} else {
choices.forEach(function (choice) {
return appendChoice(choice);
}); });
}
return choicesFragment; return choicesFragment;
} }
@ -5025,7 +5038,7 @@ return /******/ (function(modules) { // webpackBootstrap
groupId: action.groupId, groupId: action.groupId,
value: action.value, value: action.value,
label: action.label || action.value, label: action.label || action.value,
disabled: action.disabled, disabled: action.disabled || false,
selected: false, selected: false,
active: true, active: true,
score: 9999 score: 9999

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
{ {
"name": "choices.js", "name": "choices.js",
"version": "2.8.4", "version": "2.8.5",
"description": "A vanilla JS customisable text input/select box plugin", "description": "A vanilla JS customisable text input/select box plugin",
"main": [ "main": [
"./assets/scripts/dist/choices.js", "./assets/scripts/dist/choices.js",

View file

@ -15,7 +15,7 @@
<meta name="theme-color" content="#ffffff"> <meta name="theme-color" content="#ffffff">
<!-- Ignore these --> <!-- Ignore these -->
<link rel="stylesheet" href="assets/styles/css/base.min.css?version=2.8.4"> <link rel="stylesheet" href="assets/styles/css/base.min.css?version=2.8.5">
<!-- End ignore these --> <!-- End ignore these -->
<!-- Optional includes --> <!-- Optional includes -->
@ -23,8 +23,8 @@
<!-- End optional includes --> <!-- End optional includes -->
<!-- Choices includes --> <!-- Choices includes -->
<link rel="stylesheet" href="assets/styles/css/choices.min.css?version=2.8.4"> <link rel="stylesheet" href="assets/styles/css/choices.min.css?version=2.8.5">
<script src="assets/scripts/dist/choices.min.js?version=2.8.4"></script> <script src="assets/scripts/dist/choices.min.js?version=2.8.5"></script>
<!-- End Choices includes --> <!-- End Choices includes -->
<!--[if lt IE 9]> <!--[if lt IE 9]>

View file

@ -1,6 +1,6 @@
{ {
"name": "choices.js", "name": "choices.js",
"version": "2.8.4", "version": "2.8.5",
"description": "A vanilla JS customisable text input/select box plugin", "description": "A vanilla JS customisable text input/select box plugin",
"main": "./assets/scripts/dist/choices.min.js", "main": "./assets/scripts/dist/choices.min.js",
"scripts": { "scripts": {