mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-17 21:16:34 +02:00
Version 2.8.4
This commit is contained in:
parent
38761ca4ae
commit
d28ad92033
28
assets/scripts/dist/choices.js
vendored
28
assets/scripts/dist/choices.js
vendored
|
@ -1,4 +1,4 @@
|
||||||
/*! choices.js v2.8.3 | (c) 2017 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
|
/*! choices.js v2.8.4 | (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();
|
||||||
|
@ -224,7 +224,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
this.presetItems = this.presetItems.concat(this.passedElement.value.split(this.config.delimiter));
|
this.presetItems = this.presetItems.concat(this.passedElement.value.split(this.config.delimiter));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Set unique base Id
|
// Set unique base Id
|
||||||
this.baseId = (0, _utils.generateId)(this.passedElement, 'choices-');
|
this.baseId = (0, _utils.generateId)(this.passedElement, 'choices-');
|
||||||
|
|
||||||
// Bind methods
|
// Bind methods
|
||||||
|
@ -1686,6 +1686,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
var onEscapeKey = function onEscapeKey() {
|
var onEscapeKey = function onEscapeKey() {
|
||||||
if (hasActiveDropdown) {
|
if (hasActiveDropdown) {
|
||||||
_this16.toggleDropdown();
|
_this16.toggleDropdown();
|
||||||
|
_this16.containerOuter.focus();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2203,6 +2204,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
|
|
||||||
// Highlight first element in dropdown
|
// Highlight first element in dropdown
|
||||||
var choices = Array.from(this.dropdown.querySelectorAll('[data-choice-selectable]'));
|
var choices = Array.from(this.dropdown.querySelectorAll('[data-choice-selectable]'));
|
||||||
|
var passedEl = el;
|
||||||
|
|
||||||
if (choices && choices.length) {
|
if (choices && choices.length) {
|
||||||
var highlightedChoices = Array.from(this.dropdown.querySelectorAll('.' + this.config.classNames.highlightedState));
|
var highlightedChoices = Array.from(this.dropdown.querySelectorAll('.' + this.config.classNames.highlightedState));
|
||||||
|
@ -2213,26 +2215,28 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
choice.setAttribute('aria-selected', 'false');
|
choice.setAttribute('aria-selected', 'false');
|
||||||
});
|
});
|
||||||
|
|
||||||
if (el) {
|
if (passedEl) {
|
||||||
this.highlightPosition = choices.indexOf(el);
|
this.highlightPosition = choices.indexOf(passedEl);
|
||||||
} else {
|
} else {
|
||||||
// Highlight choice based on last known highlight location
|
// Highlight choice based on last known highlight location
|
||||||
if (choices.length > this.highlightPosition) {
|
if (choices.length > this.highlightPosition) {
|
||||||
// If we have an option to highlight
|
// If we have an option to highlight
|
||||||
el = choices[this.highlightPosition];
|
passedEl = choices[this.highlightPosition];
|
||||||
} else {
|
} else {
|
||||||
// Otherwise highlight the option before
|
// Otherwise highlight the option before
|
||||||
el = choices[choices.length - 1];
|
passedEl = choices[choices.length - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!el) el = choices[0];
|
if (!passedEl) {
|
||||||
|
passedEl = choices[0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Highlight given option, and set accessiblity attributes
|
// Highlight given option, and set accessiblity attributes
|
||||||
el.classList.add(this.config.classNames.highlightedState);
|
passedEl.classList.add(this.config.classNames.highlightedState);
|
||||||
el.setAttribute('aria-selected', 'true');
|
passedEl.setAttribute('aria-selected', 'true');
|
||||||
this.containerOuter.setAttribute('aria-activedescendant', el.id);
|
this.containerOuter.setAttribute('aria-activedescendant', passedEl.id);
|
||||||
this.input.setAttribute('aria-activedescendant', el.id);
|
this.input.setAttribute('aria-activedescendant', passedEl.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2365,7 +2369,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
var choices = this.store.getChoices();
|
var choices = this.store.getChoices();
|
||||||
var choiceLabel = label || value;
|
var choiceLabel = label || value;
|
||||||
var choiceId = choices ? choices.length + 1 : 1;
|
var choiceId = choices ? choices.length + 1 : 1;
|
||||||
var choiceElementId = this.baseId + "-" + this.idNames.itemChoice + "-" + choiceId;
|
var choiceElementId = this.baseId + '-' + this.idNames.itemChoice + '-' + choiceId;
|
||||||
|
|
||||||
this.store.dispatch((0, _index3.addChoice)(value, choiceLabel, choiceId, groupId, isDisabled, choiceElementId));
|
this.store.dispatch((0, _index3.addChoice)(value, choiceLabel, choiceId, groupId, isDisabled, choiceElementId));
|
||||||
|
|
||||||
|
|
2
assets/scripts/dist/choices.js.map
vendored
2
assets/scripts/dist/choices.js.map
vendored
File diff suppressed because one or more lines are too long
4
assets/scripts/dist/choices.min.js
vendored
4
assets/scripts/dist/choices.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "choices.js",
|
"name": "choices.js",
|
||||||
"version": "2.8.3",
|
"version": "2.8.4",
|
||||||
"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",
|
||||||
|
|
|
@ -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.3">
|
<link rel="stylesheet" href="assets/styles/css/base.min.css?version=2.8.4">
|
||||||
<!-- 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.3">
|
<link rel="stylesheet" href="assets/styles/css/choices.min.css?version=2.8.4">
|
||||||
<script src="assets/scripts/dist/choices.min.js?version=2.8.3"></script>
|
<script src="assets/scripts/dist/choices.min.js?version=2.8.4"></script>
|
||||||
<!-- End Choices includes -->
|
<!-- End Choices includes -->
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
<!--[if lt IE 9]>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "choices.js",
|
"name": "choices.js",
|
||||||
"version": "2.8.3",
|
"version": "2.8.4",
|
||||||
"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": {
|
||||||
|
|
Loading…
Reference in a new issue