mirror of
https://github.com/Choices-js/Choices.git
synced 2024-04-27 11:41:57 +02:00
Version 2.8.8
This commit is contained in:
parent
49c76da629
commit
147341b846
483
assets/scripts/dist/choices.js
vendored
483
assets/scripts/dist/choices.js
vendored
|
@ -1,4 +1,4 @@
|
|||
/*! choices.js v2.8.7 | (c) 2017 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
|
||||
/*! choices.js v2.8.8 | (c) 2017 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
|
||||
(function webpackUniversalModuleDefinition(root, factory) {
|
||||
if(typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = factory();
|
||||
|
@ -742,9 +742,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
var _this7 = this;
|
||||
|
||||
if (!value || !(0, _utils.isType)('String', value)) {
|
||||
if (!this.config.silent) {
|
||||
console.error('removeItemsByValue: No value was passed to be removed');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2361,9 +2358,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
key: '_removeItem',
|
||||
value: function _removeItem(item) {
|
||||
if (!item || !(0, _utils.isType)('Object', item)) {
|
||||
if (!this.config.silent) {
|
||||
console.error('removeItem: No item object was passed to be removed');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3646,9 +3640,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
this.store = (0, _redux.createStore)(_index2.default, window.devToolsExtension ? window.devToolsExtension() : undefined);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get store object (wrapping Redux method)
|
||||
* @return {Object} State
|
||||
/**
|
||||
* Get store object (wrapping Redux method)
|
||||
* @return {Object} State
|
||||
*/
|
||||
|
||||
|
||||
|
@ -3658,10 +3652,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return this.store.getState();
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispatch event to store (wrapped Redux method)
|
||||
* @param {Function} action Action function to trigger
|
||||
* @return
|
||||
/**
|
||||
* Dispatch event to store (wrapped Redux method)
|
||||
* @param {Function} action Action function to trigger
|
||||
* @return
|
||||
*/
|
||||
|
||||
}, {
|
||||
|
@ -3670,10 +3664,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
this.store.dispatch(action);
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe store to function call (wrapped Redux method)
|
||||
* @param {Function} onChange Function to trigger when state changes
|
||||
* @return
|
||||
/**
|
||||
* Subscribe store to function call (wrapped Redux method)
|
||||
* @param {Function} onChange Function to trigger when state changes
|
||||
* @return
|
||||
*/
|
||||
|
||||
}, {
|
||||
|
@ -3682,9 +3676,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
this.store.subscribe(onChange);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get items from store
|
||||
* @return {Array} Item objects
|
||||
/**
|
||||
* Get items from store
|
||||
* @return {Array} Item objects
|
||||
*/
|
||||
|
||||
}, {
|
||||
|
@ -3694,9 +3688,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return state.items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get active items from store
|
||||
* @return {Array} Item objects
|
||||
/**
|
||||
* Get active items from store
|
||||
* @return {Array} Item objects
|
||||
*/
|
||||
|
||||
}, {
|
||||
|
@ -3710,9 +3704,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get items from store reduced to just their values
|
||||
* @return {Array} Item objects
|
||||
/**
|
||||
* Get items from store reduced to just their values
|
||||
* @return {Array} Item objects
|
||||
*/
|
||||
|
||||
}, {
|
||||
|
@ -3728,9 +3722,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get choices from store
|
||||
* @return {Array} Option objects
|
||||
/**
|
||||
* Get choices from store
|
||||
* @return {Array} Option objects
|
||||
*/
|
||||
|
||||
}, {
|
||||
|
@ -3740,9 +3734,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return state.choices;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get active choices from store
|
||||
* @return {Array} Option objects
|
||||
/**
|
||||
* Get active choices from store
|
||||
* @return {Array} Option objects
|
||||
*/
|
||||
|
||||
}, {
|
||||
|
@ -3756,9 +3750,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get selectable choices from store
|
||||
* @return {Array} Option objects
|
||||
/**
|
||||
* Get selectable choices from store
|
||||
* @return {Array} Option objects
|
||||
*/
|
||||
|
||||
}, {
|
||||
|
@ -3772,9 +3766,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get single choice by it's ID
|
||||
* @return {Object} Found choice
|
||||
/**
|
||||
* Get single choice by it's ID
|
||||
* @return {Object} Found choice
|
||||
*/
|
||||
|
||||
}, {
|
||||
|
@ -3790,9 +3784,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get groups from store
|
||||
* @return {Array} Group objects
|
||||
/**
|
||||
* Get groups from store
|
||||
* @return {Array} Group objects
|
||||
*/
|
||||
|
||||
}, {
|
||||
|
@ -3802,9 +3796,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return state.groups;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get active groups from store
|
||||
* @return {Array} Group objects
|
||||
/**
|
||||
* Get active groups from store
|
||||
* @return {Array} Group objects
|
||||
*/
|
||||
|
||||
}, {
|
||||
|
@ -3824,10 +3818,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get group by group id
|
||||
* @param {Number} id Group ID
|
||||
* @return {Object} Group data
|
||||
/**
|
||||
* Get group by group id
|
||||
* @param {Number} id Group ID
|
||||
* @return {Object} Group data
|
||||
*/
|
||||
|
||||
}, {
|
||||
|
@ -3929,33 +3923,34 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
*/
|
||||
var ActionTypes = exports.ActionTypes = {
|
||||
INIT: '@@redux/INIT'
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a Redux store that holds the state tree.
|
||||
* The only way to change the data in the store is to call `dispatch()` on it.
|
||||
*
|
||||
* There should only be a single store in your app. To specify how different
|
||||
* parts of the state tree respond to actions, you may combine several reducers
|
||||
* into a single reducer function by using `combineReducers`.
|
||||
*
|
||||
* @param {Function} reducer A function that returns the next state tree, given
|
||||
* the current state tree and the action to handle.
|
||||
*
|
||||
* @param {any} [preloadedState] The initial state. You may optionally specify it
|
||||
* to hydrate the state from the server in universal apps, or to restore a
|
||||
* previously serialized user session.
|
||||
* If you use `combineReducers` to produce the root reducer function, this must be
|
||||
* an object with the same shape as `combineReducers` keys.
|
||||
*
|
||||
* @param {Function} [enhancer] The store enhancer. You may optionally specify it
|
||||
* to enhance the store with third-party capabilities such as middleware,
|
||||
* time travel, persistence, etc. The only store enhancer that ships with Redux
|
||||
* is `applyMiddleware()`.
|
||||
*
|
||||
* @returns {Store} A Redux store that lets you read the state, dispatch actions
|
||||
* and subscribe to changes.
|
||||
*/
|
||||
};function createStore(reducer, preloadedState, enhancer) {
|
||||
/**
|
||||
* Creates a Redux store that holds the state tree.
|
||||
* The only way to change the data in the store is to call `dispatch()` on it.
|
||||
*
|
||||
* There should only be a single store in your app. To specify how different
|
||||
* parts of the state tree respond to actions, you may combine several reducers
|
||||
* into a single reducer function by using `combineReducers`.
|
||||
*
|
||||
* @param {Function} reducer A function that returns the next state tree, given
|
||||
* the current state tree and the action to handle.
|
||||
*
|
||||
* @param {any} [preloadedState] The initial state. You may optionally specify it
|
||||
* to hydrate the state from the server in universal apps, or to restore a
|
||||
* previously serialized user session.
|
||||
* If you use `combineReducers` to produce the root reducer function, this must be
|
||||
* an object with the same shape as `combineReducers` keys.
|
||||
*
|
||||
* @param {Function} enhancer The store enhancer. You may optionally specify it
|
||||
* to enhance the store with third-party capabilities such as middleware,
|
||||
* time travel, persistence, etc. The only store enhancer that ships with Redux
|
||||
* is `applyMiddleware()`.
|
||||
*
|
||||
* @returns {Store} A Redux store that lets you read the state, dispatch actions
|
||||
* and subscribe to changes.
|
||||
*/
|
||||
function createStore(reducer, preloadedState, enhancer) {
|
||||
var _ref2;
|
||||
|
||||
if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
|
||||
|
@ -4089,8 +4084,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
|
||||
var listeners = currentListeners = nextListeners;
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
var listener = listeners[i];
|
||||
listener();
|
||||
listeners[i]();
|
||||
}
|
||||
|
||||
return action;
|
||||
|
@ -4119,7 +4113,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
* Interoperability point for observable/reactive libraries.
|
||||
* @returns {observable} A minimal observable of state changes.
|
||||
* For more information, see the observable proposal:
|
||||
* https://github.com/tc39/proposal-observable
|
||||
* https://github.com/zenparsing/es-observable
|
||||
*/
|
||||
function observable() {
|
||||
var _ref;
|
||||
|
@ -4566,7 +4560,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
var actionType = action && action.type;
|
||||
var actionName = actionType && '"' + actionType.toString() + '"' || 'an action';
|
||||
|
||||
return 'Given action ' + actionName + ', reducer "' + key + '" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.';
|
||||
return 'Given action ' + actionName + ', reducer "' + key + '" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state.';
|
||||
}
|
||||
|
||||
function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
|
||||
|
@ -4594,18 +4588,18 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
}
|
||||
}
|
||||
|
||||
function assertReducerShape(reducers) {
|
||||
function assertReducerSanity(reducers) {
|
||||
Object.keys(reducers).forEach(function (key) {
|
||||
var reducer = reducers[key];
|
||||
var initialState = reducer(undefined, { type: _createStore.ActionTypes.INIT });
|
||||
|
||||
if (typeof initialState === 'undefined') {
|
||||
throw new Error('Reducer "' + key + '" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.');
|
||||
throw new Error('Reducer "' + key + '" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined.');
|
||||
}
|
||||
|
||||
var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.');
|
||||
if (typeof reducer(undefined, { type: type }) === 'undefined') {
|
||||
throw new Error('Reducer "' + key + '" returned undefined when probed with a random type. ' + ('Don\'t try to handle ' + _createStore.ActionTypes.INIT + ' or other actions in "redux/*" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.');
|
||||
throw new Error('Reducer "' + key + '" returned undefined when probed with a random type. ' + ('Don\'t try to handle ' + _createStore.ActionTypes.INIT + ' or other actions in "redux/*" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -4644,24 +4638,23 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
}
|
||||
var finalReducerKeys = Object.keys(finalReducers);
|
||||
|
||||
var unexpectedKeyCache = void 0;
|
||||
if (false) {
|
||||
unexpectedKeyCache = {};
|
||||
var unexpectedKeyCache = {};
|
||||
}
|
||||
|
||||
var shapeAssertionError = void 0;
|
||||
var sanityError;
|
||||
try {
|
||||
assertReducerShape(finalReducers);
|
||||
assertReducerSanity(finalReducers);
|
||||
} catch (e) {
|
||||
shapeAssertionError = e;
|
||||
sanityError = e;
|
||||
}
|
||||
|
||||
return function combination() {
|
||||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
var state = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
||||
var action = arguments[1];
|
||||
|
||||
if (shapeAssertionError) {
|
||||
throw shapeAssertionError;
|
||||
if (sanityError) {
|
||||
throw sanityError;
|
||||
}
|
||||
|
||||
if (false) {
|
||||
|
@ -4673,16 +4666,16 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
|
||||
var hasChanged = false;
|
||||
var nextState = {};
|
||||
for (var _i = 0; _i < finalReducerKeys.length; _i++) {
|
||||
var _key = finalReducerKeys[_i];
|
||||
var reducer = finalReducers[_key];
|
||||
var previousStateForKey = state[_key];
|
||||
for (var i = 0; i < finalReducerKeys.length; i++) {
|
||||
var key = finalReducerKeys[i];
|
||||
var reducer = finalReducers[key];
|
||||
var previousStateForKey = state[key];
|
||||
var nextStateForKey = reducer(previousStateForKey, action);
|
||||
if (typeof nextStateForKey === 'undefined') {
|
||||
var errorMessage = getUndefinedStateErrorMessage(_key, action);
|
||||
var errorMessage = getUndefinedStateErrorMessage(key, action);
|
||||
throw new Error(errorMessage);
|
||||
}
|
||||
nextState[_key] = nextStateForKey;
|
||||
nextState[key] = nextStateForKey;
|
||||
hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
|
||||
}
|
||||
return hasChanged ? nextState : state;
|
||||
|
@ -4872,11 +4865,13 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return funcs[0];
|
||||
}
|
||||
|
||||
return funcs.reduce(function (a, b) {
|
||||
return function () {
|
||||
return a(b.apply(undefined, arguments));
|
||||
};
|
||||
});
|
||||
var last = funcs[funcs.length - 1];
|
||||
var rest = funcs.slice(0, -1);
|
||||
return function () {
|
||||
return rest.reduceRight(function (composed, f) {
|
||||
return f(composed);
|
||||
}, last.apply(undefined, arguments));
|
||||
};
|
||||
}
|
||||
|
||||
/***/ }),
|
||||
|
@ -5055,10 +5050,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
switch (action.type) {
|
||||
case 'ADD_CHOICE':
|
||||
{
|
||||
/*
|
||||
A disabled choice appears in the choice dropdown but cannot be selected
|
||||
A selected choice has been added to the passed input's value (added as an item)
|
||||
An active choice appears within the choice dropdown
|
||||
/*
|
||||
A disabled choice appears in the choice dropdown but cannot be selected
|
||||
A selected choice has been added to the passed input's value (added as an item)
|
||||
An active choice appears within the choice dropdown
|
||||
*/
|
||||
return [].concat(_toConsumableArray(state), [{
|
||||
id: action.id,
|
||||
|
@ -5259,10 +5254,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
||||
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Capitalises the first letter of each word in a string
|
||||
* @param {String} str String to capitalise
|
||||
* @return {String} Capitalised string
|
||||
/**
|
||||
* Capitalises the first letter of each word in a string
|
||||
* @param {String} str String to capitalise
|
||||
* @return {String} Capitalised string
|
||||
*/
|
||||
var capitalise = exports.capitalise = function capitalise(str) {
|
||||
return str.replace(/\w\S*/g, function (txt) {
|
||||
|
@ -5270,10 +5265,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Generates a string of random chars
|
||||
* @param {Number} length Length of the string to generate
|
||||
* @return {String} String of random chars
|
||||
/**
|
||||
* Generates a string of random chars
|
||||
* @param {Number} length Length of the string to generate
|
||||
* @return {String} String of random chars
|
||||
*/
|
||||
var generateChars = exports.generateChars = function generateChars(length) {
|
||||
var chars = '';
|
||||
|
@ -5286,11 +5281,11 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return chars;
|
||||
};
|
||||
|
||||
/**
|
||||
* Generates a unique id based on an element
|
||||
* @param {HTMLElement} element Element to generate the id from
|
||||
* @param {String} Prefix for the Id
|
||||
* @return {String} Unique Id
|
||||
/**
|
||||
* Generates a unique id based on an element
|
||||
* @param {HTMLElement} element Element to generate the id from
|
||||
* @param {String} Prefix for the Id
|
||||
* @return {String} Unique Id
|
||||
*/
|
||||
var generateId = exports.generateId = function generateId(element, prefix) {
|
||||
var id = element.id || element.name && element.name + '-' + generateChars(2) || generateChars(4);
|
||||
|
@ -5300,58 +5295,58 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return id;
|
||||
};
|
||||
|
||||
/**
|
||||
* Tests the type of an object
|
||||
* @param {String} type Type to test object against
|
||||
* @param {Object} obj Object to be tested
|
||||
* @return {Boolean}
|
||||
/**
|
||||
* Tests the type of an object
|
||||
* @param {String} type Type to test object against
|
||||
* @param {Object} obj Object to be tested
|
||||
* @return {Boolean}
|
||||
*/
|
||||
var getType = exports.getType = function getType(obj) {
|
||||
return Object.prototype.toString.call(obj).slice(8, -1);
|
||||
};
|
||||
|
||||
/**
|
||||
* Tests the type of an object
|
||||
* @param {String} type Type to test object against
|
||||
* @param {Object} obj Object to be tested
|
||||
* @return {Boolean}
|
||||
/**
|
||||
* Tests the type of an object
|
||||
* @param {String} type Type to test object against
|
||||
* @param {Object} obj Object to be tested
|
||||
* @return {Boolean}
|
||||
*/
|
||||
var isType = exports.isType = function isType(type, obj) {
|
||||
var clas = getType(obj);
|
||||
return obj !== undefined && obj !== null && clas === type;
|
||||
};
|
||||
|
||||
/**
|
||||
* Tests to see if a passed object is a node
|
||||
* @param {Object} obj Object to be tested
|
||||
* @return {Boolean}
|
||||
/**
|
||||
* Tests to see if a passed object is a node
|
||||
* @param {Object} obj Object to be tested
|
||||
* @return {Boolean}
|
||||
*/
|
||||
var isNode = exports.isNode = function isNode(o) {
|
||||
return (typeof Node === 'undefined' ? 'undefined' : _typeof(Node)) === "object" ? o instanceof Node : o && (typeof o === 'undefined' ? 'undefined' : _typeof(o)) === "object" && typeof o.nodeType === "number" && typeof o.nodeName === "string";
|
||||
};
|
||||
|
||||
/**
|
||||
* Tests to see if a passed object is an element
|
||||
* @param {Object} obj Object to be tested
|
||||
* @return {Boolean}
|
||||
/**
|
||||
* Tests to see if a passed object is an element
|
||||
* @param {Object} obj Object to be tested
|
||||
* @return {Boolean}
|
||||
*/
|
||||
var isElement = exports.isElement = function isElement(o) {
|
||||
return (typeof HTMLElement === 'undefined' ? 'undefined' : _typeof(HTMLElement)) === "object" ? o instanceof HTMLElement : //DOM2
|
||||
o && (typeof o === 'undefined' ? 'undefined' : _typeof(o)) === "object" && o !== null && o.nodeType === 1 && typeof o.nodeName === "string";
|
||||
};
|
||||
|
||||
/**
|
||||
* Merges unspecified amount of objects into new object
|
||||
* @private
|
||||
* @return {Object} Merged object of arguments
|
||||
/**
|
||||
* Merges unspecified amount of objects into new object
|
||||
* @private
|
||||
* @return {Object} Merged object of arguments
|
||||
*/
|
||||
var extend = exports.extend = function extend() {
|
||||
var extended = {};
|
||||
var length = arguments.length;
|
||||
|
||||
/**
|
||||
* Merge one object into another
|
||||
* @param {Object} obj Object to merge into extended object
|
||||
/**
|
||||
* Merge one object into another
|
||||
* @param {Object} obj Object to merge into extended object
|
||||
*/
|
||||
var merge = function merge(obj) {
|
||||
for (var prop in obj) {
|
||||
|
@ -5380,9 +5375,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return extended;
|
||||
};
|
||||
|
||||
/**
|
||||
* CSS transition end event listener
|
||||
* @return
|
||||
/**
|
||||
* CSS transition end event listener
|
||||
* @return
|
||||
*/
|
||||
var whichTransitionEvent = exports.whichTransitionEvent = function whichTransitionEvent() {
|
||||
var t,
|
||||
|
@ -5402,9 +5397,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* CSS animation end event listener
|
||||
* @return
|
||||
/**
|
||||
* CSS animation end event listener
|
||||
* @return
|
||||
*/
|
||||
var whichAnimationEvent = exports.whichAnimationEvent = function whichAnimationEvent() {
|
||||
var t,
|
||||
|
@ -5424,13 +5419,13 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the ancestors of each element in the current set of matched elements,
|
||||
* up to but not including the element matched by the selector
|
||||
* @param {NodeElement} elem Element to begin search from
|
||||
* @param {NodeElement} parent Parent to find
|
||||
* @param {String} selector Class to find
|
||||
* @return {Array} Array of parent elements
|
||||
/**
|
||||
* Get the ancestors of each element in the current set of matched elements,
|
||||
* up to but not including the element matched by the selector
|
||||
* @param {NodeElement} elem Element to begin search from
|
||||
* @param {NodeElement} parent Parent to find
|
||||
* @param {String} selector Class to find
|
||||
* @return {Array} Array of parent elements
|
||||
*/
|
||||
var getParentsUntil = exports.getParentsUntil = function getParentsUntil(elem, parent, selector) {
|
||||
var parents = [];
|
||||
|
@ -5530,22 +5525,22 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return siblings;
|
||||
};
|
||||
|
||||
/**
|
||||
* Find ancestor in DOM tree
|
||||
* @param {NodeElement} el Element to start search from
|
||||
* @param {[type]} cls Class of parent
|
||||
* @return {NodeElement} Found parent element
|
||||
/**
|
||||
* Find ancestor in DOM tree
|
||||
* @param {NodeElement} el Element to start search from
|
||||
* @param {[type]} cls Class of parent
|
||||
* @return {NodeElement} Found parent element
|
||||
*/
|
||||
var findAncestor = exports.findAncestor = function findAncestor(el, cls) {
|
||||
while ((el = el.parentElement) && !el.classList.contains(cls)) {}
|
||||
return el;
|
||||
};
|
||||
|
||||
/**
|
||||
* Find ancestor in DOM tree by attribute name
|
||||
* @param {NodeElement} el Element to start search from
|
||||
* @param {string} attr Attribute name of parent
|
||||
* @return {?NodeElement} Found parent element or null
|
||||
/**
|
||||
* Find ancestor in DOM tree by attribute name
|
||||
* @param {NodeElement} el Element to start search from
|
||||
* @param {string} attr Attribute name of parent
|
||||
* @return {?NodeElement} Found parent element or null
|
||||
*/
|
||||
var findAncestorByAttrName = exports.findAncestorByAttrName = function findAncestorByAttrName(el, attr) {
|
||||
var target = el;
|
||||
|
@ -5561,12 +5556,12 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Debounce an event handler.
|
||||
* @param {Function} func Function to run after wait
|
||||
* @param {Number} wait The delay before the function is executed
|
||||
* @param {Boolean} immediate If passed, trigger the function on the leading edge, instead of the trailing.
|
||||
* @return {Function} A function will be called after it stops being called for a given delay
|
||||
/**
|
||||
* Debounce an event handler.
|
||||
* @param {Function} func Function to run after wait
|
||||
* @param {Number} wait The delay before the function is executed
|
||||
* @param {Boolean} immediate If passed, trigger the function on the leading edge, instead of the trailing.
|
||||
* @return {Function} A function will be called after it stops being called for a given delay
|
||||
*/
|
||||
var debounce = exports.debounce = function debounce(func, wait, immediate) {
|
||||
var timeout;
|
||||
|
@ -5584,11 +5579,11 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Get an element's distance from the top of the page
|
||||
* @private
|
||||
* @param {NodeElement} el Element to test for
|
||||
* @return {Number} Elements Distance from top of page
|
||||
/**
|
||||
* Get an element's distance from the top of the page
|
||||
* @private
|
||||
* @param {NodeElement} el Element to test for
|
||||
* @return {Number} Elements Distance from top of page
|
||||
*/
|
||||
var getElemDistance = exports.getElemDistance = function getElemDistance(el) {
|
||||
var location = 0;
|
||||
|
@ -5601,11 +5596,11 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return location >= 0 ? location : 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* Determine element height multiplied by any offsets
|
||||
* @private
|
||||
* @param {HTMLElement} el Element to test for
|
||||
* @return {Number} Height of element
|
||||
/**
|
||||
* Determine element height multiplied by any offsets
|
||||
* @private
|
||||
* @param {HTMLElement} el Element to test for
|
||||
* @return {Number} Height of element
|
||||
*/
|
||||
var getElementOffset = exports.getElementOffset = function getElementOffset(el, offset) {
|
||||
var elOffset = offset;
|
||||
|
@ -5615,12 +5610,12 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return Math.max(el.offsetHeight * elOffset);
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the next or previous element from a given start point
|
||||
* @param {HTMLElement} startEl Element to start position from
|
||||
* @param {String} className The class we will look through
|
||||
* @param {Number} direction Positive next element, negative previous element
|
||||
* @return {[HTMLElement} Found element
|
||||
/**
|
||||
* Get the next or previous element from a given start point
|
||||
* @param {HTMLElement} startEl Element to start position from
|
||||
* @param {String} className The class we will look through
|
||||
* @param {Number} direction Positive next element, negative previous element
|
||||
* @return {[HTMLElement} Found element
|
||||
*/
|
||||
var getAdjacentEl = exports.getAdjacentEl = function getAdjacentEl(startEl, className) {
|
||||
var direction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
||||
|
@ -5636,10 +5631,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return children[startPos + operatorDirection];
|
||||
};
|
||||
|
||||
/**
|
||||
* Get scroll position based on top/bottom position
|
||||
* @private
|
||||
* @return {String} Position of scroll
|
||||
/**
|
||||
* Get scroll position based on top/bottom position
|
||||
* @private
|
||||
* @return {String} Position of scroll
|
||||
*/
|
||||
var getScrollPosition = exports.getScrollPosition = function getScrollPosition(position) {
|
||||
if (position === 'bottom') {
|
||||
|
@ -5651,23 +5646,23 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Determine whether an element is within the viewport
|
||||
* @param {HTMLElement} el Element to test
|
||||
* @return {String} Position of scroll
|
||||
* @return {Boolean}
|
||||
/**
|
||||
* Determine whether an element is within the viewport
|
||||
* @param {HTMLElement} el Element to test
|
||||
* @return {String} Position of scroll
|
||||
* @return {Boolean}
|
||||
*/
|
||||
var isInView = exports.isInView = function isInView(el, position, offset) {
|
||||
// If the user has scrolled further than the distance from the element to the top of its parent
|
||||
return this.getScrollPosition(position) > this.getElemDistance(el) + this.getElementOffset(el, offset) ? true : false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Determine whether an element is within
|
||||
* @param {HTMLElement} el Element to test
|
||||
* @param {HTMLElement} parent Scrolling parent
|
||||
* @param {Number} direction Whether element is visible from above or below
|
||||
* @return {Boolean}
|
||||
/**
|
||||
* Determine whether an element is within
|
||||
* @param {HTMLElement} el Element to test
|
||||
* @param {HTMLElement} parent Scrolling parent
|
||||
* @param {Number} direction Whether element is visible from above or below
|
||||
* @return {Boolean}
|
||||
*/
|
||||
var isScrolledIntoView = exports.isScrolledIntoView = function isScrolledIntoView(el, parent) {
|
||||
var direction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
||||
|
@ -5687,10 +5682,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return isVisible;
|
||||
};
|
||||
|
||||
/**
|
||||
* Remove html tags from a string
|
||||
* @param {String} Initial string/html
|
||||
* @return {String} Sanitised string
|
||||
/**
|
||||
* Remove html tags from a string
|
||||
* @param {String} Initial string/html
|
||||
* @return {String} Sanitised string
|
||||
*/
|
||||
var stripHTML = exports.stripHTML = function stripHTML(html) {
|
||||
var el = document.createElement("DIV");
|
||||
|
@ -5698,11 +5693,11 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return el.textContent || el.innerText || "";
|
||||
};
|
||||
|
||||
/**
|
||||
* Adds animation to an element and removes it upon animation completion
|
||||
* @param {Element} el Element to add animation to
|
||||
* @param {String} animation Animation class to add to element
|
||||
* @return
|
||||
/**
|
||||
* Adds animation to an element and removes it upon animation completion
|
||||
* @param {Element} el Element to add animation to
|
||||
* @param {String} animation Animation class to add to element
|
||||
* @return
|
||||
*/
|
||||
var addAnimation = exports.addAnimation = function addAnimation(el, animation) {
|
||||
var animationEvent = whichAnimationEvent();
|
||||
|
@ -5716,20 +5711,20 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
el.addEventListener(animationEvent, removeAnimation, false);
|
||||
};
|
||||
|
||||
/**
|
||||
* Get a random number between a range
|
||||
* @param {Number} min Minimum range
|
||||
* @param {Number} max Maximum range
|
||||
* @return {Number} Random number
|
||||
/**
|
||||
* Get a random number between a range
|
||||
* @param {Number} min Minimum range
|
||||
* @param {Number} max Maximum range
|
||||
* @return {Number} Random number
|
||||
*/
|
||||
var getRandomNumber = exports.getRandomNumber = function getRandomNumber(min, max) {
|
||||
return Math.floor(Math.random() * (max - min) + min);
|
||||
};
|
||||
|
||||
/**
|
||||
* Turn a string into a node
|
||||
* @param {String} String to convert
|
||||
* @return {HTMLElement} Converted node element
|
||||
/**
|
||||
* Turn a string into a node
|
||||
* @param {String} String to convert
|
||||
* @return {HTMLElement} Converted node element
|
||||
*/
|
||||
var strToEl = exports.strToEl = function () {
|
||||
var tmpEl = document.createElement('div');
|
||||
|
@ -5747,9 +5742,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
};
|
||||
}();
|
||||
|
||||
/**
|
||||
* Sets the width of a passed input based on its value
|
||||
* @return {Number} Width of input
|
||||
/**
|
||||
* Sets the width of a passed input based on its value
|
||||
* @return {Number} Width of input
|
||||
*/
|
||||
var getWidthOfInput = exports.getWidthOfInput = function getWidthOfInput(input) {
|
||||
var value = input.value || input.placeholder;
|
||||
|
@ -5776,13 +5771,13 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return width + 'px';
|
||||
};
|
||||
|
||||
/**
|
||||
* Sorting function for current and previous string
|
||||
* @param {String} a Current value
|
||||
* @param {String} b Next value
|
||||
* @return {Number} -1 for after previous,
|
||||
* 1 for before,
|
||||
* 0 for same location
|
||||
/**
|
||||
* Sorting function for current and previous string
|
||||
* @param {String} a Current value
|
||||
* @param {String} b Next value
|
||||
* @return {Number} -1 for after previous,
|
||||
* 1 for before,
|
||||
* 0 for same location
|
||||
*/
|
||||
var sortByAlpha = exports.sortByAlpha = function sortByAlpha(a, b) {
|
||||
var labelA = (a.label || a.value).toLowerCase();
|
||||
|
@ -5793,24 +5788,24 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* Sort by numeric score
|
||||
* @param {Object} a Current value
|
||||
* @param {Object} b Next value
|
||||
* @return {Number} -1 for after previous,
|
||||
* 1 for before,
|
||||
* 0 for same location
|
||||
/**
|
||||
* Sort by numeric score
|
||||
* @param {Object} a Current value
|
||||
* @param {Object} b Next value
|
||||
* @return {Number} -1 for after previous,
|
||||
* 1 for before,
|
||||
* 0 for same location
|
||||
*/
|
||||
var sortByScore = exports.sortByScore = function sortByScore(a, b) {
|
||||
return a.score - b.score;
|
||||
};
|
||||
|
||||
/**
|
||||
* Trigger native event
|
||||
* @param {NodeElement} element Element to trigger event on
|
||||
* @param {String} type Type of event to trigger
|
||||
* @param {Object} customArgs Data to pass with event
|
||||
* @return {Object} Triggered event
|
||||
/**
|
||||
* Trigger native event
|
||||
* @param {NodeElement} element Element to trigger event on
|
||||
* @param {String} type Type of event to trigger
|
||||
* @param {Object} customArgs Data to pass with event
|
||||
* @return {Object} Triggered event
|
||||
*/
|
||||
var triggerEvent = exports.triggerEvent = function triggerEvent(element, type) {
|
||||
var customArgs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
||||
|
|
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
8
assets/scripts/dist/choices.min.js
vendored
8
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",
|
||||
"version": "2.8.7",
|
||||
"version": "2.8.8",
|
||||
"description": "A vanilla JS customisable text input/select box plugin",
|
||||
"main": [
|
||||
"./assets/scripts/dist/choices.js",
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<!-- Ignore these -->
|
||||
<link rel="stylesheet" href="assets/styles/css/base.min.css?version=2.8.7">
|
||||
<link rel="stylesheet" href="assets/styles/css/base.min.css?version=2.8.8">
|
||||
<!-- End ignore these -->
|
||||
|
||||
<!-- Optional includes -->
|
||||
|
@ -23,8 +23,8 @@
|
|||
<!-- End optional includes -->
|
||||
|
||||
<!-- Choices includes -->
|
||||
<link rel="stylesheet" href="assets/styles/css/choices.min.css?version=2.8.7">
|
||||
<script src="assets/scripts/dist/choices.min.js?version=2.8.7"></script>
|
||||
<link rel="stylesheet" href="assets/styles/css/choices.min.css?version=2.8.8">
|
||||
<script src="assets/scripts/dist/choices.min.js?version=2.8.8"></script>
|
||||
<!-- End Choices includes -->
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "choices.js",
|
||||
"version": "2.8.7",
|
||||
"version": "2.8.8",
|
||||
"description": "A vanilla JS customisable text input/select box plugin",
|
||||
"main": "./assets/scripts/dist/choices.min.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Example usage: npm --newVersion=2.8.7 run version
|
||||
// Example usage: npm --newVersion=2.8.8 run version
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
var path = require('path');
|
||||
var package = require('./package.json');
|
||||
var pkg = require('./package.json');
|
||||
var webpack = require('webpack');
|
||||
var wrapperPlugin = require('wrapper-webpack-plugin');
|
||||
var banner = `/*! ${ package.name } v${ package.version } | (c) ${ new Date().getFullYear() } ${ package.author } | ${ package.homepage } */ \n`;
|
||||
var banner = `/*! ${ pkg.name } v${ pkg.version } | (c) ${ new Date().getFullYear() } ${ pkg.author } | ${ pkg.homepage } */ \n`;
|
||||
var minimize = process.argv.indexOf('--minimize') !== -1;
|
||||
|
||||
var config = {
|
||||
|
|
Loading…
Reference in a new issue