diff --git a/.babelrc b/.babelrc index f2e3127..d4b1424 100644 --- a/.babelrc +++ b/.babelrc @@ -1,3 +1,11 @@ { - "presets": ["env", "stage-2"] + "presets": [ + "@babel/preset-env" + ], + "plugins": [ + "@babel/plugin-transform-modules-commonjs", + ["@babel/plugin-transform-spread", { + "loose": true + }] + ] } diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 0000000..7c8f0e2 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,2 @@ +> 5% +IE 11 \ No newline at end of file diff --git a/README.md b/README.md index 381b9cd..b5d5b9a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Choices.js ![Build Status](https://travis-ci.org/jshjohnson/Choices.svg?branch=master) [![](https://data.jsdelivr.com/v1/package/npm/choices.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/choices.js) [![npm](https://img.shields.io/npm/v/choices.js.svg)](https://www.npmjs.com/package/choices.js) [![codebeat badge](https://codebeat.co/badges/55120150-5866-42d8-8010-6aaaff5d3fa1)](https://codebeat.co/projects/github-com-jshjohnson-choices-master) -A vanilla, lightweight (~25kb gzipped 🎉), configurable select box/text input plugin. Similar to Select2 and Selectize but without the jQuery dependency. +A vanilla, lightweight (~22kb gzipped 🎉), configurable select box/text input plugin. Similar to Select2 and Selectize but without the jQuery dependency. [Demo](https://joshuajohnson.co.uk/Choices/) @@ -919,6 +919,8 @@ Choices is compiled using [Babel](https://babeljs.io/) to enable support for [ES * Array.prototype.map * Array.prototype.find * Array.prototype.some +* Array.prototype.includes +* Array.from * Array.prototype.reduce * Array.prototype.indexOf * Object.assign diff --git a/package.json b/package.json index b02579c..c598ed0 100644 --- a/package.json +++ b/package.json @@ -13,13 +13,11 @@ "cypress:run": "$(npm bin)/cypress run", "cypress:open": "$(npm bin)/cypress open", "test": "run-p test:unit test:e2e", - "test:unit": "mocha --require ./config/jsdom.js --compilers js:babel-core/register \"./src/**/**/**/**/*.test.js\" --exit", + "test:unit": "mocha --require ./config/jsdom.js --require @babel/register $(find src -name '*.test.js') --exit", "test:unit:watch": "npm run test:unit -- --watch --inspect=5556", "test:e2e": "run-p --race start cypress:run", "js:watch": "NODE_ENV=development node server.js", - "js:build:minimised": "webpack --env.minimize --config webpack.config.prod.js", - "js:build:unminimised": "webpack --config webpack.config.prod.js", - "js:build": "run-p js:build:minimised js:build:unminimised", + "js:build": "webpack --config webpack.config.prod.js", "css:watch": "nodemon -e scss -x \"npm run css:build\"", "css:build": "run-p css:sass css:prefix css:min", "css:sass": "node-sass --output-style expanded --include-path scss src/styles/base.scss public/assets/styles/base.css && node-sass --output-style expanded --include-path scss src/styles/choices.scss public/assets/styles/choices.css", @@ -28,7 +26,7 @@ "bump-cache": "node bump-cache.js --current $npm_package_version", "deploy": "git subtree push --prefix public origin gh-pages", "postversion": "npm run js:build && npm run bump-cache", - "prepush": "run-p lint test:unit" + "prepush": "run-p lint test:unit && npm run bundlesize" }, "repository": { "type": "git", @@ -55,49 +53,53 @@ "js" ], "devDependencies": { + "@babel/core": "^7.2.2", + "@babel/plugin-proposal-class-properties": "^7.3.0", + "@babel/plugin-transform-modules-commonjs": "^7.2.0", + "@babel/plugin-transform-spread": "^7.2.2", + "@babel/preset-env": "^7.3.1", + "@babel/register": "^7.0.0", "autoprefixer": "^6.3.3", - "babel-core": "^6.26.0", - "babel-eslint": "^7.2.3", - "babel-loader": "^7.1.2", - "babel-preset-env": "^1.6.1", - "babel-preset-stage-2": "^6.24.1", + "babel-eslint": "^9.0.0", + "babel-loader": "^8.0.5", "bundlesize": "^0.17.1", - "chai": "^4.1.0", + "chai": "^4.2.0", "csso": "^1.8.2", - "cypress": "^3.1.4", + "cypress": "^3.1.5", "eslint": "^3.19.0", "eslint-config-airbnb": "^15.1.0", - "eslint-config-prettier": "^2.9.0", - "eslint-loader": "^1.5.0", - "eslint-plugin-cypress": "^2.0.1", - "eslint-plugin-import": "^2.7.0", + "eslint-config-prettier": "^2.10.0", + "eslint-loader": "^2.1.2", + "eslint-plugin-cypress": "^2.2.0", + "eslint-plugin-import": "^2.16.0", "eslint-plugin-jsx-a11y": "^5.1.1", - "eslint-plugin-prettier": "^2.6.0", - "eslint-plugin-react": "^7.2.1", - "express": "^4.16.3", + "eslint-plugin-prettier": "^2.7.0", + "eslint-plugin-react": "^7.12.4", + "express": "^4.16.4", "husky": "^0.14.3", - "jsdom": "^11.5.1", - "mocha": "^3.4.2", - "node-sass": "^4.9.3", - "nodemon": "^1.18.9", - "npm-run-all": "^4.1.3", - "nyc": "^11.0.3", - "opn": "^5.1.0", + "jsdom": "^11.12.0", + "mocha": "^5.2.0", + "node-sass": "^4.11.0", + "nodemon": "^1.18.10", + "npm-run-all": "^4.1.5", + "nyc": "^11.9.0", + "opn": "^5.4.0", "postcss-cli": "^2.5.1", - "prettier": "^1.13.0", + "prettier": "^1.16.4", "sinon": "^2.4.0", - "webpack": "^3.8.1", - "webpack-dev-middleware": "^2.0.0", - "webpack-hot-middleware": "^2.22.2", + "unminified-webpack-plugin": "^2.0.0", + "webpack": "^4.29.3", + "webpack-cli": "^3.2.3", + "webpack-dev-middleware": "^3.5.2", + "webpack-hot-middleware": "^2.24.3", "whatwg-fetch": "^1.0.0", - "wrapper-webpack-plugin": "^0.1.7" + "wrapper-webpack-plugin": "^2.1.0" }, "dependencies": { - "classnames": "^2.2.5", - "core-js": "^2.5.6", + "classnames": "^2.2.6", "custom-event-polyfill": "^0.3.0", "deepmerge": "^2.2.1", - "fuse.js": "^3.1.0", + "fuse.js": "^3.4.1", "redux": "^3.3.1" }, "npmName": "choices.js", diff --git a/public/assets/scripts/choices.js b/public/assets/scripts/choices.js index 858de55..aac6c15 100644 --- a/public/assets/scripts/choices.js +++ b/public/assets/scripts/choices.js @@ -1,18 +1,17 @@ -/*! choices.js v4.1.4 | (c) 2019 Josh Johnson | https://github.com/jshjohnson/Choices#readme */ (function webpackUniversalModuleDefinition(root, factory) { - //CommonJS2 + //CommonJS2 if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); - //AMD + //AMD else if(typeof define === 'function' && define.amd) define([], factory); - //CommonJS + //CommonJS else if(typeof exports === 'object') exports["Choices"] = factory(); - //Window + //Window else root["Choices"] = factory(); -})(typeof self !== 'undefined' ? self : this, function() { +})(window, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -51,14 +50,34 @@ return /******/ (function(modules) { // webpackBootstrap /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? @@ -74,44 +93,33 @@ return /******/ (function(modules) { // webpackBootstrap /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/public/assets/scripts/"; /******/ +/******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 37); +/******/ return __webpack_require__(__webpack_require__.s = 9); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { -var store = __webpack_require__(26)('wks'); -var uid = __webpack_require__(13); -var Symbol = __webpack_require__(3).Symbol; -var USE_SYMBOL = typeof Symbol == 'function'; - -var $exports = module.exports = function (name) { - return store[name] || (store[name] = - USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); -}; - -$exports.store = store; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -/* eslint-disable */ +exports.doKeysMatch = exports.cloneObject = exports.existsInArray = exports.isIE11 = exports.fetchFromObject = exports.reduceToValues = exports.getWindowHeight = exports.regexFilter = exports.dispatchEvent = exports.sortByScore = exports.sortByAlpha = exports.calcWidthOfInput = exports.strToEl = exports.stripHTML = exports.isScrolledIntoView = exports.getAdjacentEl = exports.findAncestorByAttrName = exports.findAncestor = exports.wrap = exports.extend = exports.isElement = exports.isType = exports.getType = exports.generateId = exports.generateChars = exports.getRandomNumber = void 0; -var getRandomNumber = exports.getRandomNumber = function getRandomNumber(min, max) { +var _this = void 0; + +/* eslint-disable */ +var getRandomNumber = function getRandomNumber(min, max) { return Math.floor(Math.random() * (max - min) + min); }; -var generateChars = exports.generateChars = function generateChars(length) { +exports.getRandomNumber = getRandomNumber; + +var generateChars = function generateChars(length) { var chars = ''; for (var i = 0; i < length; i++) { @@ -122,35 +130,44 @@ var generateChars = exports.generateChars = function generateChars(length) { return chars; }; -var generateId = exports.generateId = function generateId(element, prefix) { - var id = element.id || element.name && element.name + '-' + generateChars(2) || generateChars(4); - id = id.replace(/(:|\.|\[|\]|,)/g, ''); - id = prefix + '-' + id; +exports.generateChars = generateChars; +var generateId = function generateId(element, prefix) { + var id = element.id || element.name && "".concat(element.name, "-").concat(generateChars(2)) || generateChars(4); + id = id.replace(/(:|\.|\[|\]|,)/g, ''); + id = "".concat(prefix, "-").concat(id); return id; }; -var getType = exports.getType = function getType(obj) { +exports.generateId = generateId; + +var getType = function getType(obj) { return Object.prototype.toString.call(obj).slice(8, -1); }; -var isType = exports.isType = function isType(type, obj) { +exports.getType = getType; + +var isType = function isType(type, obj) { var clas = getType(obj); return obj !== undefined && obj !== null && clas === type; }; -var isElement = exports.isElement = function isElement(element) { +exports.isType = isType; + +var isElement = function isElement(element) { return element instanceof Element; }; -var extend = exports.extend = function extend() { +exports.isElement = isElement; + +var extend = function extend() { var extended = {}; var length = arguments.length; - /** * Merge one object into another * @param {Object} obj Object to merge into extended object */ + var merge = function merge(obj) { for (var prop in obj) { if (Object.prototype.hasOwnProperty.call(obj, prop)) { @@ -162,14 +179,13 @@ var extend = exports.extend = function extend() { } } } - }; + }; // Loop through each passed argument + - // Loop through each passed argument for (var i = 0; i < length; i++) { // store argument at position i - var obj = arguments[i]; + var obj = arguments[i]; // If we are in fact dealing with an object, merge it. - // If we are in fact dealing with an object, merge it. if (isType('Object', obj)) { merge(obj); } @@ -178,22 +194,33 @@ var extend = exports.extend = function extend() { return extended; }; -var wrap = exports.wrap = function wrap(element, wrapper) { +exports.extend = extend; + +var wrap = function wrap(element, wrapper) { wrapper = wrapper || document.createElement('div'); + if (element.nextSibling) { element.parentNode.insertBefore(wrapper, element.nextSibling); } else { element.parentNode.appendChild(wrapper); } + return wrapper.appendChild(element); }; -var findAncestor = exports.findAncestor = function findAncestor(el, cls) { - while ((el = el.parentElement) && !el.classList.contains(cls)) {} +exports.wrap = wrap; + +var findAncestor = function findAncestor(el, cls) { + while ((el = el.parentElement) && !el.classList.contains(cls)) { + ; + } + return el; }; -var findAncestorByAttrName = exports.findAncestorByAttrName = function findAncestorByAttrName(el, attr) { +exports.findAncestor = findAncestor; + +var findAncestorByAttrName = function findAncestorByAttrName(el, attr) { var target = el; while (target) { @@ -207,26 +234,24 @@ var findAncestorByAttrName = exports.findAncestorByAttrName = function findAnces return null; }; -var getAdjacentEl = exports.getAdjacentEl = function getAdjacentEl(startEl, className) { +exports.findAncestorByAttrName = findAncestorByAttrName; + +var getAdjacentEl = function getAdjacentEl(startEl, className) { var direction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; - if (!startEl || !className) return; - var parent = startEl.parentNode.parentNode; var children = Array.from(parent.querySelectorAll(className)); - var startPos = children.indexOf(startEl); var operatorDirection = direction > 0 ? 1 : -1; - return children[startPos + operatorDirection]; }; -var isScrolledIntoView = exports.isScrolledIntoView = function isScrolledIntoView(el, parent) { +exports.getAdjacentEl = getAdjacentEl; + +var isScrolledIntoView = function isScrolledIntoView(el, parent) { var direction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; - if (!el) return; - - var isVisible = void 0; + var isVisible; if (direction > 0) { // In view from bottom @@ -239,15 +264,19 @@ var isScrolledIntoView = exports.isScrolledIntoView = function isScrolledIntoVie return isVisible; }; -var stripHTML = exports.stripHTML = function stripHTML(html) { +exports.isScrolledIntoView = isScrolledIntoView; + +var stripHTML = function stripHTML(html) { return html.replace(/&/g, '&').replace(/>/g, '&rt;').replace(/' + stripHTML(value) + ''); + var testEl = strToEl("".concat(stripHTML(value), "")); testEl.style.position = 'absolute'; testEl.style.padding = '0'; testEl.style.top = '-9999px'; @@ -291,22 +323,22 @@ var calcWidthOfInput = exports.calcWidthOfInput = function calcWidthOfInput(inpu } document.body.appendChild(testEl); - requestAnimationFrame(function () { if (value && testEl.offsetWidth !== input.offsetWidth) { width = testEl.offsetWidth + 4; } document.body.removeChild(testEl); - - callback.call(undefined, width + 'px'); + callback.call(_this, "".concat(width, "px")); }); } else { - callback.call(undefined, width + 'px'); + callback.call(_this, "".concat(width, "px")); } }; -var sortByAlpha = exports.sortByAlpha = function sortByAlpha(a, b) { +exports.calcWidthOfInput = calcWidthOfInput; + +var sortByAlpha = function sortByAlpha(a, b) { var labelA = (a.label || a.value).toLowerCase(); var labelB = (b.label || b.value).toLowerCase(); @@ -321,23 +353,27 @@ var sortByAlpha = exports.sortByAlpha = function sortByAlpha(a, b) { return 0; }; -var sortByScore = exports.sortByScore = function sortByScore(a, b) { +exports.sortByAlpha = sortByAlpha; + +var sortByScore = function sortByScore(a, b) { return a.score - b.score; }; -var dispatchEvent = exports.dispatchEvent = function dispatchEvent(element, type) { - var customArgs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; +exports.sortByScore = sortByScore; +var dispatchEvent = function dispatchEvent(element, type) { + var customArgs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; var event = new CustomEvent(type, { detail: customArgs, bubbles: true, cancelable: true }); - return element.dispatchEvent(event); }; -var regexFilter = exports.regexFilter = function regexFilter(value, regex) { +exports.dispatchEvent = dispatchEvent; + +var regexFilter = function regexFilter(value, regex) { if (!value || !regex) { return false; } @@ -346,24 +382,28 @@ var regexFilter = exports.regexFilter = function regexFilter(value, regex) { return expression.test(value); }; -var getWindowHeight = exports.getWindowHeight = function getWindowHeight() { +exports.regexFilter = regexFilter; + +var getWindowHeight = function getWindowHeight() { var body = document.body; var html = document.documentElement; return Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight); }; -var reduceToValues = exports.reduceToValues = function reduceToValues(items) { - var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'value'; +exports.getWindowHeight = getWindowHeight; +var reduceToValues = function reduceToValues(items) { + var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'value'; var values = items.reduce(function (prev, current) { prev.push(current[key]); return prev; }, []); - return values; }; -var fetchFromObject = exports.fetchFromObject = function fetchFromObject(object, path) { +exports.reduceToValues = reduceToValues; + +var fetchFromObject = function fetchFromObject(object, path) { var index = path.indexOf('.'); if (index > -1) { @@ -373,11 +413,15 @@ var fetchFromObject = exports.fetchFromObject = function fetchFromObject(object, return object[path]; }; -var isIE11 = exports.isIE11 = function isIE11() { +exports.fetchFromObject = fetchFromObject; + +var isIE11 = function isIE11() { return !!(navigator.userAgent.match(/Trident/) && navigator.userAgent.match(/rv[ :]11/)); }; -var existsInArray = exports.existsInArray = function existsInArray(array, value) { +exports.isIE11 = isIE11; + +var existsInArray = function existsInArray(array, value) { var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'value'; return array.some(function (item) { if (isType('String', value)) { @@ -388,52 +432,24 @@ var existsInArray = exports.existsInArray = function existsInArray(array, value) }); }; -var cloneObject = exports.cloneObject = function cloneObject(obj) { +exports.existsInArray = existsInArray; + +var cloneObject = function cloneObject(obj) { return JSON.parse(JSON.stringify(obj)); }; -var doKeysMatch = exports.doKeysMatch = function doKeysMatch(a, b) { +exports.cloneObject = cloneObject; + +var doKeysMatch = function doKeysMatch(a, b) { var aKeys = Object.keys(a).sort(); var bKeys = Object.keys(b).sort(); return JSON.stringify(aKeys) === JSON.stringify(bKeys); }; -/***/ }), -/* 2 */ -/***/ (function(module, exports) { - -var core = module.exports = { version: '2.5.7' }; -if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef - +exports.doKeysMatch = doKeysMatch; /***/ }), -/* 3 */ -/***/ (function(module, exports) { - -// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 -var global = module.exports = typeof window != 'undefined' && window.Math == Math - ? window : typeof self != 'undefined' && self.Math == Math ? self - // eslint-disable-next-line no-new-func - : Function('return this')(); -if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef - - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - -var dP = __webpack_require__(7); -var createDesc = __webpack_require__(12); -module.exports = __webpack_require__(10) ? function (object, key, value) { - return dP.f(object, key, createDesc(1, value)); -} : function (object, key, value) { - object[key] = value; - return object; -}; - - -/***/ }), -/* 5 */ +/* 1 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -442,11 +458,11 @@ module.exports = __webpack_require__(10) ? function (object, key, value) { Object.defineProperty(exports, "__esModule", { value: true }); -exports.SCROLLING_SPEED = exports.KEY_CODES = exports.ACTION_TYPES = exports.EVENTS = exports.DEFAULT_CONFIG = exports.DEFAULT_CLASSNAMES = undefined; +exports.SCROLLING_SPEED = exports.KEY_CODES = exports.ACTION_TYPES = exports.EVENTS = exports.DEFAULT_CONFIG = exports.DEFAULT_CLASSNAMES = void 0; -var _utils = __webpack_require__(1); +var _utils = __webpack_require__(0); -var DEFAULT_CLASSNAMES = exports.DEFAULT_CLASSNAMES = { +var DEFAULT_CLASSNAMES = { containerOuter: 'choices', containerInner: 'choices__inner', input: 'choices__input', @@ -474,8 +490,8 @@ var DEFAULT_CLASSNAMES = exports.DEFAULT_CLASSNAMES = { noResults: 'has-no-results', noChoices: 'has-no-choices' }; - -var DEFAULT_CONFIG = exports.DEFAULT_CONFIG = { +exports.DEFAULT_CLASSNAMES = DEFAULT_CLASSNAMES; +var DEFAULT_CONFIG = { items: [], choices: [], silent: false, @@ -511,10 +527,10 @@ var DEFAULT_CONFIG = exports.DEFAULT_CONFIG = { itemSelectText: 'Press to select', uniqueItemText: 'Only unique values can be added', addItemText: function addItemText(value) { - return 'Press Enter to add "' + (0, _utils.stripHTML)(value) + '"'; + return "Press Enter to add \"".concat((0, _utils.stripHTML)(value), "\""); }, maxItemText: function maxItemText(maxItemCount) { - return 'Only ' + maxItemCount + ' values can be added'; + return "Only ".concat(maxItemCount, " values can be added"); }, itemComparer: function itemComparer(choice, item) { return choice === item; @@ -526,8 +542,8 @@ var DEFAULT_CONFIG = exports.DEFAULT_CONFIG = { callbackOnCreateTemplates: null, classNames: DEFAULT_CLASSNAMES }; - -var EVENTS = exports.EVENTS = { +exports.DEFAULT_CONFIG = DEFAULT_CONFIG; +var EVENTS = { showDropdown: 'showDropdown', hideDropdown: 'hideDropdown', change: 'change', @@ -538,8 +554,8 @@ var EVENTS = exports.EVENTS = { highlightItem: 'highlightItem', highlightChoice: 'highlightChoice' }; - -var ACTION_TYPES = exports.ACTION_TYPES = { +exports.EVENTS = EVENTS; +var ACTION_TYPES = { ADD_CHOICE: 'ADD_CHOICE', FILTER_CHOICES: 'FILTER_CHOICES', ACTIVATE_CHOICES: 'ACTIVATE_CHOICES', @@ -550,8 +566,8 @@ var ACTION_TYPES = exports.ACTION_TYPES = { HIGHLIGHT_ITEM: 'HIGHLIGHT_ITEM', CLEAR_ALL: 'CLEAR_ALL' }; - -var KEY_CODES = exports.KEY_CODES = { +exports.ACTION_TYPES = ACTION_TYPES; +var KEY_CODES = { BACK_KEY: 46, DELETE_KEY: 8, ENTER_KEY: 13, @@ -562,432 +578,283 @@ var KEY_CODES = exports.KEY_CODES = { PAGE_UP_KEY: 33, PAGE_DOWN_KEY: 34 }; - -var SCROLLING_SPEED = exports.SCROLLING_SPEED = 4; +exports.KEY_CODES = KEY_CODES; +var SCROLLING_SPEED = 4; +exports.SCROLLING_SPEED = SCROLLING_SPEED; /***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(3); -var core = __webpack_require__(2); -var hide = __webpack_require__(4); -var redefine = __webpack_require__(24); -var ctx = __webpack_require__(14); -var PROTOTYPE = 'prototype'; - -var $export = function (type, name, source) { - var IS_FORCED = type & $export.F; - var IS_GLOBAL = type & $export.G; - var IS_STATIC = type & $export.S; - var IS_PROTO = type & $export.P; - var IS_BIND = type & $export.B; - var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; - var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); - var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); - var key, own, out, exp; - if (IS_GLOBAL) source = name; - for (key in source) { - // contains in native - own = !IS_FORCED && target && target[key] !== undefined; - // export native or passed - out = (own ? target : source)[key]; - // bind timers to global for call from export context - exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; - // extend global - if (target) redefine(target, key, out, type & $export.U); - // export - if (exports[key] != out) hide(exports, key, exp); - if (IS_PROTO && expProto[key] != out) expProto[key] = out; - } -}; -global.core = core; -// type bitmap -$export.F = 1; // forced -$export.G = 2; // global -$export.S = 4; // static -$export.P = 8; // proto -$export.B = 16; // bind -$export.W = 32; // wrap -$export.U = 64; // safe -$export.R = 128; // real proto method for `library` -module.exports = $export; - - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -var anObject = __webpack_require__(8); -var IE8_DOM_DEFINE = __webpack_require__(44); -var toPrimitive = __webpack_require__(45); -var dP = Object.defineProperty; - -exports.f = __webpack_require__(10) ? Object.defineProperty : function defineProperty(O, P, Attributes) { - anObject(O); - P = toPrimitive(P, true); - anObject(Attributes); - if (IE8_DOM_DEFINE) try { - return dP(O, P, Attributes); - } catch (e) { /* empty */ } - if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); - if ('value' in Attributes) O[P] = Attributes.value; - return O; -}; - - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(9); -module.exports = function (it) { - if (!isObject(it)) throw TypeError(it + ' is not an object!'); - return it; -}; - - -/***/ }), -/* 9 */ -/***/ (function(module, exports) { - -module.exports = function (it) { - return typeof it === 'object' ? it !== null : typeof it === 'function'; -}; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -// Thank's IE8 for his funny defineProperty -module.exports = !__webpack_require__(22)(function () { - return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; -}); - - -/***/ }), -/* 11 */ -/***/ (function(module, exports) { - -var hasOwnProperty = {}.hasOwnProperty; -module.exports = function (it, key) { - return hasOwnProperty.call(it, key); -}; - - -/***/ }), -/* 12 */ -/***/ (function(module, exports) { - -module.exports = function (bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value: value - }; -}; - - -/***/ }), -/* 13 */ -/***/ (function(module, exports) { - -var id = 0; -var px = Math.random(); -module.exports = function (key) { - return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); -}; - - -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - -// optional / simple context binding -var aFunction = __webpack_require__(46); -module.exports = function (fn, that, length) { - aFunction(fn); - if (that === undefined) return fn; - switch (length) { - case 1: return function (a) { - return fn.call(that, a); - }; - case 2: return function (a, b) { - return fn.call(that, a, b); - }; - case 3: return function (a, b, c) { - return fn.call(that, a, b, c); - }; - } - return function (/* ...args */) { - return fn.apply(that, arguments); - }; -}; - - -/***/ }), -/* 15 */ -/***/ (function(module, exports) { - -var toString = {}.toString; - -module.exports = function (it) { - return toString.call(it).slice(8, -1); -}; - - -/***/ }), -/* 16 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.13 ToObject(argument) -var defined = __webpack_require__(17); -module.exports = function (it) { - return Object(defined(it)); -}; - - -/***/ }), -/* 17 */ -/***/ (function(module, exports) { - -// 7.2.1 RequireObjectCoercible(argument) -module.exports = function (it) { - if (it == undefined) throw TypeError("Can't call method on " + it); - return it; -}; - - -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.15 ToLength -var toInteger = __webpack_require__(19); -var min = Math.min; -module.exports = function (it) { - return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 -}; - - -/***/ }), -/* 19 */ -/***/ (function(module, exports) { - -// 7.1.4 ToInteger -var ceil = Math.ceil; -var floor = Math.floor; -module.exports = function (it) { - return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); -}; - - -/***/ }), -/* 20 */ -/***/ (function(module, exports) { - -module.exports = {}; - - -/***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { - -var shared = __webpack_require__(26)('keys'); -var uid = __webpack_require__(13); -module.exports = function (key) { - return shared[key] || (shared[key] = uid(key)); -}; - - -/***/ }), -/* 22 */ -/***/ (function(module, exports) { - -module.exports = function (exec) { - try { - return !!exec(); - } catch (e) { - return true; - } -}; - - -/***/ }), -/* 23 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(9); -var document = __webpack_require__(3).document; -// typeof document.createElement is 'object' in old IE -var is = isObject(document) && isObject(document.createElement); -module.exports = function (it) { - return is ? document.createElement(it) : {}; -}; - - -/***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(3); -var hide = __webpack_require__(4); -var has = __webpack_require__(11); -var SRC = __webpack_require__(13)('src'); -var TO_STRING = 'toString'; -var $toString = Function[TO_STRING]; -var TPL = ('' + $toString).split(TO_STRING); - -__webpack_require__(2).inspectSource = function (it) { - return $toString.call(it); -}; - -(module.exports = function (O, key, val, safe) { - var isFunction = typeof val == 'function'; - if (isFunction) has(val, 'name') || hide(val, 'name', key); - if (O[key] === val) return; - if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); - if (O === global) { - O[key] = val; - } else if (!safe) { - delete O[key]; - hide(O, key, val); - } else if (O[key]) { - O[key] = val; - } else { - hide(O, key, val); - } -// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative -})(Function.prototype, TO_STRING, function toString() { - return typeof this == 'function' && this[SRC] || $toString.call(this); -}); - - -/***/ }), -/* 25 */ -/***/ (function(module, exports, __webpack_require__) { - -// fallback for non-array-like ES3 and non-enumerable old V8 strings -var cof = __webpack_require__(15); -// eslint-disable-next-line no-prototype-builtins -module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { - return cof(it) == 'String' ? it.split('') : Object(it); -}; - - -/***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { - -var core = __webpack_require__(2); -var global = __webpack_require__(3); -var SHARED = '__core-js_shared__'; -var store = global[SHARED] || (global[SHARED] = {}); - -(module.exports = function (key, value) { - return store[key] || (store[key] = value !== undefined ? value : {}); -})('versions', []).push({ - version: core.version, - mode: __webpack_require__(27) ? 'pure' : 'global', - copyright: '© 2018 Denis Pushkarev (zloirock.ru)' -}); - - -/***/ }), -/* 27 */ -/***/ (function(module, exports) { - -module.exports = false; - - -/***/ }), -/* 28 */ -/***/ (function(module, exports, __webpack_require__) { - -// 22.1.3.31 Array.prototype[@@unscopables] -var UNSCOPABLES = __webpack_require__(0)('unscopables'); -var ArrayProto = Array.prototype; -if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(4)(ArrayProto, UNSCOPABLES, {}); -module.exports = function (key) { - ArrayProto[UNSCOPABLES][key] = true; -}; - - -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { - -// to indexed object, toObject with fallback for non-array-like ES3 strings -var IObject = __webpack_require__(25); -var defined = __webpack_require__(17); -module.exports = function (it) { - return IObject(defined(it)); -}; - - -/***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { - -// false -> Array#indexOf -// true -> Array#includes -var toIObject = __webpack_require__(29); -var toLength = __webpack_require__(18); -var toAbsoluteIndex = __webpack_require__(60); -module.exports = function (IS_INCLUDES) { - return function ($this, el, fromIndex) { - var O = toIObject($this); - var length = toLength(O.length); - var index = toAbsoluteIndex(fromIndex, length); - var value; - // Array#includes uses SameValueZero equality algorithm - // eslint-disable-next-line no-self-compare - if (IS_INCLUDES && el != el) while (length > index) { - value = O[index++]; - // eslint-disable-next-line no-self-compare - if (value != value) return true; - // Array#indexOf ignores holes, Array#includes - not - } else for (;length > index; index++) if (IS_INCLUDES || index in O) { - if (O[index] === el) return IS_INCLUDES || index || 0; - } return !IS_INCLUDES && -1; - }; -}; - - -/***/ }), -/* 31 */ -/***/ (function(module, exports) { - -// IE 8- don't enum bug keys -module.exports = ( - 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' -).split(','); - - -/***/ }), -/* 32 */ -/***/ (function(module, exports, __webpack_require__) { - -var def = __webpack_require__(7).f; -var has = __webpack_require__(11); -var TAG = __webpack_require__(0)('toStringTag'); - -module.exports = function (it, tag, stat) { - if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); -}; - - -/***/ }), -/* 33 */ +/* 2 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +/* WEBPACK VAR INJECTION */(function(global, module) {/* harmony import */ var _ponyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7); +/* global window */ + + +var root; + +if (typeof self !== 'undefined') { + root = self; +} else if (typeof window !== 'undefined') { + root = window; +} else if (typeof global !== 'undefined') { + root = global; +} else if (true) { + root = module; +} else {} + +var result = Object(_ponyfill_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(root); +/* harmony default export */ __webpack_exports__["a"] = (result); + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(3), __webpack_require__(16)(module))) + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || new Function("return this")(); +} catch (e) { + // This works if the window reference is available + if (typeof window === "object") g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _utils = __webpack_require__(0); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +var WrappedElement = +/*#__PURE__*/ +function () { + function WrappedElement(_ref) { + var element = _ref.element, + classNames = _ref.classNames; + + _classCallCheck(this, WrappedElement); + + Object.assign(this, { + element: element, + classNames: classNames + }); + + if (!(0, _utils.isElement)(element)) { + throw new TypeError('Invalid element passed'); + } + + this.isDisabled = false; + } + + _createClass(WrappedElement, [{ + key: "conceal", + value: function conceal() { + // Hide passed input + this.element.classList.add(this.classNames.input); + this.element.classList.add(this.classNames.hiddenState); // Remove element from tab index + + this.element.tabIndex = '-1'; // Backup original styles if any + + var origStyle = this.element.getAttribute('style'); + + if (origStyle) { + this.element.setAttribute('data-choice-orig-style', origStyle); + } + + this.element.setAttribute('aria-hidden', 'true'); + this.element.setAttribute('data-choice', 'active'); + } + }, { + key: "reveal", + value: function reveal() { + // Reinstate passed element + this.element.classList.remove(this.classNames.input); + this.element.classList.remove(this.classNames.hiddenState); + this.element.removeAttribute('tabindex'); // Recover original styles if any + + var origStyle = this.element.getAttribute('data-choice-orig-style'); + + if (origStyle) { + this.element.removeAttribute('data-choice-orig-style'); + this.element.setAttribute('style', origStyle); + } else { + this.element.removeAttribute('style'); + } + + this.element.removeAttribute('aria-hidden'); + this.element.removeAttribute('data-choice'); // Re-assign values - this is weird, I know + + this.element.value = this.element.value; + } + }, { + key: "enable", + value: function enable() { + this.element.removeAttribute('disabled'); + this.element.disabled = false; + this.isDisabled = false; + } + }, { + key: "disable", + value: function disable() { + this.element.setAttribute('disabled', ''); + this.element.disabled = true; + this.isDisabled = true; + } + }, { + key: "triggerEvent", + value: function triggerEvent(eventType, data) { + (0, _utils.dispatchEvent)(this.element, eventType, data); + } + }, { + key: "value", + get: function get() { + return this.element.value; + } + }]); + + return WrappedElement; +}(); + +exports.default = WrappedElement; + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.TEMPLATES = void 0; + +var _classnames = _interopRequireDefault(__webpack_require__(29)); + +var _utils = __webpack_require__(0); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +var TEMPLATES = { + containerOuter: function containerOuter(globalClasses, direction, isSelectElement, isSelectOneElement, searchEnabled, passedElementType) { + var tabIndex = isSelectOneElement ? 'tabindex="0"' : ''; + var role = isSelectElement ? 'role="listbox"' : ''; + var ariaAutoComplete = ''; + + if (isSelectElement && searchEnabled) { + role = 'role="combobox"'; + ariaAutoComplete = 'aria-autocomplete="list"'; + } + + return (0, _utils.strToEl)("\n \n \n ")); + }, + containerInner: function containerInner(globalClasses) { + return (0, _utils.strToEl)("\n
\n ")); + }, + itemList: function itemList(globalClasses, isSelectOneElement) { + var _classNames; + + var localClasses = (0, _classnames.default)(globalClasses.list, (_classNames = {}, _defineProperty(_classNames, globalClasses.listSingle, isSelectOneElement), _defineProperty(_classNames, globalClasses.listItems, !isSelectOneElement), _classNames)); + return (0, _utils.strToEl)("\n
\n ")); + }, + placeholder: function placeholder(globalClasses, value) { + return (0, _utils.strToEl)("\n
\n ").concat(value, "\n
\n ")); + }, + item: function item(globalClasses, data, removeItemButton) { + var _classNames2; + + var ariaSelected = data.active ? 'aria-selected="true"' : ''; + var ariaDisabled = data.disabled ? 'aria-disabled="true"' : ''; + var localClasses = (0, _classnames.default)(globalClasses.item, (_classNames2 = {}, _defineProperty(_classNames2, globalClasses.highlightedState, data.highlighted), _defineProperty(_classNames2, globalClasses.itemSelectable, !data.highlighted), _defineProperty(_classNames2, globalClasses.placeholder, data.placeholder), _classNames2)); + + if (removeItemButton) { + var _classNames3; + + localClasses = (0, _classnames.default)(globalClasses.item, (_classNames3 = {}, _defineProperty(_classNames3, globalClasses.highlightedState, data.highlighted), _defineProperty(_classNames3, globalClasses.itemSelectable, !data.disabled), _defineProperty(_classNames3, globalClasses.placeholder, data.placeholder), _classNames3)); + return (0, _utils.strToEl)("\n \n ").concat(data.label, "\n Remove item\n \n \n ")); + } + + return (0, _utils.strToEl)("\n \n ").concat(data.label, "\n \n ")); + }, + choiceList: function choiceList(globalClasses, isSelectOneElement) { + var ariaMultiSelectable = !isSelectOneElement ? 'aria-multiselectable="true"' : ''; + return (0, _utils.strToEl)("\n \n \n ")); + }, + choiceGroup: function choiceGroup(globalClasses, data) { + var ariaDisabled = data.disabled ? 'aria-disabled="true"' : ''; + var localClasses = (0, _classnames.default)(globalClasses.group, _defineProperty({}, globalClasses.itemDisabled, data.disabled)); + return (0, _utils.strToEl)("\n \n
").concat(data.value, "
\n \n ")); + }, + choice: function choice(globalClasses, data, itemSelectText) { + var _classNames5; + + var role = data.groupId > 0 ? 'role="treeitem"' : 'role="option"'; + var localClasses = (0, _classnames.default)(globalClasses.item, globalClasses.itemChoice, (_classNames5 = {}, _defineProperty(_classNames5, globalClasses.itemDisabled, data.disabled), _defineProperty(_classNames5, globalClasses.itemSelectable, !data.disabled), _defineProperty(_classNames5, globalClasses.placeholder, data.placeholder), _classNames5)); + return (0, _utils.strToEl)("\n \n ").concat(data.label, "\n \n ")); + }, + input: function input(globalClasses) { + var localClasses = (0, _classnames.default)(globalClasses.input, globalClasses.inputCloned); + return (0, _utils.strToEl)("\n \n ")); + }, + dropdown: function dropdown(globalClasses) { + var localClasses = (0, _classnames.default)(globalClasses.list, globalClasses.listDropdown); + return (0, _utils.strToEl)("\n \n \n ")); + }, + notice: function notice(globalClasses, label) { + var _classNames6; + + var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; + var localClasses = (0, _classnames.default)(globalClasses.item, globalClasses.itemChoice, (_classNames6 = {}, _defineProperty(_classNames6, globalClasses.noResults, type === 'no-results'), _defineProperty(_classNames6, globalClasses.noChoices, type === 'no-choices'), _classNames6)); + return (0, _utils.strToEl)("\n
\n ").concat(label, "\n
\n ")); + }, + option: function option(data) { + return (0, _utils.strToEl)("\n \n ")); + } +}; +exports.TEMPLATES = TEMPLATES; +var _default = TEMPLATES; +exports.default = _default; + +/***/ }), +/* 6 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); // EXTERNAL MODULE: ./node_modules/lodash-es/_freeGlobal.js -var _freeGlobal = __webpack_require__(74); +var _freeGlobal = __webpack_require__(8); // CONCATENATED MODULE: ./node_modules/lodash-es/_root.js @@ -1231,7 +1098,7 @@ function isPlainObject(value) { /* harmony default export */ var lodash_es_isPlainObject = (isPlainObject); // EXTERNAL MODULE: ./node_modules/symbol-observable/es/index.js -var es = __webpack_require__(75); +var es = __webpack_require__(2); // CONCATENATED MODULE: ./node_modules/redux/es/createStore.js @@ -1489,7 +1356,7 @@ var ActionTypes = { * @param {String} message The warning message. * @returns {void} */ -function warning_warning(message) { +function warning(message) { /* eslint-disable no-console */ if (typeof console !== 'undefined' && typeof console.error === 'function') { console.error(message); @@ -1579,11 +1446,7 @@ function combineReducers(reducers) { for (var i = 0; i < reducerKeys.length; i++) { var key = reducerKeys[i]; - if (false) { - if (typeof reducers[key] === 'undefined') { - warning('No reducer provided for key "' + key + '"'); - } - } + if (false) {} if (typeof reducers[key] === 'function') { finalReducers[key] = reducers[key]; @@ -1592,9 +1455,7 @@ function combineReducers(reducers) { var finalReducerKeys = Object.keys(finalReducers); var unexpectedKeyCache = void 0; - if (false) { - unexpectedKeyCache = {}; - } + if (false) {} var shapeAssertionError = void 0; try { @@ -1611,12 +1472,7 @@ function combineReducers(reducers) { throw shapeAssertionError; } - if (false) { - var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache); - if (warningMessage) { - warning(warningMessage); - } - } + if (false) { var warningMessage; } var hasChanged = false; var nextState = {}; @@ -1766,11 +1622,11 @@ function applyMiddleware() { }; } // CONCATENATED MODULE: ./node_modules/redux/es/index.js -/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "createStore", function() { return createStore_createStore; }); -/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "combineReducers", function() { return combineReducers; }); -/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "bindActionCreators", function() { return bindActionCreators; }); -/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "applyMiddleware", function() { return applyMiddleware; }); -/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "compose", function() { return compose; }); +/* concated harmony reexport createStore */__webpack_require__.d(__webpack_exports__, "createStore", function() { return createStore_createStore; }); +/* concated harmony reexport combineReducers */__webpack_require__.d(__webpack_exports__, "combineReducers", function() { return combineReducers; }); +/* concated harmony reexport bindActionCreators */__webpack_require__.d(__webpack_exports__, "bindActionCreators", function() { return bindActionCreators; }); +/* concated harmony reexport applyMiddleware */__webpack_require__.d(__webpack_exports__, "applyMiddleware", function() { return applyMiddleware; }); +/* concated harmony reexport compose */__webpack_require__.d(__webpack_exports__, "compose", function() { return compose; }); @@ -1784,318 +1640,104 @@ function applyMiddleware() { */ function isCrushed() {} -if (false) { - warning('You are currently using minified code outside of NODE_ENV === \'production\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.'); -} +if (false) {} /***/ }), -/* 34 */ -/***/ (function(module, exports) { - -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1,eval)("this"); -} catch(e) { - // This works if the window reference is available - if(typeof window === "object") - g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; - - -/***/ }), -/* 35 */ -/***/ (function(module, exports, __webpack_require__) { +/* 7 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return symbolObservablePonyfill; }); +function symbolObservablePonyfill(root) { + var result; + var Symbol = root.Symbol; + if (typeof Symbol === 'function') { + if (Symbol.observable) { + result = Symbol.observable; + } else { + result = Symbol('observable'); + Symbol.observable = result; + } + } else { + result = '@@observable'; + } -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _utils = __webpack_require__(1); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var WrappedElement = function () { - function WrappedElement(_ref) { - var element = _ref.element, - classNames = _ref.classNames; - - _classCallCheck(this, WrappedElement); - - Object.assign(this, { element: element, classNames: classNames }); - - if (!(0, _utils.isElement)(element)) { - throw new TypeError('Invalid element passed'); - } - - this.isDisabled = false; - } - - _createClass(WrappedElement, [{ - key: 'conceal', - value: function conceal() { - // Hide passed input - this.element.classList.add(this.classNames.input); - this.element.classList.add(this.classNames.hiddenState); - - // Remove element from tab index - this.element.tabIndex = '-1'; - - // Backup original styles if any - var origStyle = this.element.getAttribute('style'); - - if (origStyle) { - this.element.setAttribute('data-choice-orig-style', origStyle); - } - - this.element.setAttribute('aria-hidden', 'true'); - this.element.setAttribute('data-choice', 'active'); - } - }, { - key: 'reveal', - value: function reveal() { - // Reinstate passed element - this.element.classList.remove(this.classNames.input); - this.element.classList.remove(this.classNames.hiddenState); - this.element.removeAttribute('tabindex'); - - // Recover original styles if any - var origStyle = this.element.getAttribute('data-choice-orig-style'); - - if (origStyle) { - this.element.removeAttribute('data-choice-orig-style'); - this.element.setAttribute('style', origStyle); - } else { - this.element.removeAttribute('style'); - } - this.element.removeAttribute('aria-hidden'); - this.element.removeAttribute('data-choice'); - - // Re-assign values - this is weird, I know - this.element.value = this.element.value; - } - }, { - key: 'enable', - value: function enable() { - this.element.removeAttribute('disabled'); - this.element.disabled = false; - this.isDisabled = false; - } - }, { - key: 'disable', - value: function disable() { - this.element.setAttribute('disabled', ''); - this.element.disabled = true; - this.isDisabled = true; - } - }, { - key: 'triggerEvent', - value: function triggerEvent(eventType, data) { - (0, _utils.dispatchEvent)(this.element, eventType, data); - } - }, { - key: 'value', - get: function get() { - return this.element.value; - } - }]); - - return WrappedElement; -}(); - -exports.default = WrappedElement; - -/***/ }), -/* 36 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.TEMPLATES = undefined; - -var _classnames = __webpack_require__(90); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _utils = __webpack_require__(1); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -var TEMPLATES = exports.TEMPLATES = { - containerOuter: function containerOuter(globalClasses, direction, isSelectElement, isSelectOneElement, searchEnabled, passedElementType) { - var tabIndex = isSelectOneElement ? 'tabindex="0"' : ''; - var role = isSelectElement ? 'role="listbox"' : ''; - var ariaAutoComplete = ''; - - if (isSelectElement && searchEnabled) { - role = 'role="combobox"'; - ariaAutoComplete = 'aria-autocomplete="list"'; - } - - return (0, _utils.strToEl)('\n