Version 2.7.7

This commit is contained in:
Josh Johnson 2017-03-28 14:42:35 +01:00
parent 7efd189c7d
commit 7255fa42ce
6 changed files with 39 additions and 28 deletions

View file

@ -1,4 +1,4 @@
/*! choices.js v2.7.6 | (c) 2017 Josh Johnson | https://github.com/jshjohnson/Choices#readme */ /*! choices.js v2.7.7 | (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();
@ -754,6 +754,7 @@ return /******/ (function(modules) { // webpackBootstrap
this.containerOuter.classList.add(this.config.classNames.openState); this.containerOuter.classList.add(this.config.classNames.openState);
this.containerOuter.setAttribute('aria-expanded', 'true'); this.containerOuter.setAttribute('aria-expanded', 'true');
this.dropdown.classList.add(this.config.classNames.activeState); this.dropdown.classList.add(this.config.classNames.activeState);
this.dropdown.setAttribute('aria-expanded', 'true');
var dimensions = this.dropdown.getBoundingClientRect(); var dimensions = this.dropdown.getBoundingClientRect();
var dropdownPos = Math.ceil(dimensions.top + window.scrollY + dimensions.height); var dropdownPos = Math.ceil(dimensions.top + window.scrollY + dimensions.height);
@ -799,6 +800,7 @@ return /******/ (function(modules) { // webpackBootstrap
this.containerOuter.classList.remove(this.config.classNames.openState); this.containerOuter.classList.remove(this.config.classNames.openState);
this.containerOuter.setAttribute('aria-expanded', 'false'); this.containerOuter.setAttribute('aria-expanded', 'false');
this.dropdown.classList.remove(this.config.classNames.activeState); this.dropdown.classList.remove(this.config.classNames.activeState);
this.dropdown.setAttribute('aria-expanded', 'false');
if (isFlipped) { if (isFlipped) {
this.containerOuter.classList.remove(this.config.classNames.flippedState); this.containerOuter.classList.remove(this.config.classNames.flippedState);
@ -1204,6 +1206,10 @@ return /******/ (function(modules) { // webpackBootstrap
var choice = this.store.getChoiceById(id); var choice = this.store.getChoiceById(id);
var hasActiveDropdown = this.dropdown.classList.contains(this.config.classNames.activeState); var hasActiveDropdown = this.dropdown.classList.contains(this.config.classNames.activeState);
(0, _utils.triggerEvent)(this.passedElement, 'choice', {
choice: choice
});
if (choice && !choice.selected && !choice.disabled) { if (choice && !choice.selected && !choice.disabled) {
var canAddItem = this._canAddItem(activeItems, choice.value); var canAddItem = this._canAddItem(activeItems, choice.value);
@ -1809,13 +1815,15 @@ return /******/ (function(modules) { // webpackBootstrap
value: function _onMouseDown(e) { value: function _onMouseDown(e) {
var target = e.target; var target = e.target;
if (this.containerOuter.contains(target) && target !== this.input) { if (this.containerOuter.contains(target) && target !== this.input) {
var foundTarget = void 0;
var activeItems = this.store.getItemsFilteredByActive(); var activeItems = this.store.getItemsFilteredByActive();
var hasShiftKey = e.shiftKey; var hasShiftKey = e.shiftKey;
var foundTarget = void 0;
if (foundTarget = (0, _utils.findAncestorByAttr)(target, 'data-item')) { if (foundTarget = (0, _utils.findAncestorByAttrName)(target, 'data-button')) {
this._handleButtonAction(activeItems, foundTarget);
} else if (foundTarget = (0, _utils.findAncestorByAttrName)(target, 'data-item')) {
this._handleItemAction(activeItems, foundTarget, hasShiftKey); this._handleItemAction(activeItems, foundTarget, hasShiftKey);
} else if (foundTarget = (0, _utils.findAncestorByAttr)(target, 'data-choice')) { } else if (foundTarget = (0, _utils.findAncestorByAttrName)(target, 'data-choice')) {
this._handleChoiceAction(activeItems, foundTarget); this._handleChoiceAction(activeItems, foundTarget);
} }
@ -2671,7 +2679,10 @@ return /******/ (function(modules) { // webpackBootstrap
* @param {!Object<string, *>} options * @param {!Object<string, *>} options
*/ */
function Fuse (list, options) { function Fuse (list, options) {
var i
var len
var key var key
var keys
this.list = list this.list = list
this.options = options = options || {} this.options = options = options || {}
@ -2690,7 +2701,7 @@ return /******/ (function(modules) { // webpackBootstrap
} }
} }
Fuse.VERSION = '2.6.2' Fuse.VERSION = '2.6.0'
/** /**
* Sets a new list for Fuse to match against. * Sets a new list for Fuse to match against.
@ -5294,7 +5305,7 @@ return /******/ (function(modules) { // webpackBootstrap
* @param {string} attr Attribute name of parent * @param {string} attr Attribute name of parent
* @return {?NodeElement} Found parent element or null * @return {?NodeElement} Found parent element or null
*/ */
var findAncestorByAttr = exports.findAncestorByAttr = function findAncestorByAttr(el, attr) { var findAncestorByAttrName = exports.findAncestorByAttrName = function findAncestorByAttrName(el, attr) {
var target = el; var target = el;
while (target) { while (target) {

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.7.6", "version": "2.7.7",
"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.7.6"> <link rel="stylesheet" href="assets/styles/css/base.min.css?version=2.7.7">
<!-- 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.7.6"> <link rel="stylesheet" href="assets/styles/css/choices.min.css?version=2.7.7">
<script src="assets/scripts/dist/choices.min.js?version=2.7.6"></script> <script src="assets/scripts/dist/choices.min.js?version=2.7.7"></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.7.6", "version": "2.7.7",
"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": {