From 480852372fabdc1274b28b84b227588908a6554a Mon Sep 17 00:00:00 2001 From: Michael Nomitch Date: Thu, 5 Feb 2015 10:28:05 -0600 Subject: [PATCH 01/62] adds amd builds --- .gitignore | 1 - dist/react-tokeninput.js | 655 +++++++++++++++++++++++++++++++ dist/react-tokeninput.js.map | 1 + dist/react-tokeninput.min.js | 2 + dist/react-tokeninput.min.js.map | 1 + package.json | 2 + webpack.config.js | 14 +- 7 files changed, 674 insertions(+), 2 deletions(-) create mode 100644 dist/react-tokeninput.js create mode 100644 dist/react-tokeninput.js.map create mode 100644 dist/react-tokeninput.min.js create mode 100644 dist/react-tokeninput.min.js.map diff --git a/.gitignore b/.gitignore index 49d225f..6c56e6e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,3 @@ node_modules tmp example/bundle.js -*.map diff --git a/dist/react-tokeninput.js b/dist/react-tokeninput.js new file mode 100644 index 0000000..3bf0990 --- /dev/null +++ b/dist/react-tokeninput.js @@ -0,0 +1,655 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("react")); + else if(typeof define === 'function' && define.amd) + define(["react"], factory); + else if(typeof exports === 'object') + exports["TokenInput"] = factory(require("react")); + else + root["TokenInput"] = factory(root["React"]); +})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; +/******/ +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.loaded = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + var TokenInput = __webpack_require__(1) + TokenInput.Option = __webpack_require__(2) + + module.exports = TokenInput + + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + var React = __webpack_require__(3); + var Combobox = React.createFactory(__webpack_require__(4)); + var Token = React.createFactory(__webpack_require__(5)); + + var ul = React.createFactory('ul'); + var li = React.createFactory('li'); + + module.exports = React.createClass({displayName: "exports", + propTypes: { + onInput: React.PropTypes.func, + onSelect: React.PropTypes.func.isRequired, + onRemove: React.PropTypes.func.isRequired, + selected: React.PropTypes.array.isRequired, + menuContent: React.PropTypes.any + }, + + getInitialState: function() { + return { + selectedToken: null + }; + }, + + handleClick: function() { + // TODO: Expand combobox API for focus + this.refs['combo-li'].getDOMNode().querySelector('input').focus(); + }, + + handleInput: function(event) { + this.props.onInput(event); + }, + + handleSelect: function(event) { + this.props.onSelect(event) + this.setState({ + selectedToken: null + }) + }, + + handleRemove: function(value) { + this.props.onRemove(value); + this.refs['combo-li'].getDOMNode().querySelector('input').focus(); + }, + + handleRemoveLast: function() { + this.props.onRemove(this.props.selected[this.props.selected.length - 1]); + }, + + render: function() { + var tokens = this.props.selected.map(function(token) { + return ( + Token({ + onRemove: this.handleRemove, + value: token, + name: token.name, + key: token.id}) + ) + }.bind(this)) + + return ul({className: 'ic-tokens flex', onClick: this.handleClick}, + tokens, + li({className: 'inline-flex', ref: 'combo-li'}, + Combobox({ + id: this.props.id, + 'aria-label': this.props['combobox-aria-label'], + onInput: this.handleInput, + onSelect: this.handleSelect, + onRemoveLast: this.handleRemoveLast, + value: this.state.selectedToken + }, + this.props.menuContent + ) + ) + ); + } + }) + + +/***/ }, +/* 2 */ +/***/ function(module, exports, __webpack_require__) { + + var React = __webpack_require__(3); + var addClass = __webpack_require__(6); + var div = React.createFactory('div'); + + module.exports = React.createClass({displayName: "exports", + + propTypes: { + + /** + * The value that will be sent to the `onSelect` handler of the + * parent Combobox. + */ + value: React.PropTypes.any.isRequired, + + /** + * What value to put into the input element when this option is + * selected, defaults to its children coerced to a string. + */ + label: React.PropTypes.string + }, + + getDefaultProps: function() { + return { + role: 'option', + tabIndex: '-1', + className: 'ic-tokeninput-option', + isSelected: false + }; + }, + + render: function() { + var props = this.props; + if (props.isSelected) { + props.className = addClass(props.className, 'ic-tokeninput-selected'); + props.ariaSelected = true; + } + return div(props); + } + + }); + + +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = __WEBPACK_EXTERNAL_MODULE_3__; + +/***/ }, +/* 4 */ +/***/ function(module, exports, __webpack_require__) { + + var React = __webpack_require__(3); + var guid = 0; + var k = function(){}; + var addClass = __webpack_require__(6); + var ComboboxOption = React.createFactory(__webpack_require__(2)); + + var div = React.createFactory('div'); + var span = React.createFactory('span'); + var input = React.createFactory('input'); + + module.exports = React.createClass({displayName: "exports", + + propTypes: { + /** + * Called when the combobox receives user input, this is your chance to + * filter the data and rerender the options. + * + * Signature: + * + * ```js + * function(userInput){} + * ``` + */ + onInput: React.PropTypes.func, + + /** + * Called when the combobox receives a selection. You probably want to reset + * the options to the full list at this point. + * + * Signature: + * + * ```js + * function(selectedValue){} + * ``` + */ + onSelect: React.PropTypes.func + }, + + getDefaultProps: function() { + return { + autocomplete: 'both', + onInput: k, + onSelect: k, + value: null + }; + }, + + getInitialState: function() { + return { + value: this.props.value, + // the value displayed in the input + inputValue: this.findInitialInputValue(), + isOpen: false, + focusedIndex: null, + matchedAutocompleteOption: null, + // this prevents crazy jumpiness since we focus options on mouseenter + usingKeyboard: false, + activedescendant: null, + listId: 'ic-tokeninput-list-'+(++guid), + menu: { + children: [], + activedescendant: null, + isEmpty: true + } + }; + }, + + componentWillMount: function() { + this.setState({menu: this.makeMenu()}); + }, + + componentWillReceiveProps: function(newProps) { + this.setState({menu: this.makeMenu(newProps.children)}); + }, + + /** + * We don't create the components, the user supplies them, + * so before rendering we attach handlers to facilitate communication from + * the ComboboxOption to the Combobox. + */ + makeMenu: function(children) { + var activedescendant; + var isEmpty = true; + children = children || this.props.children; + React.Children.forEach(children, function(child, index) { + if (child.type !== ComboboxOption.type) + // allow random elements to live in this list + return; + isEmpty = false; + // TODO: cloneWithProps and map instead of altering the children in-place + var props = child.props; + if (this.state.value === props.value) { + // need an ID for WAI-ARIA + props.id = props.id || 'ic-tokeninput-selected-'+(++guid); + props.isSelected = true + activedescendant = props.id; + } + props.onBlur = this.handleOptionBlur; + props.onClick = this.selectOption.bind(this, child); + props.onFocus = this.handleOptionFocus; + props.onKeyDown = this.handleOptionKeyDown.bind(this, child); + props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index); + }.bind(this)); + + if(isEmpty) { + this.hideList(); + } + + return { + children: children, + activedescendant: activedescendant, + isEmpty: isEmpty + }; + }, + + getClassName: function() { + var className = addClass(this.props.className, 'ic-tokeninput'); + if (this.state.isOpen) + className = addClass(className, 'ic-tokeninput-is-open'); + return className; + }, + + /** + * When the user begins typing again we need to clear out any state that has + * to do with an existing or potential selection. + */ + clearSelectedState: function(cb) { + this.setState({ + focusedIndex: null, + inputValue: null, + value: null, + matchedAutocompleteOption: null, + activedescendant: null + }, cb); + }, + + handleInputChange: function(event) { + var value = this.refs.input.getDOMNode().value; + this.clearSelectedState(function() { + this.props.onInput(value); + if (!this.state.isOpen) + this.showList(); + }.bind(this)); + }, + + handleInputBlur: function() { + var focusedAnOption = this.state.focusedIndex != null; + if (focusedAnOption) + return; + this.maybeSelectAutocompletedOption(); + this.hideList(); + }, + + handleOptionBlur: function() { + // don't want to hide the list if we focused another option + this.blurTimer = setTimeout(this.hideList, 0); + }, + + handleOptionFocus: function() { + // see `handleOptionBlur` + clearTimeout(this.blurTimer); + }, + + handleInputKeyUp: function(event) { + if ( + this.state.menu.isEmpty || + // autocompleting while backspacing feels super weird, so let's not + event.keyCode === 8 /*backspace*/ || + !this.props.autocomplete.match(/both|inline/) + ) return; + }, + + handleButtonClick: function() { + this.state.isOpen ? this.hideList() : this.showList(); + this.focusInput(); + }, + + showList: function() { + this.setState({isOpen: true}) + }, + + hideList: function() { + this.setState({isOpen: false}); + }, + + hideOnEscape: function(event) { + this.hideList(); + this.focusInput(); + event.preventDefault(); + }, + + focusInput: function() { + this.refs.input.getDOMNode().focus(); + }, + + selectInput: function() { + this.refs.input.getDOMNode().select(); + }, + + inputKeydownMap: { + 8: 'removeLastToken', + 13: 'selectOnEnter', + 27: 'hideOnEscape', + 38: 'focusPrevious', + 40: 'focusNext' + }, + + optionKeydownMap: { + 13: 'selectOption', + 27: 'hideOnEscape', + 38: 'focusPrevious', + 40: 'focusNext' + }, + + handleKeydown: function(event) { + var handlerName = this.inputKeydownMap[event.keyCode]; + if (!handlerName) + return + this.setState({usingKeyboard: true}); + return this[handlerName].call(this,event); + }, + + handleOptionKeyDown: function(child, event) { + var handlerName = this.optionKeydownMap[event.keyCode]; + if (!handlerName) { + // if the user starts typing again while focused on an option, move focus + // to the inpute, select so it wipes out any existing value + this.selectInput(); + return; + } + event.preventDefault(); + this.setState({usingKeyboard: true}); + this[handlerName].call(this, child); + }, + + handleOptionMouseEnter: function(index) { + if (this.state.usingKeyboard) + this.setState({usingKeyboard: false}); + else + this.focusOptionAtIndex(index); + }, + + selectOnEnter: function(event) { + event.preventDefault(); + this.maybeSelectAutocompletedOption() + }, + + maybeSelectAutocompletedOption: function() { + if (!this.state.matchedAutocompleteOption) { + this.selectText() + } else { + this.selectOption(this.state.matchedAutocompleteOption, {focus: false}); + } + }, + + selectOption: function(child, options) { + options = options || {}; + this.setState({ + // value: child.props.value, + // inputValue: getLabel(child), + matchedAutocompleteOption: null + }, function() { + this.props.onSelect(child.props.value, child); + this.hideList(); + this.clearSelectedState(); // added + if (options.focus !== false) + this.selectInput(); + }.bind(this)); + this.refs.input.getDOMNode().value = '' // added + }, + + selectText: function() { + var value = this.refs.input.getDOMNode().value; + if(!value) return; + this.props.onSelect(value); + this.clearSelectedState(); + this.refs.input.getDOMNode().value = '' // added + }, + + focusNext: function(event) { + if(event.preventDefault) event.preventDefault(); + if (this.state.menu.isEmpty) return; + var index = this.state.focusedIndex == null ? + 0 : this.state.focusedIndex + 1; + this.focusOptionAtIndex(index); + }, + + removeLastToken: function() { + if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) { + this.props.onRemoveLast() + } + return true + }, + + focusPrevious: function(event) { + if(event.preventDefault) event.preventDefault(); + if (this.state.menu.isEmpty) return; + var last = this.props.children.length - 1; + var index = this.state.focusedIndex == null ? + last : this.state.focusedIndex - 1; + this.focusOptionAtIndex(index); + }, + + focusSelectedOption: function() { + var selectedIndex; + React.Children.forEach(this.props.children, function(child, index) { + if (child.props.value === this.state.value) + selectedIndex = index; + }.bind(this)); + this.showList(); + this.setState({ + focusedIndex: selectedIndex + }, this.focusOption); + }, + + findInitialInputValue: function() { + // TODO: might not need this, we should know this in `makeMenu` + var inputValue; + React.Children.forEach(this.props.children, function(child) { + if (child.props.value === this.props.value) + inputValue = getLabel(child); + }.bind(this)); + return inputValue; + }, + + focusOptionAtIndex: function(index) { + if (!this.state.isOpen && this.state.value) + return this.focusSelectedOption(); + this.showList(); + var length = this.props.children.length; + if (index === -1) + index = length - 1; + else if (index === length) + index = 0; + this.setState({ + focusedIndex: index + }, this.focusOption); + }, + + focusOption: function() { + var index = this.state.focusedIndex; + this.refs.list.getDOMNode().childNodes[index].focus(); + }, + + render: function() { + var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' + + 'Press the down arrow to navigate results. If you don\'t find an ' + + 'acceptable option, you can enter an alternative.' + + return div({className: this.getClassName()}, + this.props.value, + this.state.inputValue, + input({ + ref: 'input', + autoComplete: 'off', + spellCheck: 'false', + 'aria-label': ariaLabel, + 'aria-expanded': this.state.isOpen+'', + 'aria-haspopup': 'true', + 'aria-activedescendant': this.state.menu.activedescendant, + 'aria-autocomplete': 'list', + 'aria-owns': this.state.listId, + id: this.props.id, + className: 'ic-tokeninput-input', + onChange: this.handleInputChange, + onBlur: this.handleInputBlur, + onKeyDown: this.handleKeydown, + onKeyUp: this.handleInputKeyUp, + role: 'combobox' + }), + span({ + 'aria-hidden': 'true', + className: 'ic-tokeninput-button', + onClick: this.handleButtonClick + }, '▾'), + div({ + id: this.state.listId, + ref: 'list', + className: 'ic-tokeninput-list', + role: 'listbox' + }, this.state.menu.children) + ); + } + }); + + function getLabel(component) { + return component.props.label || component.props.children; + } + + function matchFragment(userInput, firstChildLabel) { + userInput = userInput.toLowerCase(); + firstChildLabel = firstChildLabel.toLowerCase(); + if (userInput === '' || userInput === firstChildLabel) + return false; + if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1) + return false; + return true; + } + + +/***/ }, +/* 5 */ +/***/ function(module, exports, __webpack_require__) { + + var React = __webpack_require__(3); + var span = React.DOM.span; + var li = React.createFactory('li'); + + module.exports = React.createClass({displayName: "exports", + handleClick: function() { + this.props.onRemove(this.props.value) + }, + + handleKeyDown: function(key) { + var enterKey = 13; + if(key.keyCode === enterKey) this.props.onRemove(this.props.value) + }, + + render: function() { + return ( + li({ + className: "ic-token inline-flex" + }, + span({ + role: 'button', + onClick: this.handleClick, + onKeyDown: this.handleKeyDown, + 'aria-label': 'Remove \'' + this.props.name + '\'', + className: "ic-token-delete-button", + tabIndex: 0 + }, "✕"), + span({className: "ic-token-label"}, this.props.name) + ) + ) + } + }) + + +/***/ }, +/* 6 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = addClass; + + function addClass(existing, added) { + if (!existing) return added; + if (existing.indexOf(added) > -1) return existing; + return existing + ' ' + added; + } + + +/***/ } +/******/ ]) +}); + +//# sourceMappingURL=react-tokeninput.js.map \ No newline at end of file diff --git a/dist/react-tokeninput.js.map b/dist/react-tokeninput.js.map new file mode 100644 index 0000000..ef89c9c --- /dev/null +++ b/dist/react-tokeninput.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 8996b849546d6e6b1f74","webpack:///./index.js","webpack:///./lib/main.js","webpack:///./lib/option.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///./lib/combobox.js","webpack:///./lib/token.js","webpack:///./lib/add-class.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,wC;;;;;;;ACtCA,KAAI,UAAU,GAAG,mBAAO,CAAC,CAAY,CAAC;AACtC,WAAU,CAAC,MAAM,GAAG,mBAAO,CAAC,CAAc,CAAC;;AAE3C,OAAM,CAAC,OAAO,GAAG,UAAU;;;;;;;ACH3B,KAAI,KAAK,GAAG,mBAAO,CAAC,CAAO,CAAC,CAAC;AAC7B,KAAI,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,mBAAO,CAAC,CAAY,CAAC,CAAC,CAAC;AAC1D,KAAI,KAAK,GAAG,KAAK,CAAC,aAAa,CAAC,mBAAO,CAAC,CAAS,CAAC,CAAC,CAAC;;AAEpD,KAAI,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;AACnC,KAAI,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;;AAEnC,qCAAoC;GAClC,SAAS,EAAE;KACT,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI;KAC7B,QAAQ,EAAE,KAAK,CAAC,SA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ACnC,QAAQ,EAAE,CAAC;UACZ,EAAE,GAAG,CAAC;SACP,IAAI,CAAC,CAAC,SAAS,EAAE,gBAAgB,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;QACrD;MACF;IACF;EACF,CAAC;;;;;;;AC/BF,OAAM,CAAC,OAAO,GAAG,QAAQ,CAAC;;AAE1B,UAAS,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAE;GACjC,IAAI,CAAC,QAAQ,EAAE,OAAO,KAAK,CAAC;GAC5B,IAAI,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,QAAQ,CAAC;GAClD,OAAO,QAAQ,GAAG,GAAG,GAAG,KAAK,CAAC;EAC/B","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TokenInput\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"TokenInput\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 8996b849546d6e6b1f74\n **/","var TokenInput = require('./lib/main')\nTokenInput.Option = require('./lib/option')\n\nmodule.exports = TokenInput\n\n\n\n/** WEBPACK FOOTER **\n ** ./index.js\n **/","var React = require('react');\nvar Combobox = React.createFactory(require('./combobox'));\nvar Token = React.createFactory(require('./token'));\n\nvar ul = React.createFactory('ul');\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n propTypes: {\n onInput: React.PropTypes.func,\n onSelect: React.PropTypes.func.isRequired,\n onRemove: React.PropTypes.func.isRequired,\n selected: React.PropTypes.array.isRequired,\n menuContent: React.PropTypes.any\n },\n\n getInitialState: function() {\n return {\n selectedToken: null\n };\n },\n\n handleClick: function() {\n // TODO: Expand combobox API for focus\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleInput: function(event) {\n this.props.onInput(event);\n },\n\n handleSelect: function(event) {\n this.props.onSelect(event)\n this.setState({\n selectedToken: null\n })\n },\n\n handleRemove: function(value) {\n this.props.onRemove(value);\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleRemoveLast: function() {\n this.props.onRemove(this.props.selected[this.props.selected.length - 1]);\n },\n\n render: function() {\n var tokens = this.props.selected.map(function(token) {\n return (\n Token({\n onRemove: this.handleRemove,\n value: token,\n name: token.name,\n key: token.id})\n )\n }.bind(this))\n\n return ul({className: 'ic-tokens flex', onClick: this.handleClick},\n tokens,\n li({className: 'inline-flex', ref: 'combo-li'},\n Combobox({\n id: this.props.id,\n 'aria-label': this.props['combobox-aria-label'],\n onInput: this.handleInput,\n onSelect: this.handleSelect,\n onRemoveLast: this.handleRemoveLast,\n value: this.state.selectedToken\n },\n this.props.menuContent\n )\n )\n );\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/main.js\n **/","var React = require('react');\nvar addClass = require('./add-class');\nvar div = React.createFactory('div');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n\n /**\n * The value that will be sent to the `onSelect` handler of the\n * parent Combobox.\n */\n value: React.PropTypes.any.isRequired,\n\n /**\n * What value to put into the input element when this option is\n * selected, defaults to its children coerced to a string.\n */\n label: React.PropTypes.string\n },\n\n getDefaultProps: function() {\n return {\n role: 'option',\n tabIndex: '-1',\n className: 'ic-tokeninput-option',\n isSelected: false\n };\n },\n\n render: function() {\n var props = this.props;\n if (props.isSelected) {\n props.className = addClass(props.className, 'ic-tokeninput-selected');\n props.ariaSelected = true;\n }\n return div(props);\n }\n\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/option.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n ** module id = 3\n ** module chunks = 0\n **/","var React = require('react');\nvar guid = 0;\nvar k = function(){};\nvar addClass = require('./add-class');\nvar ComboboxOption = React.createFactory(require('./option'));\n\nvar div = React.createFactory('div');\nvar span = React.createFactory('span');\nvar input = React.createFactory('input');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n /**\n * Called when the combobox receives user input, this is your chance to\n * filter the data and rerender the options.\n *\n * Signature:\n *\n * ```js\n * function(userInput){}\n * ```\n */\n onInput: React.PropTypes.func,\n\n /**\n * Called when the combobox receives a selection. You probably want to reset\n * the options to the full list at this point.\n *\n * Signature:\n *\n * ```js\n * function(selectedValue){}\n * ```\n */\n onSelect: React.PropTypes.func\n },\n\n getDefaultProps: function() {\n return {\n autocomplete: 'both',\n onInput: k,\n onSelect: k,\n value: null\n };\n },\n\n getInitialState: function() {\n return {\n value: this.props.value,\n // the value displayed in the input\n inputValue: this.findInitialInputValue(),\n isOpen: false,\n focusedIndex: null,\n matchedAutocompleteOption: null,\n // this prevents crazy jumpiness since we focus options on mouseenter\n usingKeyboard: false,\n activedescendant: null,\n listId: 'ic-tokeninput-list-'+(++guid),\n menu: {\n children: [],\n activedescendant: null,\n isEmpty: true\n }\n };\n },\n\n componentWillMount: function() {\n this.setState({menu: this.makeMenu()});\n },\n\n componentWillReceiveProps: function(newProps) {\n this.setState({menu: this.makeMenu(newProps.children)});\n },\n\n /**\n * We don't create the components, the user supplies them,\n * so before rendering we attach handlers to facilitate communication from\n * the ComboboxOption to the Combobox.\n */\n makeMenu: function(children) {\n var activedescendant;\n var isEmpty = true;\n children = children || this.props.children;\n React.Children.forEach(children, function(child, index) {\n if (child.type !== ComboboxOption.type)\n // allow random elements to live in this list\n return;\n isEmpty = false;\n // TODO: cloneWithProps and map instead of altering the children in-place\n var props = child.props;\n if (this.state.value === props.value) {\n // need an ID for WAI-ARIA\n props.id = props.id || 'ic-tokeninput-selected-'+(++guid);\n props.isSelected = true\n activedescendant = props.id;\n }\n props.onBlur = this.handleOptionBlur;\n props.onClick = this.selectOption.bind(this, child);\n props.onFocus = this.handleOptionFocus;\n props.onKeyDown = this.handleOptionKeyDown.bind(this, child);\n props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index);\n }.bind(this));\n\n if(isEmpty) {\n this.hideList();\n }\n\n return {\n children: children,\n activedescendant: activedescendant,\n isEmpty: isEmpty\n };\n },\n\n getClassName: function() {\n var className = addClass(this.props.className, 'ic-tokeninput');\n if (this.state.isOpen)\n className = addClass(className, 'ic-tokeninput-is-open');\n return className;\n },\n\n /**\n * When the user begins typing again we need to clear out any state that has\n * to do with an existing or potential selection.\n */\n clearSelectedState: function(cb) {\n this.setState({\n focusedIndex: null,\n inputValue: null,\n value: null,\n matchedAutocompleteOption: null,\n activedescendant: null\n }, cb);\n },\n\n handleInputChange: function(event) {\n var value = this.refs.input.getDOMNode().value;\n this.clearSelectedState(function() {\n this.props.onInput(value);\n if (!this.state.isOpen)\n this.showList();\n }.bind(this));\n },\n\n handleInputBlur: function() {\n var focusedAnOption = this.state.focusedIndex != null;\n if (focusedAnOption)\n return;\n this.maybeSelectAutocompletedOption();\n this.hideList();\n },\n\n handleOptionBlur: function() {\n // don't want to hide the list if we focused another option\n this.blurTimer = setTimeout(this.hideList, 0);\n },\n\n handleOptionFocus: function() {\n // see `handleOptionBlur`\n clearTimeout(this.blurTimer);\n },\n\n handleInputKeyUp: function(event) {\n if (\n this.state.menu.isEmpty ||\n // autocompleting while backspacing feels super weird, so let's not\n event.keyCode === 8 /*backspace*/ ||\n !this.props.autocomplete.match(/both|inline/)\n ) return;\n },\n\n handleButtonClick: function() {\n this.state.isOpen ? this.hideList() : this.showList();\n this.focusInput();\n },\n\n showList: function() {\n this.setState({isOpen: true})\n },\n\n hideList: function() {\n this.setState({isOpen: false});\n },\n\n hideOnEscape: function(event) {\n this.hideList();\n this.focusInput();\n event.preventDefault();\n },\n\n focusInput: function() {\n this.refs.input.getDOMNode().focus();\n },\n\n selectInput: function() {\n this.refs.input.getDOMNode().select();\n },\n\n inputKeydownMap: {\n 8: 'removeLastToken',\n 13: 'selectOnEnter',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n optionKeydownMap: {\n 13: 'selectOption',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n handleKeydown: function(event) {\n var handlerName = this.inputKeydownMap[event.keyCode];\n if (!handlerName)\n return\n this.setState({usingKeyboard: true});\n return this[handlerName].call(this,event);\n },\n\n handleOptionKeyDown: function(child, event) {\n var handlerName = this.optionKeydownMap[event.keyCode];\n if (!handlerName) {\n // if the user starts typing again while focused on an option, move focus\n // to the inpute, select so it wipes out any existing value\n this.selectInput();\n return;\n }\n event.preventDefault();\n this.setState({usingKeyboard: true});\n this[handlerName].call(this, child);\n },\n\n handleOptionMouseEnter: function(index) {\n if (this.state.usingKeyboard)\n this.setState({usingKeyboard: false});\n else\n this.focusOptionAtIndex(index);\n },\n\n selectOnEnter: function(event) {\n event.preventDefault();\n this.maybeSelectAutocompletedOption()\n },\n\n maybeSelectAutocompletedOption: function() {\n if (!this.state.matchedAutocompleteOption) {\n this.selectText()\n } else {\n this.selectOption(this.state.matchedAutocompleteOption, {focus: false});\n }\n },\n\n selectOption: function(child, options) {\n options = options || {};\n this.setState({\n // value: child.props.value,\n // inputValue: getLabel(child),\n matchedAutocompleteOption: null\n }, function() {\n this.props.onSelect(child.props.value, child);\n this.hideList();\n this.clearSelectedState(); // added\n if (options.focus !== false)\n this.selectInput();\n }.bind(this));\n this.refs.input.getDOMNode().value = '' // added\n },\n\n selectText: function() {\n var value = this.refs.input.getDOMNode().value;\n if(!value) return;\n this.props.onSelect(value);\n this.clearSelectedState();\n this.refs.input.getDOMNode().value = '' // added\n },\n\n focusNext: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var index = this.state.focusedIndex == null ?\n 0 : this.state.focusedIndex + 1;\n this.focusOptionAtIndex(index);\n },\n\n removeLastToken: function() {\n if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) {\n this.props.onRemoveLast()\n }\n return true\n },\n\n focusPrevious: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var last = this.props.children.length - 1;\n var index = this.state.focusedIndex == null ?\n last : this.state.focusedIndex - 1;\n this.focusOptionAtIndex(index);\n },\n\n focusSelectedOption: function() {\n var selectedIndex;\n React.Children.forEach(this.props.children, function(child, index) {\n if (child.props.value === this.state.value)\n selectedIndex = index;\n }.bind(this));\n this.showList();\n this.setState({\n focusedIndex: selectedIndex\n }, this.focusOption);\n },\n\n findInitialInputValue: function() {\n // TODO: might not need this, we should know this in `makeMenu`\n var inputValue;\n React.Children.forEach(this.props.children, function(child) {\n if (child.props.value === this.props.value)\n inputValue = getLabel(child);\n }.bind(this));\n return inputValue;\n },\n\n focusOptionAtIndex: function(index) {\n if (!this.state.isOpen && this.state.value)\n return this.focusSelectedOption();\n this.showList();\n var length = this.props.children.length;\n if (index === -1)\n index = length - 1;\n else if (index === length)\n index = 0;\n this.setState({\n focusedIndex: index\n }, this.focusOption);\n },\n\n focusOption: function() {\n var index = this.state.focusedIndex;\n this.refs.list.getDOMNode().childNodes[index].focus();\n },\n\n render: function() {\n var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' +\n 'Press the down arrow to navigate results. If you don\\'t find an ' +\n 'acceptable option, you can enter an alternative.'\n\n return div({className: this.getClassName()},\n this.props.value,\n this.state.inputValue,\n input({\n ref: 'input',\n autoComplete: 'off',\n spellCheck: 'false',\n 'aria-label': ariaLabel,\n 'aria-expanded': this.state.isOpen+'',\n 'aria-haspopup': 'true',\n 'aria-activedescendant': this.state.menu.activedescendant,\n 'aria-autocomplete': 'list',\n 'aria-owns': this.state.listId,\n id: this.props.id,\n className: 'ic-tokeninput-input',\n onChange: this.handleInputChange,\n onBlur: this.handleInputBlur,\n onKeyDown: this.handleKeydown,\n onKeyUp: this.handleInputKeyUp,\n role: 'combobox'\n }),\n span({\n 'aria-hidden': 'true',\n className: 'ic-tokeninput-button',\n onClick: this.handleButtonClick\n }, '▾'),\n div({\n id: this.state.listId,\n ref: 'list',\n className: 'ic-tokeninput-list',\n role: 'listbox'\n }, this.state.menu.children)\n );\n }\n});\n\nfunction getLabel(component) {\n return component.props.label || component.props.children;\n}\n\nfunction matchFragment(userInput, firstChildLabel) {\n userInput = userInput.toLowerCase();\n firstChildLabel = firstChildLabel.toLowerCase();\n if (userInput === '' || userInput === firstChildLabel)\n return false;\n if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1)\n return false;\n return true;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/combobox.js\n **/","var React = require('react');\nvar span = React.DOM.span;\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n handleClick: function() {\n this.props.onRemove(this.props.value)\n },\n\n handleKeyDown: function(key) {\n var enterKey = 13;\n if(key.keyCode === enterKey) this.props.onRemove(this.props.value)\n },\n\n render: function() {\n return (\n li({\n className: \"ic-token inline-flex\"\n },\n span({\n role: 'button',\n onClick: this.handleClick,\n onKeyDown: this.handleKeyDown,\n 'aria-label': 'Remove \\'' + this.props.name + '\\'',\n className: \"ic-token-delete-button\",\n tabIndex: 0\n }, \"✕\"),\n span({className: \"ic-token-label\"}, this.props.name)\n )\n )\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/token.js\n **/","module.exports = addClass;\n\nfunction addClass(existing, added) {\n if (!existing) return added;\n if (existing.indexOf(added) > -1) return existing;\n return existing + ' ' + added;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/add-class.js\n **/"],"sourceRoot":"","file":"react-tokeninput.js"} \ No newline at end of file diff --git a/dist/react-tokeninput.min.js b/dist/react-tokeninput.min.js new file mode 100644 index 0000000..7ffd4f1 --- /dev/null +++ b/dist/react-tokeninput.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.TokenInput=t(require("react")):e.TokenInput=t(e.React)}(this,function(e){return function(e){function t(i){if(n[i])return n[i].exports;var s=n[i]={exports:{},id:i,loaded:!1};return e[i].call(s.exports,s,s.exports,t),s.loaded=!0,s.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var i=n(1);i.Option=n(2),e.exports=i},function(e,t,n){var i=n(3),s=i.createFactory(n(4)),o=i.createFactory(n(5)),a=i.createFactory("ul"),u=i.createFactory("li");e.exports=i.createClass({displayName:"exports",propTypes:{onInput:i.PropTypes.func,onSelect:i.PropTypes.func.isRequired,onRemove:i.PropTypes.func.isRequired,selected:i.PropTypes.array.isRequired,menuContent:i.PropTypes.any},getInitialState:function(){return{selectedToken:null}},handleClick:function(){this.refs["combo-li"].getDOMNode().querySelector("input").focus()},handleInput:function(e){this.props.onInput(e)},handleSelect:function(e){this.props.onSelect(e),this.setState({selectedToken:null})},handleRemove:function(e){this.props.onRemove(e),this.refs["combo-li"].getDOMNode().querySelector("input").focus()},handleRemoveLast:function(){this.props.onRemove(this.props.selected[this.props.selected.length-1])},render:function(){var e=this.props.selected.map(function(e){return o({onRemove:this.handleRemove,value:e,name:e.name,key:e.id})}.bind(this));return a({className:"ic-tokens flex",onClick:this.handleClick},e,u({className:"inline-flex",ref:"combo-li"},s({id:this.props.id,"aria-label":this.props["combobox-aria-label"],onInput:this.handleInput,onSelect:this.handleSelect,onRemoveLast:this.handleRemoveLast,value:this.state.selectedToken},this.props.menuContent)))}})},function(e,t,n){var i=n(3),s=n(6),o=i.createFactory("div");e.exports=i.createClass({displayName:"exports",propTypes:{value:i.PropTypes.any.isRequired,label:i.PropTypes.string},getDefaultProps:function(){return{role:"option",tabIndex:"-1",className:"ic-tokeninput-option",isSelected:!1}},render:function(){var e=this.props;return e.isSelected&&(e.className=s(e.className,"ic-tokeninput-selected"),e.ariaSelected=!0),o(e)}})},function(t){t.exports=e},function(e,t,n){function i(e){return e.props.label||e.props.children}var s=n(3),o=0,a=function(){},u=n(6),c=s.createFactory(n(2)),l=s.createFactory("div"),r=s.createFactory("span"),p=s.createFactory("input");e.exports=s.createClass({displayName:"exports",propTypes:{onInput:s.PropTypes.func,onSelect:s.PropTypes.func},getDefaultProps:function(){return{autocomplete:"both",onInput:a,onSelect:a,value:null}},getInitialState:function(){return{value:this.props.value,inputValue:this.findInitialInputValue(),isOpen:!1,focusedIndex:null,matchedAutocompleteOption:null,usingKeyboard:!1,activedescendant:null,listId:"ic-tokeninput-list-"+ ++o,menu:{children:[],activedescendant:null,isEmpty:!0}}},componentWillMount:function(){this.setState({menu:this.makeMenu()})},componentWillReceiveProps:function(e){this.setState({menu:this.makeMenu(e.children)})},makeMenu:function(e){var t,n=!0;return e=e||this.props.children,s.Children.forEach(e,function(e,i){if(e.type===c.type){n=!1;var s=e.props;this.state.value===s.value&&(s.id=s.id||"ic-tokeninput-selected-"+ ++o,s.isSelected=!0,t=s.id),s.onBlur=this.handleOptionBlur,s.onClick=this.selectOption.bind(this,e),s.onFocus=this.handleOptionFocus,s.onKeyDown=this.handleOptionKeyDown.bind(this,e),s.onMouseEnter=this.handleOptionMouseEnter.bind(this,i)}}.bind(this)),n&&this.hideList(),{children:e,activedescendant:t,isEmpty:n}},getClassName:function(){var e=u(this.props.className,"ic-tokeninput");return this.state.isOpen&&(e=u(e,"ic-tokeninput-is-open")),e},clearSelectedState:function(e){this.setState({focusedIndex:null,inputValue:null,value:null,matchedAutocompleteOption:null,activedescendant:null},e)},handleInputChange:function(){var e=this.refs.input.getDOMNode().value;this.clearSelectedState(function(){this.props.onInput(e),this.state.isOpen||this.showList()}.bind(this))},handleInputBlur:function(){var e=null!=this.state.focusedIndex;e||(this.maybeSelectAutocompletedOption(),this.hideList())},handleOptionBlur:function(){this.blurTimer=setTimeout(this.hideList,0)},handleOptionFocus:function(){clearTimeout(this.blurTimer)},handleInputKeyUp:function(e){this.state.menu.isEmpty||8===e.keyCode||!this.props.autocomplete.match(/both|inline/)},handleButtonClick:function(){this.state.isOpen?this.hideList():this.showList(),this.focusInput()},showList:function(){this.setState({isOpen:!0})},hideList:function(){this.setState({isOpen:!1})},hideOnEscape:function(e){this.hideList(),this.focusInput(),e.preventDefault()},focusInput:function(){this.refs.input.getDOMNode().focus()},selectInput:function(){this.refs.input.getDOMNode().select()},inputKeydownMap:{8:"removeLastToken",13:"selectOnEnter",27:"hideOnEscape",38:"focusPrevious",40:"focusNext"},optionKeydownMap:{13:"selectOption",27:"hideOnEscape",38:"focusPrevious",40:"focusNext"},handleKeydown:function(e){var t=this.inputKeydownMap[e.keyCode];if(t)return this.setState({usingKeyboard:!0}),this[t].call(this,e)},handleOptionKeyDown:function(e,t){var n=this.optionKeydownMap[t.keyCode];return n?(t.preventDefault(),this.setState({usingKeyboard:!0}),void this[n].call(this,e)):void this.selectInput()},handleOptionMouseEnter:function(e){this.state.usingKeyboard?this.setState({usingKeyboard:!1}):this.focusOptionAtIndex(e)},selectOnEnter:function(e){e.preventDefault(),this.maybeSelectAutocompletedOption()},maybeSelectAutocompletedOption:function(){this.state.matchedAutocompleteOption?this.selectOption(this.state.matchedAutocompleteOption,{focus:!1}):this.selectText()},selectOption:function(e,t){t=t||{},this.setState({matchedAutocompleteOption:null},function(){this.props.onSelect(e.props.value,e),this.hideList(),this.clearSelectedState(),t.focus!==!1&&this.selectInput()}.bind(this)),this.refs.input.getDOMNode().value=""},selectText:function(){var e=this.refs.input.getDOMNode().value;e&&(this.props.onSelect(e),this.clearSelectedState(),this.refs.input.getDOMNode().value="")},focusNext:function(e){if(e.preventDefault&&e.preventDefault(),!this.state.menu.isEmpty){var t=null==this.state.focusedIndex?0:this.state.focusedIndex+1;this.focusOptionAtIndex(t)}},removeLastToken:function(){return this.props.onRemoveLast&&!this.refs.input.getDOMNode().value&&this.props.onRemoveLast(),!0},focusPrevious:function(e){if(e.preventDefault&&e.preventDefault(),!this.state.menu.isEmpty){var t=this.props.children.length-1,n=null==this.state.focusedIndex?t:this.state.focusedIndex-1;this.focusOptionAtIndex(n)}},focusSelectedOption:function(){var e;s.Children.forEach(this.props.children,function(t,n){t.props.value===this.state.value&&(e=n)}.bind(this)),this.showList(),this.setState({focusedIndex:e},this.focusOption)},findInitialInputValue:function(){var e;return s.Children.forEach(this.props.children,function(t){t.props.value===this.props.value&&(e=i(t))}.bind(this)),e},focusOptionAtIndex:function(e){if(!this.state.isOpen&&this.state.value)return this.focusSelectedOption();this.showList();var t=this.props.children.length;-1===e?e=t-1:e===t&&(e=0),this.setState({focusedIndex:e},this.focusOption)},focusOption:function(){var e=this.state.focusedIndex;this.refs.list.getDOMNode().childNodes[e].focus()},render:function(){var e=this.props["aria-label"]||"Start typing to search. Press the down arrow to navigate results. If you don't find an acceptable option, you can enter an alternative.";return l({className:this.getClassName()},this.props.value,this.state.inputValue,p({ref:"input",autoComplete:"off",spellCheck:"false","aria-label":e,"aria-expanded":this.state.isOpen+"","aria-haspopup":"true","aria-activedescendant":this.state.menu.activedescendant,"aria-autocomplete":"list","aria-owns":this.state.listId,id:this.props.id,className:"ic-tokeninput-input",onChange:this.handleInputChange,onBlur:this.handleInputBlur,onKeyDown:this.handleKeydown,onKeyUp:this.handleInputKeyUp,role:"combobox"}),r({"aria-hidden":"true",className:"ic-tokeninput-button",onClick:this.handleButtonClick},"▾"),l({id:this.state.listId,ref:"list",className:"ic-tokeninput-list",role:"listbox"},this.state.menu.children))}})},function(e,t,n){var i=n(3),s=i.DOM.span,o=i.createFactory("li");e.exports=i.createClass({displayName:"exports",handleClick:function(){this.props.onRemove(this.props.value)},handleKeyDown:function(e){var t=13;e.keyCode===t&&this.props.onRemove(this.props.value)},render:function(){return o({className:"ic-token inline-flex"},s({role:"button",onClick:this.handleClick,onKeyDown:this.handleKeyDown,"aria-label":"Remove '"+this.props.name+"'",className:"ic-token-delete-button",tabIndex:0},"✕"),s({className:"ic-token-label"},this.props.name))}})},function(e){function t(e,t){return e?e.indexOf(t)>-1?e:e+" "+t:t}e.exports=t}])}); +//# sourceMappingURL=react-tokeninput.min.js.map \ No newline at end of file diff --git a/dist/react-tokeninput.min.js.map b/dist/react-tokeninput.min.js.map new file mode 100644 index 0000000..764b158 --- /dev/null +++ b/dist/react-tokeninput.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///react-tokeninput.min.js","webpack:///webpack/bootstrap 97c5893b87d8e540f8e7","webpack:///./index.js","webpack:///./lib/main.js","webpack:///./lib/option.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///./lib/combobox.js","webpack:///./lib/token.js","webpack:///./lib/add-class.js"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_3__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","TokenInput","Option","React","Combobox","createFactory","Token","ul","li","createClass","displayName","propTypes","onInput","PropTypes","func","onSelect","isRequired","onRemove","selected","array","menuContent","any","getInitialState","selectedToken","handleClick","refs","getDOMNode","querySelector","focus","handleInput","event","props","handleSelect","setState","handleRemove","value","handleRemoveLast","length","render","tokens","map","token","name","key","bind","className","onClick","ref","aria-label","onRemoveLast","state","addClass","div","label","string","getDefaultProps","role","tabIndex","isSelected","ariaSelected","getLabel","component","children","guid","k","ComboboxOption","span","input","autocomplete","inputValue","findInitialInputValue","isOpen","focusedIndex","matchedAutocompleteOption","usingKeyboard","activedescendant","listId","menu","isEmpty","componentWillMount","makeMenu","componentWillReceiveProps","newProps","Children","forEach","child","index","type","onBlur","handleOptionBlur","selectOption","onFocus","handleOptionFocus","onKeyDown","handleOptionKeyDown","onMouseEnter","handleOptionMouseEnter","hideList","getClassName","clearSelectedState","cb","handleInputChange","showList","handleInputBlur","focusedAnOption","maybeSelectAutocompletedOption","blurTimer","setTimeout","clearTimeout","handleInputKeyUp","keyCode","match","handleButtonClick","focusInput","hideOnEscape","preventDefault","selectInput","select","inputKeydownMap",8,13,27,38,40,"optionKeydownMap","handleKeydown","handlerName","focusOptionAtIndex","selectOnEnter","selectText","options","focusNext","removeLastToken","focusPrevious","last","focusSelectedOption","selectedIndex","focusOption","list","childNodes","ariaLabel","autoComplete","spellCheck","aria-expanded","aria-haspopup","aria-activedescendant","aria-autocomplete","aria-owns","onChange","onKeyUp","aria-hidden","DOM","handleKeyDown","enterKey","existing","added","indexOf"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,UACA,kBAAAC,gBAAAC,IACAD,QAAA,SAAAJ,GACA,gBAAAC,SACAA,QAAA,WAAAD,EAAAG,QAAA,UAEAJ,EAAA,WAAAC,EAAAD,EAAA,QACCO,KAAA,SAAAC,GACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAT,OAGA,IAAAC,GAAAS,EAAAD,IACAT,WACAW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zD,KAAKmC,YACdqE,UAAWxG,KAAKmK,cAChBxG,aAAc,WAAc3D,KAAK0C,MAAMW,KAAO,IAC9CG,UAAW,yBACXY,SAAU,GACT,KACHS,GAAMrB,UAAW,kBAAmBxD,KAAK0C,MAAMW,WPomBjD,SAASzD,GQ7nBf,QAASkE,GAASuG,EAAUC,GAC1B,MAAKD,GACDA,EAASE,QAAQD,GAAS,GAAWD,EAClCA,EAAW,IAAMC,EAFFA,EAHxB1K,EAAOD,QAAUmE","file":"react-tokeninput.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TokenInput\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"TokenInput\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TokenInput\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"TokenInput\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar TokenInput = __webpack_require__(1)\n\tTokenInput.Option = __webpack_require__(2)\n\t\n\tmodule.exports = TokenInput\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar Combobox = React.createFactory(__webpack_require__(4));\n\tvar Token = React.createFactory(__webpack_require__(5));\n\t\n\tvar ul = React.createFactory('ul');\n\tvar li = React.createFactory('li');\n\t\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\t propTypes: {\n\t onInput: React.PropTypes.func,\n\t onSelect: React.PropTypes.func.isRequired,\n\t onRemove: React.PropTypes.func.isRequired,\n\t selected: React.PropTypes.array.isRequired,\n\t menuContent: React.PropTypes.any\n\t },\n\t\n\t getInitialState: function() {\n\t return {\n\t selectedToken: null\n\t };\n\t },\n\t\n\t handleClick: function() {\n\t // TODO: Expand combobox API for focus\n\t this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n\t },\n\t\n\t handleInput: function(event) {\n\t this.props.onInput(event);\n\t },\n\t\n\t handleSelect: function(event) {\n\t this.props.onSelect(event)\n\t this.setState({\n\t selectedToken: null\n\t })\n\t },\n\t\n\t handleRemove: function(value) {\n\t this.props.onRemove(value);\n\t this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n\t },\n\t\n\t handleRemoveLast: function() {\n\t this.props.onRemove(this.props.selected[this.props.selected.length - 1]);\n\t },\n\t\n\t render: function() {\n\t var tokens = this.props.selected.map(function(token) {\n\t return (\n\t Token({\n\t onRemove: this.handleRemove,\n\t value: token,\n\t name: token.name,\n\t key: token.id})\n\t )\n\t }.bind(this))\n\t\n\t return ul({className: 'ic-tokens flex', onClick: this.handleClick},\n\t tokens,\n\t li({className: 'inline-flex', ref: 'combo-li'},\n\t Combobox({\n\t id: this.props.id,\n\t 'aria-label': this.props['combobox-aria-label'],\n\t onInput: this.handleInput,\n\t onSelect: this.handleSelect,\n\t onRemoveLast: this.handleRemoveLast,\n\t value: this.state.selectedToken\n\t },\n\t this.props.menuContent\n\t )\n\t )\n\t );\n\t }\n\t})\n\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar addClass = __webpack_require__(6);\n\tvar div = React.createFactory('div');\n\t\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\t\n\t propTypes: {\n\t\n\t /**\n\t * The value that will be sent to the `onSelect` handler of the\n\t * parent Combobox.\n\t */\n\t value: React.PropTypes.any.isRequired,\n\t\n\t /**\n\t * What value to put into the input element when this option is\n\t * selected, defaults to its children coerced to a string.\n\t */\n\t label: React.PropTypes.string\n\t },\n\t\n\t getDefaultProps: function() {\n\t return {\n\t role: 'option',\n\t tabIndex: '-1',\n\t className: 'ic-tokeninput-option',\n\t isSelected: false\n\t };\n\t },\n\t\n\t render: function() {\n\t var props = this.props;\n\t if (props.isSelected) {\n\t props.className = addClass(props.className, 'ic-tokeninput-selected');\n\t props.ariaSelected = true;\n\t }\n\t return div(props);\n\t }\n\t\n\t});\n\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar guid = 0;\n\tvar k = function(){};\n\tvar addClass = __webpack_require__(6);\n\tvar ComboboxOption = React.createFactory(__webpack_require__(2));\n\t\n\tvar div = React.createFactory('div');\n\tvar span = React.createFactory('span');\n\tvar input = React.createFactory('input');\n\t\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\t\n\t propTypes: {\n\t /**\n\t * Called when the combobox receives user input, this is your chance to\n\t * filter the data and rerender the options.\n\t *\n\t * Signature:\n\t *\n\t * ```js\n\t * function(userInput){}\n\t * ```\n\t */\n\t onInput: React.PropTypes.func,\n\t\n\t /**\n\t * Called when the combobox receives a selection. You probably want to reset\n\t * the options to the full list at this point.\n\t *\n\t * Signature:\n\t *\n\t * ```js\n\t * function(selectedValue){}\n\t * ```\n\t */\n\t onSelect: React.PropTypes.func\n\t },\n\t\n\t getDefaultProps: function() {\n\t return {\n\t autocomplete: 'both',\n\t onInput: k,\n\t onSelect: k,\n\t value: null\n\t };\n\t },\n\t\n\t getInitialState: function() {\n\t return {\n\t value: this.props.value,\n\t // the value displayed in the input\n\t inputValue: this.findInitialInputValue(),\n\t isOpen: false,\n\t focusedIndex: null,\n\t matchedAutocompleteOption: null,\n\t // this prevents crazy jumpiness since we focus options on mouseenter\n\t usingKeyboard: false,\n\t activedescendant: null,\n\t listId: 'ic-tokeninput-list-'+(++guid),\n\t menu: {\n\t children: [],\n\t activedescendant: null,\n\t isEmpty: true\n\t }\n\t };\n\t },\n\t\n\t componentWillMount: function() {\n\t this.setState({menu: this.makeMenu()});\n\t },\n\t\n\t componentWillReceiveProps: function(newProps) {\n\t this.setState({menu: this.makeMenu(newProps.children)});\n\t },\n\t\n\t /**\n\t * We don't create the components, the user supplies them,\n\t * so before rendering we attach handlers to facilitate communication from\n\t * the ComboboxOption to the Combobox.\n\t */\n\t makeMenu: function(children) {\n\t var activedescendant;\n\t var isEmpty = true;\n\t children = children || this.props.children;\n\t React.Children.forEach(children, function(child, index) {\n\t if (child.type !== ComboboxOption.type)\n\t // allow random elements to live in this list\n\t return;\n\t isEmpty = false;\n\t // TODO: cloneWithProps and map instead of altering the children in-place\n\t var props = child.props;\n\t if (this.state.value === props.value) {\n\t // need an ID for WAI-ARIA\n\t props.id = props.id || 'ic-tokeninput-selected-'+(++guid);\n\t props.isSelected = true\n\t activedescendant = props.id;\n\t }\n\t props.onBlur = this.handleOptionBlur;\n\t props.onClick = this.selectOption.bind(this, child);\n\t props.onFocus = this.handleOptionFocus;\n\t props.onKeyDown = this.handleOptionKeyDown.bind(this, child);\n\t props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index);\n\t }.bind(this));\n\t\n\t if(isEmpty) {\n\t this.hideList();\n\t }\n\t\n\t return {\n\t children: children,\n\t activedescendant: activedescendant,\n\t isEmpty: isEmpty\n\t };\n\t },\n\t\n\t getClassName: function() {\n\t var className = addClass(this.props.className, 'ic-tokeninput');\n\t if (this.state.isOpen)\n\t className = addClass(className, 'ic-tokeninput-is-open');\n\t return className;\n\t },\n\t\n\t /**\n\t * When the user begins typing again we need to clear out any state that has\n\t * to do with an existing or potential selection.\n\t */\n\t clearSelectedState: function(cb) {\n\t this.setState({\n\t focusedIndex: null,\n\t inputValue: null,\n\t value: null,\n\t matchedAutocompleteOption: null,\n\t activedescendant: null\n\t }, cb);\n\t },\n\t\n\t handleInputChange: function(event) {\n\t var value = this.refs.input.getDOMNode().value;\n\t this.clearSelectedState(function() {\n\t this.props.onInput(value);\n\t if (!this.state.isOpen)\n\t this.showList();\n\t }.bind(this));\n\t },\n\t\n\t handleInputBlur: function() {\n\t var focusedAnOption = this.state.focusedIndex != null;\n\t if (focusedAnOption)\n\t return;\n\t this.maybeSelectAutocompletedOption();\n\t this.hideList();\n\t },\n\t\n\t handleOptionBlur: function() {\n\t // don't want to hide the list if we focused another option\n\t this.blurTimer = setTimeout(this.hideList, 0);\n\t },\n\t\n\t handleOptionFocus: function() {\n\t // see `handleOptionBlur`\n\t clearTimeout(this.blurTimer);\n\t },\n\t\n\t handleInputKeyUp: function(event) {\n\t if (\n\t this.state.menu.isEmpty ||\n\t // autocompleting while backspacing feels super weird, so let's not\n\t event.keyCode === 8 /*backspace*/ ||\n\t !this.props.autocomplete.match(/both|inline/)\n\t ) return;\n\t },\n\t\n\t handleButtonClick: function() {\n\t this.state.isOpen ? this.hideList() : this.showList();\n\t this.focusInput();\n\t },\n\t\n\t showList: function() {\n\t this.setState({isOpen: true})\n\t },\n\t\n\t hideList: function() {\n\t this.setState({isOpen: false});\n\t },\n\t\n\t hideOnEscape: function(event) {\n\t this.hideList();\n\t this.focusInput();\n\t event.preventDefault();\n\t },\n\t\n\t focusInput: function() {\n\t this.refs.input.getDOMNode().focus();\n\t },\n\t\n\t selectInput: function() {\n\t this.refs.input.getDOMNode().select();\n\t },\n\t\n\t inputKeydownMap: {\n\t 8: 'removeLastToken',\n\t 13: 'selectOnEnter',\n\t 27: 'hideOnEscape',\n\t 38: 'focusPrevious',\n\t 40: 'focusNext'\n\t },\n\t\n\t optionKeydownMap: {\n\t 13: 'selectOption',\n\t 27: 'hideOnEscape',\n\t 38: 'focusPrevious',\n\t 40: 'focusNext'\n\t },\n\t\n\t handleKeydown: function(event) {\n\t var handlerName = this.inputKeydownMap[event.keyCode];\n\t if (!handlerName)\n\t return\n\t this.setState({usingKeyboard: true});\n\t return this[handlerName].call(this,event);\n\t },\n\t\n\t handleOptionKeyDown: function(child, event) {\n\t var handlerName = this.optionKeydownMap[event.keyCode];\n\t if (!handlerName) {\n\t // if the user starts typing again while focused on an option, move focus\n\t // to the inpute, select so it wipes out any existing value\n\t this.selectInput();\n\t return;\n\t }\n\t event.preventDefault();\n\t this.setState({usingKeyboard: true});\n\t this[handlerName].call(this, child);\n\t },\n\t\n\t handleOptionMouseEnter: function(index) {\n\t if (this.state.usingKeyboard)\n\t this.setState({usingKeyboard: false});\n\t else\n\t this.focusOptionAtIndex(index);\n\t },\n\t\n\t selectOnEnter: function(event) {\n\t event.preventDefault();\n\t this.maybeSelectAutocompletedOption()\n\t },\n\t\n\t maybeSelectAutocompletedOption: function() {\n\t if (!this.state.matchedAutocompleteOption) {\n\t this.selectText()\n\t } else {\n\t this.selectOption(this.state.matchedAutocompleteOption, {focus: false});\n\t }\n\t },\n\t\n\t selectOption: function(child, options) {\n\t options = options || {};\n\t this.setState({\n\t // value: child.props.value,\n\t // inputValue: getLabel(child),\n\t matchedAutocompleteOption: null\n\t }, function() {\n\t this.props.onSelect(child.props.value, child);\n\t this.hideList();\n\t this.clearSelectedState(); // added\n\t if (options.focus !== false)\n\t this.selectInput();\n\t }.bind(this));\n\t this.refs.input.getDOMNode().value = '' // added\n\t },\n\t\n\t selectText: function() {\n\t var value = this.refs.input.getDOMNode().value;\n\t if(!value) return;\n\t this.props.onSelect(value);\n\t this.clearSelectedState();\n\t this.refs.input.getDOMNode().value = '' // added\n\t },\n\t\n\t focusNext: function(event) {\n\t if(event.preventDefault) event.preventDefault();\n\t if (this.state.menu.isEmpty) return;\n\t var index = this.state.focusedIndex == null ?\n\t 0 : this.state.focusedIndex + 1;\n\t this.focusOptionAtIndex(index);\n\t },\n\t\n\t removeLastToken: function() {\n\t if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) {\n\t this.props.onRemoveLast()\n\t }\n\t return true\n\t },\n\t\n\t focusPrevious: function(event) {\n\t if(event.preventDefault) event.preventDefault();\n\t if (this.state.menu.isEmpty) return;\n\t var last = this.props.children.length - 1;\n\t var index = this.state.focusedIndex == null ?\n\t last : this.state.focusedIndex - 1;\n\t this.focusOptionAtIndex(index);\n\t },\n\t\n\t focusSelectedOption: function() {\n\t var selectedIndex;\n\t React.Children.forEach(this.props.children, function(child, index) {\n\t if (child.props.value === this.state.value)\n\t selectedIndex = index;\n\t }.bind(this));\n\t this.showList();\n\t this.setState({\n\t focusedIndex: selectedIndex\n\t }, this.focusOption);\n\t },\n\t\n\t findInitialInputValue: function() {\n\t // TODO: might not need this, we should know this in `makeMenu`\n\t var inputValue;\n\t React.Children.forEach(this.props.children, function(child) {\n\t if (child.props.value === this.props.value)\n\t inputValue = getLabel(child);\n\t }.bind(this));\n\t return inputValue;\n\t },\n\t\n\t focusOptionAtIndex: function(index) {\n\t if (!this.state.isOpen && this.state.value)\n\t return this.focusSelectedOption();\n\t this.showList();\n\t var length = this.props.children.length;\n\t if (index === -1)\n\t index = length - 1;\n\t else if (index === length)\n\t index = 0;\n\t this.setState({\n\t focusedIndex: index\n\t }, this.focusOption);\n\t },\n\t\n\t focusOption: function() {\n\t var index = this.state.focusedIndex;\n\t this.refs.list.getDOMNode().childNodes[index].focus();\n\t },\n\t\n\t render: function() {\n\t var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' +\n\t 'Press the down arrow to navigate results. If you don\\'t find an ' +\n\t 'acceptable option, you can enter an alternative.'\n\t\n\t return div({className: this.getClassName()},\n\t this.props.value,\n\t this.state.inputValue,\n\t input({\n\t ref: 'input',\n\t autoComplete: 'off',\n\t spellCheck: 'false',\n\t 'aria-label': ariaLabel,\n\t 'aria-expanded': this.state.isOpen+'',\n\t 'aria-haspopup': 'true',\n\t 'aria-activedescendant': this.state.menu.activedescendant,\n\t 'aria-autocomplete': 'list',\n\t 'aria-owns': this.state.listId,\n\t id: this.props.id,\n\t className: 'ic-tokeninput-input',\n\t onChange: this.handleInputChange,\n\t onBlur: this.handleInputBlur,\n\t onKeyDown: this.handleKeydown,\n\t onKeyUp: this.handleInputKeyUp,\n\t role: 'combobox'\n\t }),\n\t span({\n\t 'aria-hidden': 'true',\n\t className: 'ic-tokeninput-button',\n\t onClick: this.handleButtonClick\n\t }, '▾'),\n\t div({\n\t id: this.state.listId,\n\t ref: 'list',\n\t className: 'ic-tokeninput-list',\n\t role: 'listbox'\n\t }, this.state.menu.children)\n\t );\n\t }\n\t});\n\t\n\tfunction getLabel(component) {\n\t return component.props.label || component.props.children;\n\t}\n\t\n\tfunction matchFragment(userInput, firstChildLabel) {\n\t userInput = userInput.toLowerCase();\n\t firstChildLabel = firstChildLabel.toLowerCase();\n\t if (userInput === '' || userInput === firstChildLabel)\n\t return false;\n\t if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1)\n\t return false;\n\t return true;\n\t}\n\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar span = React.DOM.span;\n\tvar li = React.createFactory('li');\n\t\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\t handleClick: function() {\n\t this.props.onRemove(this.props.value)\n\t },\n\t\n\t handleKeyDown: function(key) {\n\t var enterKey = 13;\n\t if(key.keyCode === enterKey) this.props.onRemove(this.props.value)\n\t },\n\t\n\t render: function() {\n\t return (\n\t li({\n\t className: \"ic-token inline-flex\"\n\t },\n\t span({\n\t role: 'button',\n\t onClick: this.handleClick,\n\t onKeyDown: this.handleKeyDown,\n\t 'aria-label': 'Remove \\'' + this.props.name + '\\'',\n\t className: \"ic-token-delete-button\",\n\t tabIndex: 0\n\t }, \"✕\"),\n\t span({className: \"ic-token-label\"}, this.props.name)\n\t )\n\t )\n\t }\n\t})\n\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = addClass;\n\t\n\tfunction addClass(existing, added) {\n\t if (!existing) return added;\n\t if (existing.indexOf(added) > -1) return existing;\n\t return existing + ' ' + added;\n\t}\n\n\n/***/ }\n/******/ ])\n});\n\n\n\n/** WEBPACK FOOTER **\n ** react-tokeninput.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 97c5893b87d8e540f8e7\n **/","var TokenInput = require('./lib/main')\nTokenInput.Option = require('./lib/option')\n\nmodule.exports = TokenInput\n\n\n\n/** WEBPACK FOOTER **\n ** ./index.js\n **/","var React = require('react');\nvar Combobox = React.createFactory(require('./combobox'));\nvar Token = React.createFactory(require('./token'));\n\nvar ul = React.createFactory('ul');\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n propTypes: {\n onInput: React.PropTypes.func,\n onSelect: React.PropTypes.func.isRequired,\n onRemove: React.PropTypes.func.isRequired,\n selected: React.PropTypes.array.isRequired,\n menuContent: React.PropTypes.any\n },\n\n getInitialState: function() {\n return {\n selectedToken: null\n };\n },\n\n handleClick: function() {\n // TODO: Expand combobox API for focus\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleInput: function(event) {\n this.props.onInput(event);\n },\n\n handleSelect: function(event) {\n this.props.onSelect(event)\n this.setState({\n selectedToken: null\n })\n },\n\n handleRemove: function(value) {\n this.props.onRemove(value);\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleRemoveLast: function() {\n this.props.onRemove(this.props.selected[this.props.selected.length - 1]);\n },\n\n render: function() {\n var tokens = this.props.selected.map(function(token) {\n return (\n Token({\n onRemove: this.handleRemove,\n value: token,\n name: token.name,\n key: token.id})\n )\n }.bind(this))\n\n return ul({className: 'ic-tokens flex', onClick: this.handleClick},\n tokens,\n li({className: 'inline-flex', ref: 'combo-li'},\n Combobox({\n id: this.props.id,\n 'aria-label': this.props['combobox-aria-label'],\n onInput: this.handleInput,\n onSelect: this.handleSelect,\n onRemoveLast: this.handleRemoveLast,\n value: this.state.selectedToken\n },\n this.props.menuContent\n )\n )\n );\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/main.js\n **/","var React = require('react');\nvar addClass = require('./add-class');\nvar div = React.createFactory('div');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n\n /**\n * The value that will be sent to the `onSelect` handler of the\n * parent Combobox.\n */\n value: React.PropTypes.any.isRequired,\n\n /**\n * What value to put into the input element when this option is\n * selected, defaults to its children coerced to a string.\n */\n label: React.PropTypes.string\n },\n\n getDefaultProps: function() {\n return {\n role: 'option',\n tabIndex: '-1',\n className: 'ic-tokeninput-option',\n isSelected: false\n };\n },\n\n render: function() {\n var props = this.props;\n if (props.isSelected) {\n props.className = addClass(props.className, 'ic-tokeninput-selected');\n props.ariaSelected = true;\n }\n return div(props);\n }\n\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/option.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n ** module id = 3\n ** module chunks = 0\n **/","var React = require('react');\nvar guid = 0;\nvar k = function(){};\nvar addClass = require('./add-class');\nvar ComboboxOption = React.createFactory(require('./option'));\n\nvar div = React.createFactory('div');\nvar span = React.createFactory('span');\nvar input = React.createFactory('input');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n /**\n * Called when the combobox receives user input, this is your chance to\n * filter the data and rerender the options.\n *\n * Signature:\n *\n * ```js\n * function(userInput){}\n * ```\n */\n onInput: React.PropTypes.func,\n\n /**\n * Called when the combobox receives a selection. You probably want to reset\n * the options to the full list at this point.\n *\n * Signature:\n *\n * ```js\n * function(selectedValue){}\n * ```\n */\n onSelect: React.PropTypes.func\n },\n\n getDefaultProps: function() {\n return {\n autocomplete: 'both',\n onInput: k,\n onSelect: k,\n value: null\n };\n },\n\n getInitialState: function() {\n return {\n value: this.props.value,\n // the value displayed in the input\n inputValue: this.findInitialInputValue(),\n isOpen: false,\n focusedIndex: null,\n matchedAutocompleteOption: null,\n // this prevents crazy jumpiness since we focus options on mouseenter\n usingKeyboard: false,\n activedescendant: null,\n listId: 'ic-tokeninput-list-'+(++guid),\n menu: {\n children: [],\n activedescendant: null,\n isEmpty: true\n }\n };\n },\n\n componentWillMount: function() {\n this.setState({menu: this.makeMenu()});\n },\n\n componentWillReceiveProps: function(newProps) {\n this.setState({menu: this.makeMenu(newProps.children)});\n },\n\n /**\n * We don't create the components, the user supplies them,\n * so before rendering we attach handlers to facilitate communication from\n * the ComboboxOption to the Combobox.\n */\n makeMenu: function(children) {\n var activedescendant;\n var isEmpty = true;\n children = children || this.props.children;\n React.Children.forEach(children, function(child, index) {\n if (child.type !== ComboboxOption.type)\n // allow random elements to live in this list\n return;\n isEmpty = false;\n // TODO: cloneWithProps and map instead of altering the children in-place\n var props = child.props;\n if (this.state.value === props.value) {\n // need an ID for WAI-ARIA\n props.id = props.id || 'ic-tokeninput-selected-'+(++guid);\n props.isSelected = true\n activedescendant = props.id;\n }\n props.onBlur = this.handleOptionBlur;\n props.onClick = this.selectOption.bind(this, child);\n props.onFocus = this.handleOptionFocus;\n props.onKeyDown = this.handleOptionKeyDown.bind(this, child);\n props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index);\n }.bind(this));\n\n if(isEmpty) {\n this.hideList();\n }\n\n return {\n children: children,\n activedescendant: activedescendant,\n isEmpty: isEmpty\n };\n },\n\n getClassName: function() {\n var className = addClass(this.props.className, 'ic-tokeninput');\n if (this.state.isOpen)\n className = addClass(className, 'ic-tokeninput-is-open');\n return className;\n },\n\n /**\n * When the user begins typing again we need to clear out any state that has\n * to do with an existing or potential selection.\n */\n clearSelectedState: function(cb) {\n this.setState({\n focusedIndex: null,\n inputValue: null,\n value: null,\n matchedAutocompleteOption: null,\n activedescendant: null\n }, cb);\n },\n\n handleInputChange: function(event) {\n var value = this.refs.input.getDOMNode().value;\n this.clearSelectedState(function() {\n this.props.onInput(value);\n if (!this.state.isOpen)\n this.showList();\n }.bind(this));\n },\n\n handleInputBlur: function() {\n var focusedAnOption = this.state.focusedIndex != null;\n if (focusedAnOption)\n return;\n this.maybeSelectAutocompletedOption();\n this.hideList();\n },\n\n handleOptionBlur: function() {\n // don't want to hide the list if we focused another option\n this.blurTimer = setTimeout(this.hideList, 0);\n },\n\n handleOptionFocus: function() {\n // see `handleOptionBlur`\n clearTimeout(this.blurTimer);\n },\n\n handleInputKeyUp: function(event) {\n if (\n this.state.menu.isEmpty ||\n // autocompleting while backspacing feels super weird, so let's not\n event.keyCode === 8 /*backspace*/ ||\n !this.props.autocomplete.match(/both|inline/)\n ) return;\n },\n\n handleButtonClick: function() {\n this.state.isOpen ? this.hideList() : this.showList();\n this.focusInput();\n },\n\n showList: function() {\n this.setState({isOpen: true})\n },\n\n hideList: function() {\n this.setState({isOpen: false});\n },\n\n hideOnEscape: function(event) {\n this.hideList();\n this.focusInput();\n event.preventDefault();\n },\n\n focusInput: function() {\n this.refs.input.getDOMNode().focus();\n },\n\n selectInput: function() {\n this.refs.input.getDOMNode().select();\n },\n\n inputKeydownMap: {\n 8: 'removeLastToken',\n 13: 'selectOnEnter',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n optionKeydownMap: {\n 13: 'selectOption',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n handleKeydown: function(event) {\n var handlerName = this.inputKeydownMap[event.keyCode];\n if (!handlerName)\n return\n this.setState({usingKeyboard: true});\n return this[handlerName].call(this,event);\n },\n\n handleOptionKeyDown: function(child, event) {\n var handlerName = this.optionKeydownMap[event.keyCode];\n if (!handlerName) {\n // if the user starts typing again while focused on an option, move focus\n // to the inpute, select so it wipes out any existing value\n this.selectInput();\n return;\n }\n event.preventDefault();\n this.setState({usingKeyboard: true});\n this[handlerName].call(this, child);\n },\n\n handleOptionMouseEnter: function(index) {\n if (this.state.usingKeyboard)\n this.setState({usingKeyboard: false});\n else\n this.focusOptionAtIndex(index);\n },\n\n selectOnEnter: function(event) {\n event.preventDefault();\n this.maybeSelectAutocompletedOption()\n },\n\n maybeSelectAutocompletedOption: function() {\n if (!this.state.matchedAutocompleteOption) {\n this.selectText()\n } else {\n this.selectOption(this.state.matchedAutocompleteOption, {focus: false});\n }\n },\n\n selectOption: function(child, options) {\n options = options || {};\n this.setState({\n // value: child.props.value,\n // inputValue: getLabel(child),\n matchedAutocompleteOption: null\n }, function() {\n this.props.onSelect(child.props.value, child);\n this.hideList();\n this.clearSelectedState(); // added\n if (options.focus !== false)\n this.selectInput();\n }.bind(this));\n this.refs.input.getDOMNode().value = '' // added\n },\n\n selectText: function() {\n var value = this.refs.input.getDOMNode().value;\n if(!value) return;\n this.props.onSelect(value);\n this.clearSelectedState();\n this.refs.input.getDOMNode().value = '' // added\n },\n\n focusNext: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var index = this.state.focusedIndex == null ?\n 0 : this.state.focusedIndex + 1;\n this.focusOptionAtIndex(index);\n },\n\n removeLastToken: function() {\n if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) {\n this.props.onRemoveLast()\n }\n return true\n },\n\n focusPrevious: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var last = this.props.children.length - 1;\n var index = this.state.focusedIndex == null ?\n last : this.state.focusedIndex - 1;\n this.focusOptionAtIndex(index);\n },\n\n focusSelectedOption: function() {\n var selectedIndex;\n React.Children.forEach(this.props.children, function(child, index) {\n if (child.props.value === this.state.value)\n selectedIndex = index;\n }.bind(this));\n this.showList();\n this.setState({\n focusedIndex: selectedIndex\n }, this.focusOption);\n },\n\n findInitialInputValue: function() {\n // TODO: might not need this, we should know this in `makeMenu`\n var inputValue;\n React.Children.forEach(this.props.children, function(child) {\n if (child.props.value === this.props.value)\n inputValue = getLabel(child);\n }.bind(this));\n return inputValue;\n },\n\n focusOptionAtIndex: function(index) {\n if (!this.state.isOpen && this.state.value)\n return this.focusSelectedOption();\n this.showList();\n var length = this.props.children.length;\n if (index === -1)\n index = length - 1;\n else if (index === length)\n index = 0;\n this.setState({\n focusedIndex: index\n }, this.focusOption);\n },\n\n focusOption: function() {\n var index = this.state.focusedIndex;\n this.refs.list.getDOMNode().childNodes[index].focus();\n },\n\n render: function() {\n var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' +\n 'Press the down arrow to navigate results. If you don\\'t find an ' +\n 'acceptable option, you can enter an alternative.'\n\n return div({className: this.getClassName()},\n this.props.value,\n this.state.inputValue,\n input({\n ref: 'input',\n autoComplete: 'off',\n spellCheck: 'false',\n 'aria-label': ariaLabel,\n 'aria-expanded': this.state.isOpen+'',\n 'aria-haspopup': 'true',\n 'aria-activedescendant': this.state.menu.activedescendant,\n 'aria-autocomplete': 'list',\n 'aria-owns': this.state.listId,\n id: this.props.id,\n className: 'ic-tokeninput-input',\n onChange: this.handleInputChange,\n onBlur: this.handleInputBlur,\n onKeyDown: this.handleKeydown,\n onKeyUp: this.handleInputKeyUp,\n role: 'combobox'\n }),\n span({\n 'aria-hidden': 'true',\n className: 'ic-tokeninput-button',\n onClick: this.handleButtonClick\n }, '▾'),\n div({\n id: this.state.listId,\n ref: 'list',\n className: 'ic-tokeninput-list',\n role: 'listbox'\n }, this.state.menu.children)\n );\n }\n});\n\nfunction getLabel(component) {\n return component.props.label || component.props.children;\n}\n\nfunction matchFragment(userInput, firstChildLabel) {\n userInput = userInput.toLowerCase();\n firstChildLabel = firstChildLabel.toLowerCase();\n if (userInput === '' || userInput === firstChildLabel)\n return false;\n if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1)\n return false;\n return true;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/combobox.js\n **/","var React = require('react');\nvar span = React.DOM.span;\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n handleClick: function() {\n this.props.onRemove(this.props.value)\n },\n\n handleKeyDown: function(key) {\n var enterKey = 13;\n if(key.keyCode === enterKey) this.props.onRemove(this.props.value)\n },\n\n render: function() {\n return (\n li({\n className: \"ic-token inline-flex\"\n },\n span({\n role: 'button',\n onClick: this.handleClick,\n onKeyDown: this.handleKeyDown,\n 'aria-label': 'Remove \\'' + this.props.name + '\\'',\n className: \"ic-token-delete-button\",\n tabIndex: 0\n }, \"✕\"),\n span({className: \"ic-token-label\"}, this.props.name)\n )\n )\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/token.js\n **/","module.exports = addClass;\n\nfunction addClass(existing, added) {\n if (!existing) return added;\n if (existing.indexOf(added) > -1) return existing;\n return existing + ' ' + added;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/add-class.js\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/package.json b/package.json index 88de656..878b970 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,8 @@ "description": "Tokeninput component for React", "main": "index.js", "scripts": { + "build": "NODE_ENV=production webpack index.js dist/react-tokeninput.js", + "build-min": "NODE_ENV=production webpack index.js dist/react-tokeninput.min.js --optimize-minimize", "test": "node_modules/.bin/karma start" }, "repository": { diff --git a/webpack.config.js b/webpack.config.js index 4e3da23..7aa946e 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,8 +1,20 @@ module.exports = { entry: "./example/main.js", output: { - filename: "./example/bundle.js" + library: 'TokenInput', + libraryTarget: 'umd' }, + + externals: [ + { + "react": { + root: "React", + commonjs2: "react", + commonjs: "react", + amd: "react" + } + } + ], debug: true, devtool: '#source-map', module: { From 9156bf8f48049508a5bcadd48c8a233bd6e118ba Mon Sep 17 00:00:00 2001 From: Brent Burgoyne Date: Mon, 2 Mar 2015 16:44:22 -0700 Subject: [PATCH 02/62] 0.3.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 878b970..5cacf17 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-tokeninput", - "version": "0.3.0", + "version": "0.3.1", "description": "Tokeninput component for React", "main": "index.js", "scripts": { From cd814479bcc14a9e05cf6139e1525b13b7f417e1 Mon Sep 17 00:00:00 2001 From: Aaron Shafovaloff Date: Fri, 6 Mar 2015 15:04:23 -0700 Subject: [PATCH 03/62] Update styles.css --- example/styles.css | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/example/styles.css b/example/styles.css index 876e817..8277cad 100644 --- a/example/styles.css +++ b/example/styles.css @@ -46,6 +46,14 @@ body { -moz-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; + border: 0 none; + outline: 0; + margin-top: 6px; + margin-bottom: 6px; +} + +.ic-token-label { + line-height: 20px; } .ic-tokeninput-button { @@ -153,11 +161,6 @@ body { display: inline-flex; } -.ic-tokeninput-input { - border: 0 none; - outline: 0; -} - .ic-tokeninput-button { display: none; } From d5b80d4ca1b673a8ca495bac320979fdad111d14 Mon Sep 17 00:00:00 2001 From: Aaron Shafovaloff Date: Fri, 6 Mar 2015 16:38:11 -0700 Subject: [PATCH 04/62] Cancel showList if no menu children --- lib/combobox.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/combobox.js b/lib/combobox.js index 0d6eb6d..44abfae 100644 --- a/lib/combobox.js +++ b/lib/combobox.js @@ -176,6 +176,9 @@ module.exports = React.createClass({ }, showList: function() { + if(!this.state.menu.children.length) { + return + } this.setState({isOpen: true}) }, From 618323f9fdada3440e7307aec139e25f610db311 Mon Sep 17 00:00:00 2001 From: Aaron Shafovaloff Date: Mon, 9 Mar 2015 10:49:45 -0600 Subject: [PATCH 05/62] version bump to 0.3.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5cacf17..a622c6e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-tokeninput", - "version": "0.3.1", + "version": "0.3.2", "description": "Tokeninput component for React", "main": "index.js", "scripts": { From b9aee5372df6dcdcc8cc0509cad453c0ce588f4e Mon Sep 17 00:00:00 2001 From: Aaron Shafovaloff Date: Thu, 12 Mar 2015 15:57:55 -0600 Subject: [PATCH 06/62] Refs RD-1098 - Better show/hide of dropdown --- lib/combobox.js | 17 ++++++++++------- lib/main.js | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/combobox.js b/lib/combobox.js index 44abfae..17ef867 100644 --- a/lib/combobox.js +++ b/lib/combobox.js @@ -70,7 +70,14 @@ module.exports = React.createClass({ }, componentWillReceiveProps: function(newProps) { - this.setState({menu: this.makeMenu(newProps.children)}); + this.setState({menu: this.makeMenu(newProps.children)}, function() { + if(newProps.children.length) { + this.showList(); + } else { + this.hideList(); + } + + }.bind(this)); }, /** @@ -82,6 +89,8 @@ module.exports = React.createClass({ var activedescendant; var isEmpty = true; children = children || this.props.children; + + // Should this instead use React.addons.cloneWithProps or React.cloneElement? React.Children.forEach(children, function(child, index) { if (child.type !== ComboboxOption.type) // allow random elements to live in this list @@ -102,10 +111,6 @@ module.exports = React.createClass({ props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index); }.bind(this)); - if(isEmpty) { - this.hideList(); - } - return { children: children, activedescendant: activedescendant, @@ -138,8 +143,6 @@ module.exports = React.createClass({ var value = this.refs.input.getDOMNode().value; this.clearSelectedState(function() { this.props.onInput(value); - if (!this.state.isOpen) - this.showList(); }.bind(this)); }, diff --git a/lib/main.js b/lib/main.js index 4796134..d40e9b5 100644 --- a/lib/main.js +++ b/lib/main.js @@ -61,7 +61,7 @@ module.exports = React.createClass({ li({className: 'inline-flex', ref: 'combo-li'}, Combobox({ id: this.props.id, - 'aria-label': this.props['combobox-aria-label'], + ariaLabel: this.props['combobox-aria-label'], onInput: this.handleInput, onSelect: this.handleSelect, onRemoveLast: this.handleRemoveLast, From 50ead8265a506d30bb7b5acef672a1558757982e Mon Sep 17 00:00:00 2001 From: Aaron Shafovaloff Date: Thu, 12 Mar 2015 16:26:30 -0600 Subject: [PATCH 07/62] version bump to 0.3.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a622c6e..5e94b1a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-tokeninput", - "version": "0.3.2", + "version": "0.3.3", "description": "Tokeninput component for React", "main": "index.js", "scripts": { From 337516e00e94fa5dd3d552aa3373cebe6acc8ea7 Mon Sep 17 00:00:00 2001 From: Aaron Shafovaloff Date: Thu, 12 Mar 2015 16:28:52 -0600 Subject: [PATCH 08/62] build for dist --- dist/react-tokeninput.js | 24 +++++++++++++++--------- dist/react-tokeninput.js.map | 2 +- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/dist/react-tokeninput.js b/dist/react-tokeninput.js index 3bf0990..39124ec 100644 --- a/dist/react-tokeninput.js +++ b/dist/react-tokeninput.js @@ -127,7 +127,7 @@ return /******/ (function(modules) { // webpackBootstrap li({className: 'inline-flex', ref: 'combo-li'}, Combobox({ id: this.props.id, - 'aria-label': this.props['combobox-aria-label'], + ariaLabel: this.props['combobox-aria-label'], onInput: this.handleInput, onSelect: this.handleSelect, onRemoveLast: this.handleRemoveLast, @@ -269,7 +269,14 @@ return /******/ (function(modules) { // webpackBootstrap }, componentWillReceiveProps: function(newProps) { - this.setState({menu: this.makeMenu(newProps.children)}); + this.setState({menu: this.makeMenu(newProps.children)}, function() { + if(newProps.children.length) { + this.showList(); + } else { + this.hideList(); + } + + }.bind(this)); }, /** @@ -281,6 +288,8 @@ return /******/ (function(modules) { // webpackBootstrap var activedescendant; var isEmpty = true; children = children || this.props.children; + + // Should this instead use React.addons.cloneWithProps or React.cloneElement? React.Children.forEach(children, function(child, index) { if (child.type !== ComboboxOption.type) // allow random elements to live in this list @@ -301,10 +310,6 @@ return /******/ (function(modules) { // webpackBootstrap props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index); }.bind(this)); - if(isEmpty) { - this.hideList(); - } - return { children: children, activedescendant: activedescendant, @@ -337,8 +342,6 @@ return /******/ (function(modules) { // webpackBootstrap var value = this.refs.input.getDOMNode().value; this.clearSelectedState(function() { this.props.onInput(value); - if (!this.state.isOpen) - this.showList(); }.bind(this)); }, @@ -375,6 +378,9 @@ return /******/ (function(modules) { // webpackBootstrap }, showList: function() { + if(!this.state.menu.children.length) { + return + } this.setState({isOpen: true}) }, @@ -651,5 +657,5 @@ return /******/ (function(modules) { // webpackBootstrap /***/ } /******/ ]) }); - +; //# sourceMappingURL=react-tokeninput.js.map \ No newline at end of file diff --git a/dist/react-tokeninput.js.map b/dist/react-tokeninput.js.map index ef89c9c..f1a0bea 100644 --- a/dist/react-tokeninput.js.map +++ b/dist/react-tokeninput.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 8996b849546d6e6b1f74","webpack:///./index.js","webpack:///./lib/main.js","webpack:///./lib/option.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///./lib/combobox.js","webpack:///./lib/token.js","webpack:///./lib/add-class.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,wC;;;;;;;ACtCA,KAAI,UAAU,GAAG,mBAAO,CAAC,CAAY,CAAC;AACtC,WAAU,CAAC,MAAM,GAAG,mBAAO,CAAC,CAAc,CAAC;;AAE3C,OAAM,CAAC,OAAO,GAAG,UAAU;;;;;;;ACH3B,KAAI,KAAK,GAAG,mBAAO,CAAC,CAAO,CA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AE,CAAC;KAClB,GAAG,GAAG,CAAC,OAAO,KAAK,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;AACtE,IAAG;;GAED,MAAM,EAAE,WAAW;KACjB;OACE,EAAE,CAAC;SACD,SAAS,EAAE,sBAAsB;QAClC;SACC,IAAI,CAAC;WACH,IAAI,EAAE,QAAQ;WACd,OAAO,EAAE,IAAI,CAAC,WAAW;WACzB,SAAS,EAAE,IAAI,CAAC,aAAa;WAC7B,YAAY,EAAE,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI;WAClD,SAAS,EAAE,wBAAwB;WACnC,QAAQ,EAAE,CAAC;UACZ,EAAE,GAAG,CAAC;SACP,IAAI,CAAC,CAAC,SAAS,EAAE,gBAAgB,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;QACrD;MACF;IACF;EACF,CAAC;;;;;;;AC/BF,OAAM,CAAC,OAAO,GAAG,QAAQ,CAAC;;AAE1B,UAAS,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAE;GACjC,IAAI,CAAC,QAAQ,EAAE,OAAO,KAAK,CAAC;GAC5B,IAAI,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,QAAQ,CAAC;GAClD,OAAO,QAAQ,GAAG,GAAG,GAAG,KAAK,CAAC;EAC/B","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TokenInput\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"TokenInput\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 8996b849546d6e6b1f74\n **/","var TokenInput = require('./lib/main')\nTokenInput.Option = require('./lib/option')\n\nmodule.exports = TokenInput\n\n\n\n/** WEBPACK FOOTER **\n ** ./index.js\n **/","var React = require('react');\nvar Combobox = React.createFactory(require('./combobox'));\nvar Token = React.createFactory(require('./token'));\n\nvar ul = React.createFactory('ul');\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n propTypes: {\n onInput: React.PropTypes.func,\n onSelect: React.PropTypes.func.isRequired,\n onRemove: React.PropTypes.func.isRequired,\n selected: React.PropTypes.array.isRequired,\n menuContent: React.PropTypes.any\n },\n\n getInitialState: function() {\n return {\n selectedToken: null\n };\n },\n\n handleClick: function() {\n // TODO: Expand combobox API for focus\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleInput: function(event) {\n this.props.onInput(event);\n },\n\n handleSelect: function(event) {\n this.props.onSelect(event)\n this.setState({\n selectedToken: null\n })\n },\n\n handleRemove: function(value) {\n this.props.onRemove(value);\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleRemoveLast: function() {\n this.props.onRemove(this.props.selected[this.props.selected.length - 1]);\n },\n\n render: function() {\n var tokens = this.props.selected.map(function(token) {\n return (\n Token({\n onRemove: this.handleRemove,\n value: token,\n name: token.name,\n key: token.id})\n )\n }.bind(this))\n\n return ul({className: 'ic-tokens flex', onClick: this.handleClick},\n tokens,\n li({className: 'inline-flex', ref: 'combo-li'},\n Combobox({\n id: this.props.id,\n 'aria-label': this.props['combobox-aria-label'],\n onInput: this.handleInput,\n onSelect: this.handleSelect,\n onRemoveLast: this.handleRemoveLast,\n value: this.state.selectedToken\n },\n this.props.menuContent\n )\n )\n );\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/main.js\n **/","var React = require('react');\nvar addClass = require('./add-class');\nvar div = React.createFactory('div');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n\n /**\n * The value that will be sent to the `onSelect` handler of the\n * parent Combobox.\n */\n value: React.PropTypes.any.isRequired,\n\n /**\n * What value to put into the input element when this option is\n * selected, defaults to its children coerced to a string.\n */\n label: React.PropTypes.string\n },\n\n getDefaultProps: function() {\n return {\n role: 'option',\n tabIndex: '-1',\n className: 'ic-tokeninput-option',\n isSelected: false\n };\n },\n\n render: function() {\n var props = this.props;\n if (props.isSelected) {\n props.className = addClass(props.className, 'ic-tokeninput-selected');\n props.ariaSelected = true;\n }\n return div(props);\n }\n\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/option.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n ** module id = 3\n ** module chunks = 0\n **/","var React = require('react');\nvar guid = 0;\nvar k = function(){};\nvar addClass = require('./add-class');\nvar ComboboxOption = React.createFactory(require('./option'));\n\nvar div = React.createFactory('div');\nvar span = React.createFactory('span');\nvar input = React.createFactory('input');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n /**\n * Called when the combobox receives user input, this is your chance to\n * filter the data and rerender the options.\n *\n * Signature:\n *\n * ```js\n * function(userInput){}\n * ```\n */\n onInput: React.PropTypes.func,\n\n /**\n * Called when the combobox receives a selection. You probably want to reset\n * the options to the full list at this point.\n *\n * Signature:\n *\n * ```js\n * function(selectedValue){}\n * ```\n */\n onSelect: React.PropTypes.func\n },\n\n getDefaultProps: function() {\n return {\n autocomplete: 'both',\n onInput: k,\n onSelect: k,\n value: null\n };\n },\n\n getInitialState: function() {\n return {\n value: this.props.value,\n // the value displayed in the input\n inputValue: this.findInitialInputValue(),\n isOpen: false,\n focusedIndex: null,\n matchedAutocompleteOption: null,\n // this prevents crazy jumpiness since we focus options on mouseenter\n usingKeyboard: false,\n activedescendant: null,\n listId: 'ic-tokeninput-list-'+(++guid),\n menu: {\n children: [],\n activedescendant: null,\n isEmpty: true\n }\n };\n },\n\n componentWillMount: function() {\n this.setState({menu: this.makeMenu()});\n },\n\n componentWillReceiveProps: function(newProps) {\n this.setState({menu: this.makeMenu(newProps.children)});\n },\n\n /**\n * We don't create the components, the user supplies them,\n * so before rendering we attach handlers to facilitate communication from\n * the ComboboxOption to the Combobox.\n */\n makeMenu: function(children) {\n var activedescendant;\n var isEmpty = true;\n children = children || this.props.children;\n React.Children.forEach(children, function(child, index) {\n if (child.type !== ComboboxOption.type)\n // allow random elements to live in this list\n return;\n isEmpty = false;\n // TODO: cloneWithProps and map instead of altering the children in-place\n var props = child.props;\n if (this.state.value === props.value) {\n // need an ID for WAI-ARIA\n props.id = props.id || 'ic-tokeninput-selected-'+(++guid);\n props.isSelected = true\n activedescendant = props.id;\n }\n props.onBlur = this.handleOptionBlur;\n props.onClick = this.selectOption.bind(this, child);\n props.onFocus = this.handleOptionFocus;\n props.onKeyDown = this.handleOptionKeyDown.bind(this, child);\n props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index);\n }.bind(this));\n\n if(isEmpty) {\n this.hideList();\n }\n\n return {\n children: children,\n activedescendant: activedescendant,\n isEmpty: isEmpty\n };\n },\n\n getClassName: function() {\n var className = addClass(this.props.className, 'ic-tokeninput');\n if (this.state.isOpen)\n className = addClass(className, 'ic-tokeninput-is-open');\n return className;\n },\n\n /**\n * When the user begins typing again we need to clear out any state that has\n * to do with an existing or potential selection.\n */\n clearSelectedState: function(cb) {\n this.setState({\n focusedIndex: null,\n inputValue: null,\n value: null,\n matchedAutocompleteOption: null,\n activedescendant: null\n }, cb);\n },\n\n handleInputChange: function(event) {\n var value = this.refs.input.getDOMNode().value;\n this.clearSelectedState(function() {\n this.props.onInput(value);\n if (!this.state.isOpen)\n this.showList();\n }.bind(this));\n },\n\n handleInputBlur: function() {\n var focusedAnOption = this.state.focusedIndex != null;\n if (focusedAnOption)\n return;\n this.maybeSelectAutocompletedOption();\n this.hideList();\n },\n\n handleOptionBlur: function() {\n // don't want to hide the list if we focused another option\n this.blurTimer = setTimeout(this.hideList, 0);\n },\n\n handleOptionFocus: function() {\n // see `handleOptionBlur`\n clearTimeout(this.blurTimer);\n },\n\n handleInputKeyUp: function(event) {\n if (\n this.state.menu.isEmpty ||\n // autocompleting while backspacing feels super weird, so let's not\n event.keyCode === 8 /*backspace*/ ||\n !this.props.autocomplete.match(/both|inline/)\n ) return;\n },\n\n handleButtonClick: function() {\n this.state.isOpen ? this.hideList() : this.showList();\n this.focusInput();\n },\n\n showList: function() {\n this.setState({isOpen: true})\n },\n\n hideList: function() {\n this.setState({isOpen: false});\n },\n\n hideOnEscape: function(event) {\n this.hideList();\n this.focusInput();\n event.preventDefault();\n },\n\n focusInput: function() {\n this.refs.input.getDOMNode().focus();\n },\n\n selectInput: function() {\n this.refs.input.getDOMNode().select();\n },\n\n inputKeydownMap: {\n 8: 'removeLastToken',\n 13: 'selectOnEnter',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n optionKeydownMap: {\n 13: 'selectOption',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n handleKeydown: function(event) {\n var handlerName = this.inputKeydownMap[event.keyCode];\n if (!handlerName)\n return\n this.setState({usingKeyboard: true});\n return this[handlerName].call(this,event);\n },\n\n handleOptionKeyDown: function(child, event) {\n var handlerName = this.optionKeydownMap[event.keyCode];\n if (!handlerName) {\n // if the user starts typing again while focused on an option, move focus\n // to the inpute, select so it wipes out any existing value\n this.selectInput();\n return;\n }\n event.preventDefault();\n this.setState({usingKeyboard: true});\n this[handlerName].call(this, child);\n },\n\n handleOptionMouseEnter: function(index) {\n if (this.state.usingKeyboard)\n this.setState({usingKeyboard: false});\n else\n this.focusOptionAtIndex(index);\n },\n\n selectOnEnter: function(event) {\n event.preventDefault();\n this.maybeSelectAutocompletedOption()\n },\n\n maybeSelectAutocompletedOption: function() {\n if (!this.state.matchedAutocompleteOption) {\n this.selectText()\n } else {\n this.selectOption(this.state.matchedAutocompleteOption, {focus: false});\n }\n },\n\n selectOption: function(child, options) {\n options = options || {};\n this.setState({\n // value: child.props.value,\n // inputValue: getLabel(child),\n matchedAutocompleteOption: null\n }, function() {\n this.props.onSelect(child.props.value, child);\n this.hideList();\n this.clearSelectedState(); // added\n if (options.focus !== false)\n this.selectInput();\n }.bind(this));\n this.refs.input.getDOMNode().value = '' // added\n },\n\n selectText: function() {\n var value = this.refs.input.getDOMNode().value;\n if(!value) return;\n this.props.onSelect(value);\n this.clearSelectedState();\n this.refs.input.getDOMNode().value = '' // added\n },\n\n focusNext: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var index = this.state.focusedIndex == null ?\n 0 : this.state.focusedIndex + 1;\n this.focusOptionAtIndex(index);\n },\n\n removeLastToken: function() {\n if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) {\n this.props.onRemoveLast()\n }\n return true\n },\n\n focusPrevious: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var last = this.props.children.length - 1;\n var index = this.state.focusedIndex == null ?\n last : this.state.focusedIndex - 1;\n this.focusOptionAtIndex(index);\n },\n\n focusSelectedOption: function() {\n var selectedIndex;\n React.Children.forEach(this.props.children, function(child, index) {\n if (child.props.value === this.state.value)\n selectedIndex = index;\n }.bind(this));\n this.showList();\n this.setState({\n focusedIndex: selectedIndex\n }, this.focusOption);\n },\n\n findInitialInputValue: function() {\n // TODO: might not need this, we should know this in `makeMenu`\n var inputValue;\n React.Children.forEach(this.props.children, function(child) {\n if (child.props.value === this.props.value)\n inputValue = getLabel(child);\n }.bind(this));\n return inputValue;\n },\n\n focusOptionAtIndex: function(index) {\n if (!this.state.isOpen && this.state.value)\n return this.focusSelectedOption();\n this.showList();\n var length = this.props.children.length;\n if (index === -1)\n index = length - 1;\n else if (index === length)\n index = 0;\n this.setState({\n focusedIndex: index\n }, this.focusOption);\n },\n\n focusOption: function() {\n var index = this.state.focusedIndex;\n this.refs.list.getDOMNode().childNodes[index].focus();\n },\n\n render: function() {\n var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' +\n 'Press the down arrow to navigate results. If you don\\'t find an ' +\n 'acceptable option, you can enter an alternative.'\n\n return div({className: this.getClassName()},\n this.props.value,\n this.state.inputValue,\n input({\n ref: 'input',\n autoComplete: 'off',\n spellCheck: 'false',\n 'aria-label': ariaLabel,\n 'aria-expanded': this.state.isOpen+'',\n 'aria-haspopup': 'true',\n 'aria-activedescendant': this.state.menu.activedescendant,\n 'aria-autocomplete': 'list',\n 'aria-owns': this.state.listId,\n id: this.props.id,\n className: 'ic-tokeninput-input',\n onChange: this.handleInputChange,\n onBlur: this.handleInputBlur,\n onKeyDown: this.handleKeydown,\n onKeyUp: this.handleInputKeyUp,\n role: 'combobox'\n }),\n span({\n 'aria-hidden': 'true',\n className: 'ic-tokeninput-button',\n onClick: this.handleButtonClick\n }, '▾'),\n div({\n id: this.state.listId,\n ref: 'list',\n className: 'ic-tokeninput-list',\n role: 'listbox'\n }, this.state.menu.children)\n );\n }\n});\n\nfunction getLabel(component) {\n return component.props.label || component.props.children;\n}\n\nfunction matchFragment(userInput, firstChildLabel) {\n userInput = userInput.toLowerCase();\n firstChildLabel = firstChildLabel.toLowerCase();\n if (userInput === '' || userInput === firstChildLabel)\n return false;\n if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1)\n return false;\n return true;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/combobox.js\n **/","var React = require('react');\nvar span = React.DOM.span;\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n handleClick: function() {\n this.props.onRemove(this.props.value)\n },\n\n handleKeyDown: function(key) {\n var enterKey = 13;\n if(key.keyCode === enterKey) this.props.onRemove(this.props.value)\n },\n\n render: function() {\n return (\n li({\n className: \"ic-token inline-flex\"\n },\n span({\n role: 'button',\n onClick: this.handleClick,\n onKeyDown: this.handleKeyDown,\n 'aria-label': 'Remove \\'' + this.props.name + '\\'',\n className: \"ic-token-delete-button\",\n tabIndex: 0\n }, \"✕\"),\n span({className: \"ic-token-label\"}, this.props.name)\n )\n )\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/token.js\n **/","module.exports = addClass;\n\nfunction addClass(existing, added) {\n if (!existing) return added;\n if (existing.indexOf(added) > -1) return existing;\n return existing + ' ' + added;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/add-class.js\n **/"],"sourceRoot":"","file":"react-tokeninput.js"} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 8dea60b63afaa0d9c408","webpack:///./index.js","webpack:///./lib/main.js","webpack:///./lib/option.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///./lib/combobox.js","webpack:///./lib/token.js","webpack:///./lib/add-class.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA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Q,EAAE,OAAO,KAAK,CAAC;GAC5B,IAAI,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,QAAQ,CAAC;GAClD,OAAO,QAAQ,GAAG,GAAG,GAAG,KAAK,CAAC;EAC/B","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TokenInput\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"TokenInput\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 8dea60b63afaa0d9c408\n **/","var TokenInput = require('./lib/main')\nTokenInput.Option = require('./lib/option')\n\nmodule.exports = TokenInput\n\n\n\n/** WEBPACK FOOTER **\n ** ./index.js\n **/","var React = require('react');\nvar Combobox = React.createFactory(require('./combobox'));\nvar Token = React.createFactory(require('./token'));\n\nvar ul = React.createFactory('ul');\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n propTypes: {\n onInput: React.PropTypes.func,\n onSelect: React.PropTypes.func.isRequired,\n onRemove: React.PropTypes.func.isRequired,\n selected: React.PropTypes.array.isRequired,\n menuContent: React.PropTypes.any\n },\n\n getInitialState: function() {\n return {\n selectedToken: null\n };\n },\n\n handleClick: function() {\n // TODO: Expand combobox API for focus\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleInput: function(event) {\n this.props.onInput(event);\n },\n\n handleSelect: function(event) {\n this.props.onSelect(event)\n this.setState({\n selectedToken: null\n })\n },\n\n handleRemove: function(value) {\n this.props.onRemove(value);\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleRemoveLast: function() {\n this.props.onRemove(this.props.selected[this.props.selected.length - 1]);\n },\n\n render: function() {\n var tokens = this.props.selected.map(function(token) {\n return (\n Token({\n onRemove: this.handleRemove,\n value: token,\n name: token.name,\n key: token.id})\n )\n }.bind(this))\n\n return ul({className: 'ic-tokens flex', onClick: this.handleClick},\n tokens,\n li({className: 'inline-flex', ref: 'combo-li'},\n Combobox({\n id: this.props.id,\n ariaLabel: this.props['combobox-aria-label'],\n onInput: this.handleInput,\n onSelect: this.handleSelect,\n onRemoveLast: this.handleRemoveLast,\n value: this.state.selectedToken\n },\n this.props.menuContent\n )\n )\n );\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/main.js\n **/","var React = require('react');\nvar addClass = require('./add-class');\nvar div = React.createFactory('div');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n\n /**\n * The value that will be sent to the `onSelect` handler of the\n * parent Combobox.\n */\n value: React.PropTypes.any.isRequired,\n\n /**\n * What value to put into the input element when this option is\n * selected, defaults to its children coerced to a string.\n */\n label: React.PropTypes.string\n },\n\n getDefaultProps: function() {\n return {\n role: 'option',\n tabIndex: '-1',\n className: 'ic-tokeninput-option',\n isSelected: false\n };\n },\n\n render: function() {\n var props = this.props;\n if (props.isSelected) {\n props.className = addClass(props.className, 'ic-tokeninput-selected');\n props.ariaSelected = true;\n }\n return div(props);\n }\n\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/option.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n ** module id = 3\n ** module chunks = 0\n **/","var React = require('react');\nvar guid = 0;\nvar k = function(){};\nvar addClass = require('./add-class');\nvar ComboboxOption = React.createFactory(require('./option'));\n\nvar div = React.createFactory('div');\nvar span = React.createFactory('span');\nvar input = React.createFactory('input');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n /**\n * Called when the combobox receives user input, this is your chance to\n * filter the data and rerender the options.\n *\n * Signature:\n *\n * ```js\n * function(userInput){}\n * ```\n */\n onInput: React.PropTypes.func,\n\n /**\n * Called when the combobox receives a selection. You probably want to reset\n * the options to the full list at this point.\n *\n * Signature:\n *\n * ```js\n * function(selectedValue){}\n * ```\n */\n onSelect: React.PropTypes.func\n },\n\n getDefaultProps: function() {\n return {\n autocomplete: 'both',\n onInput: k,\n onSelect: k,\n value: null\n };\n },\n\n getInitialState: function() {\n return {\n value: this.props.value,\n // the value displayed in the input\n inputValue: this.findInitialInputValue(),\n isOpen: false,\n focusedIndex: null,\n matchedAutocompleteOption: null,\n // this prevents crazy jumpiness since we focus options on mouseenter\n usingKeyboard: false,\n activedescendant: null,\n listId: 'ic-tokeninput-list-'+(++guid),\n menu: {\n children: [],\n activedescendant: null,\n isEmpty: true\n }\n };\n },\n\n componentWillMount: function() {\n this.setState({menu: this.makeMenu()});\n },\n\n componentWillReceiveProps: function(newProps) {\n this.setState({menu: this.makeMenu(newProps.children)}, function() {\n if(newProps.children.length) {\n this.showList();\n } else {\n this.hideList();\n }\n\n }.bind(this));\n },\n\n /**\n * We don't create the components, the user supplies them,\n * so before rendering we attach handlers to facilitate communication from\n * the ComboboxOption to the Combobox.\n */\n makeMenu: function(children) {\n var activedescendant;\n var isEmpty = true;\n children = children || this.props.children;\n\n // Should this instead use React.addons.cloneWithProps or React.cloneElement?\n React.Children.forEach(children, function(child, index) {\n if (child.type !== ComboboxOption.type)\n // allow random elements to live in this list\n return;\n isEmpty = false;\n // TODO: cloneWithProps and map instead of altering the children in-place\n var props = child.props;\n if (this.state.value === props.value) {\n // need an ID for WAI-ARIA\n props.id = props.id || 'ic-tokeninput-selected-'+(++guid);\n props.isSelected = true\n activedescendant = props.id;\n }\n props.onBlur = this.handleOptionBlur;\n props.onClick = this.selectOption.bind(this, child);\n props.onFocus = this.handleOptionFocus;\n props.onKeyDown = this.handleOptionKeyDown.bind(this, child);\n props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index);\n }.bind(this));\n\n return {\n children: children,\n activedescendant: activedescendant,\n isEmpty: isEmpty\n };\n },\n\n getClassName: function() {\n var className = addClass(this.props.className, 'ic-tokeninput');\n if (this.state.isOpen)\n className = addClass(className, 'ic-tokeninput-is-open');\n return className;\n },\n\n /**\n * When the user begins typing again we need to clear out any state that has\n * to do with an existing or potential selection.\n */\n clearSelectedState: function(cb) {\n this.setState({\n focusedIndex: null,\n inputValue: null,\n value: null,\n matchedAutocompleteOption: null,\n activedescendant: null\n }, cb);\n },\n\n handleInputChange: function(event) {\n var value = this.refs.input.getDOMNode().value;\n this.clearSelectedState(function() {\n this.props.onInput(value);\n }.bind(this));\n },\n\n handleInputBlur: function() {\n var focusedAnOption = this.state.focusedIndex != null;\n if (focusedAnOption)\n return;\n this.maybeSelectAutocompletedOption();\n this.hideList();\n },\n\n handleOptionBlur: function() {\n // don't want to hide the list if we focused another option\n this.blurTimer = setTimeout(this.hideList, 0);\n },\n\n handleOptionFocus: function() {\n // see `handleOptionBlur`\n clearTimeout(this.blurTimer);\n },\n\n handleInputKeyUp: function(event) {\n if (\n this.state.menu.isEmpty ||\n // autocompleting while backspacing feels super weird, so let's not\n event.keyCode === 8 /*backspace*/ ||\n !this.props.autocomplete.match(/both|inline/)\n ) return;\n },\n\n handleButtonClick: function() {\n this.state.isOpen ? this.hideList() : this.showList();\n this.focusInput();\n },\n\n showList: function() {\n if(!this.state.menu.children.length) {\n return\n }\n this.setState({isOpen: true})\n },\n\n hideList: function() {\n this.setState({isOpen: false});\n },\n\n hideOnEscape: function(event) {\n this.hideList();\n this.focusInput();\n event.preventDefault();\n },\n\n focusInput: function() {\n this.refs.input.getDOMNode().focus();\n },\n\n selectInput: function() {\n this.refs.input.getDOMNode().select();\n },\n\n inputKeydownMap: {\n 8: 'removeLastToken',\n 13: 'selectOnEnter',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n optionKeydownMap: {\n 13: 'selectOption',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n handleKeydown: function(event) {\n var handlerName = this.inputKeydownMap[event.keyCode];\n if (!handlerName)\n return\n this.setState({usingKeyboard: true});\n return this[handlerName].call(this,event);\n },\n\n handleOptionKeyDown: function(child, event) {\n var handlerName = this.optionKeydownMap[event.keyCode];\n if (!handlerName) {\n // if the user starts typing again while focused on an option, move focus\n // to the inpute, select so it wipes out any existing value\n this.selectInput();\n return;\n }\n event.preventDefault();\n this.setState({usingKeyboard: true});\n this[handlerName].call(this, child);\n },\n\n handleOptionMouseEnter: function(index) {\n if (this.state.usingKeyboard)\n this.setState({usingKeyboard: false});\n else\n this.focusOptionAtIndex(index);\n },\n\n selectOnEnter: function(event) {\n event.preventDefault();\n this.maybeSelectAutocompletedOption()\n },\n\n maybeSelectAutocompletedOption: function() {\n if (!this.state.matchedAutocompleteOption) {\n this.selectText()\n } else {\n this.selectOption(this.state.matchedAutocompleteOption, {focus: false});\n }\n },\n\n selectOption: function(child, options) {\n options = options || {};\n this.setState({\n // value: child.props.value,\n // inputValue: getLabel(child),\n matchedAutocompleteOption: null\n }, function() {\n this.props.onSelect(child.props.value, child);\n this.hideList();\n this.clearSelectedState(); // added\n if (options.focus !== false)\n this.selectInput();\n }.bind(this));\n this.refs.input.getDOMNode().value = '' // added\n },\n\n selectText: function() {\n var value = this.refs.input.getDOMNode().value;\n if(!value) return;\n this.props.onSelect(value);\n this.clearSelectedState();\n this.refs.input.getDOMNode().value = '' // added\n },\n\n focusNext: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var index = this.state.focusedIndex == null ?\n 0 : this.state.focusedIndex + 1;\n this.focusOptionAtIndex(index);\n },\n\n removeLastToken: function() {\n if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) {\n this.props.onRemoveLast()\n }\n return true\n },\n\n focusPrevious: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var last = this.props.children.length - 1;\n var index = this.state.focusedIndex == null ?\n last : this.state.focusedIndex - 1;\n this.focusOptionAtIndex(index);\n },\n\n focusSelectedOption: function() {\n var selectedIndex;\n React.Children.forEach(this.props.children, function(child, index) {\n if (child.props.value === this.state.value)\n selectedIndex = index;\n }.bind(this));\n this.showList();\n this.setState({\n focusedIndex: selectedIndex\n }, this.focusOption);\n },\n\n findInitialInputValue: function() {\n // TODO: might not need this, we should know this in `makeMenu`\n var inputValue;\n React.Children.forEach(this.props.children, function(child) {\n if (child.props.value === this.props.value)\n inputValue = getLabel(child);\n }.bind(this));\n return inputValue;\n },\n\n focusOptionAtIndex: function(index) {\n if (!this.state.isOpen && this.state.value)\n return this.focusSelectedOption();\n this.showList();\n var length = this.props.children.length;\n if (index === -1)\n index = length - 1;\n else if (index === length)\n index = 0;\n this.setState({\n focusedIndex: index\n }, this.focusOption);\n },\n\n focusOption: function() {\n var index = this.state.focusedIndex;\n this.refs.list.getDOMNode().childNodes[index].focus();\n },\n\n render: function() {\n var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' +\n 'Press the down arrow to navigate results. If you don\\'t find an ' +\n 'acceptable option, you can enter an alternative.'\n\n return div({className: this.getClassName()},\n this.props.value,\n this.state.inputValue,\n input({\n ref: 'input',\n autoComplete: 'off',\n spellCheck: 'false',\n 'aria-label': ariaLabel,\n 'aria-expanded': this.state.isOpen+'',\n 'aria-haspopup': 'true',\n 'aria-activedescendant': this.state.menu.activedescendant,\n 'aria-autocomplete': 'list',\n 'aria-owns': this.state.listId,\n id: this.props.id,\n className: 'ic-tokeninput-input',\n onChange: this.handleInputChange,\n onBlur: this.handleInputBlur,\n onKeyDown: this.handleKeydown,\n onKeyUp: this.handleInputKeyUp,\n role: 'combobox'\n }),\n span({\n 'aria-hidden': 'true',\n className: 'ic-tokeninput-button',\n onClick: this.handleButtonClick\n }, '▾'),\n div({\n id: this.state.listId,\n ref: 'list',\n className: 'ic-tokeninput-list',\n role: 'listbox'\n }, this.state.menu.children)\n );\n }\n});\n\nfunction getLabel(component) {\n return component.props.label || component.props.children;\n}\n\nfunction matchFragment(userInput, firstChildLabel) {\n userInput = userInput.toLowerCase();\n firstChildLabel = firstChildLabel.toLowerCase();\n if (userInput === '' || userInput === firstChildLabel)\n return false;\n if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1)\n return false;\n return true;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/combobox.js\n **/","var React = require('react');\nvar span = React.DOM.span;\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n handleClick: function() {\n this.props.onRemove(this.props.value)\n },\n\n handleKeyDown: function(key) {\n var enterKey = 13;\n if(key.keyCode === enterKey) this.props.onRemove(this.props.value)\n },\n\n render: function() {\n return (\n li({\n className: \"ic-token inline-flex\"\n },\n span({\n role: 'button',\n onClick: this.handleClick,\n onKeyDown: this.handleKeyDown,\n 'aria-label': 'Remove \\'' + this.props.name + '\\'',\n className: \"ic-token-delete-button\",\n tabIndex: 0\n }, \"✕\"),\n span({className: \"ic-token-label\"}, this.props.name)\n )\n )\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/token.js\n **/","module.exports = addClass;\n\nfunction addClass(existing, added) {\n if (!existing) return added;\n if (existing.indexOf(added) > -1) return existing;\n return existing + ' ' + added;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/add-class.js\n **/"],"sourceRoot":"","file":"react-tokeninput.js"} \ No newline at end of file From 696676cec773f2eede6e2563cce8336bc7675940 Mon Sep 17 00:00:00 2001 From: Aaron Shafovaloff Date: Mon, 23 Mar 2015 13:44:58 -0600 Subject: [PATCH 09/62] only expand dropdown if combobox has focus --- README.md | 9 +- dist/react-tokeninput.js | 2 +- dist/react-tokeninput.js.map | 2 +- dist/react-tokeninput.min.js | 2 +- dist/react-tokeninput.min.js.map | 2 +- example/flavors.js | 4 - example/main.js | 16 +- example/names.js | 1808 ++++++++++++++++++++++++++++++ example/webpack.config.js | 16 + lib/combobox.js | 2 +- package.json | 11 +- script/dev | 2 - 12 files changed, 1849 insertions(+), 27 deletions(-) delete mode 100644 example/flavors.js create mode 100644 example/names.js create mode 100644 example/webpack.config.js delete mode 100755 script/dev diff --git a/README.md b/README.md index 251d56e..d17c631 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,13 @@ See example implementation in `example/`. ## Development ``` -chmod u+x ./script/dev -./script/dev +npm run dev +``` + +## Build + +``` +npm run build ``` ## Test diff --git a/dist/react-tokeninput.js b/dist/react-tokeninput.js index 39124ec..9c11a2f 100644 --- a/dist/react-tokeninput.js +++ b/dist/react-tokeninput.js @@ -270,7 +270,7 @@ return /******/ (function(modules) { // webpackBootstrap componentWillReceiveProps: function(newProps) { this.setState({menu: this.makeMenu(newProps.children)}, function() { - if(newProps.children.length) { + if(newProps.children.length && (this.isOpen || document.activeElement === this.refs.input.getDOMNode())) { this.showList(); } else { this.hideList(); diff --git a/dist/react-tokeninput.js.map b/dist/react-tokeninput.js.map index f1a0bea..ae65823 100644 --- a/dist/react-tokeninput.js.map +++ b/dist/react-tokeninput.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 8dea60b63afaa0d9c408","webpack:///./index.js","webpack:///./lib/main.js","webpack:///./lib/option.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///./lib/combobox.js","webpack:///./lib/token.js","webpack:///./lib/add-class.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,wC;;;;;;;ACtCA,KAAI,UAAU,GAAG,mBAAO,CAAC,CAAY,CAAC;AACtC,WAAU,CAAC,MAAM,GAAG,mBAAO,CAAC,CAAc,CAAC;;AAE3C,OAAM,CAAC,OAAO,GAAG,UAAU;;;;;;;ACH3B,KAAI,KAAK,GAAG,mBAAO,CAAC,CAAO,CAAC,CAAC;AAC7B,KAAI,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,mBAAO,CAAC,CAAY,CAAC,CAAC,CAAC;AAC1D,KAAI,KAAK,GAAG,KAAK,CAAC,aAAa,CAAC,mBAAO,CAAC,CAAS,CAAC,CAAC,CAAC;;AAEpD,KAAI,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;AACnC,KAAI,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;;AAEnC,qCAAoC;GAClC,SAAS,EAAE;KACT,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI;KAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU;KACzC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC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I,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI;WAClD,SAAS,EAAE,wBAAwB;WACnC,QAAQ,EAAE,CAAC;UACZ,EAAE,GAAG,CAAC;SACP,IAAI,CAAC,CAAC,SAAS,EAAE,gBAAgB,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;QACrD;MACF;IACF;EACF,CAAC;;;;;;;AC/BF,OAAM,CAAC,OAAO,GAAG,QAAQ,CAAC;;AAE1B,UAAS,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAE;GACjC,IAAI,CAAC,QAAQ,EAAE,OAAO,KAAK,CAAC;GAC5B,IAAI,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,QAAQ,CAAC;GAClD,OAAO,QAAQ,GAAG,GAAG,GAAG,KAAK,CAAC;EAC/B","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TokenInput\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"TokenInput\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 8dea60b63afaa0d9c408\n **/","var TokenInput = require('./lib/main')\nTokenInput.Option = require('./lib/option')\n\nmodule.exports = TokenInput\n\n\n\n/** WEBPACK FOOTER **\n ** ./index.js\n **/","var React = require('react');\nvar Combobox = React.createFactory(require('./combobox'));\nvar Token = React.createFactory(require('./token'));\n\nvar ul = React.createFactory('ul');\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n propTypes: {\n onInput: React.PropTypes.func,\n onSelect: React.PropTypes.func.isRequired,\n onRemove: React.PropTypes.func.isRequired,\n selected: React.PropTypes.array.isRequired,\n menuContent: React.PropTypes.any\n },\n\n getInitialState: function() {\n return {\n selectedToken: null\n };\n },\n\n handleClick: function() {\n // TODO: Expand combobox API for focus\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleInput: function(event) {\n this.props.onInput(event);\n },\n\n handleSelect: function(event) {\n this.props.onSelect(event)\n this.setState({\n selectedToken: null\n })\n },\n\n handleRemove: function(value) {\n this.props.onRemove(value);\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleRemoveLast: function() {\n this.props.onRemove(this.props.selected[this.props.selected.length - 1]);\n },\n\n render: function() {\n var tokens = this.props.selected.map(function(token) {\n return (\n Token({\n onRemove: this.handleRemove,\n value: token,\n name: token.name,\n key: token.id})\n )\n }.bind(this))\n\n return ul({className: 'ic-tokens flex', onClick: this.handleClick},\n tokens,\n li({className: 'inline-flex', ref: 'combo-li'},\n Combobox({\n id: this.props.id,\n ariaLabel: this.props['combobox-aria-label'],\n onInput: this.handleInput,\n onSelect: this.handleSelect,\n onRemoveLast: this.handleRemoveLast,\n value: this.state.selectedToken\n },\n this.props.menuContent\n )\n )\n );\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/main.js\n **/","var React = require('react');\nvar addClass = require('./add-class');\nvar div = React.createFactory('div');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n\n /**\n * The value that will be sent to the `onSelect` handler of the\n * parent Combobox.\n */\n value: React.PropTypes.any.isRequired,\n\n /**\n * What value to put into the input element when this option is\n * selected, defaults to its children coerced to a string.\n */\n label: React.PropTypes.string\n },\n\n getDefaultProps: function() {\n return {\n role: 'option',\n tabIndex: '-1',\n className: 'ic-tokeninput-option',\n isSelected: false\n };\n },\n\n render: function() {\n var props = this.props;\n if (props.isSelected) {\n props.className = addClass(props.className, 'ic-tokeninput-selected');\n props.ariaSelected = true;\n }\n return div(props);\n }\n\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/option.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n ** module id = 3\n ** module chunks = 0\n **/","var React = require('react');\nvar guid = 0;\nvar k = function(){};\nvar addClass = require('./add-class');\nvar ComboboxOption = React.createFactory(require('./option'));\n\nvar div = React.createFactory('div');\nvar span = React.createFactory('span');\nvar input = React.createFactory('input');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n /**\n * Called when the combobox receives user input, this is your chance to\n * filter the data and rerender the options.\n *\n * Signature:\n *\n * ```js\n * function(userInput){}\n * ```\n */\n onInput: React.PropTypes.func,\n\n /**\n * Called when the combobox receives a selection. You probably want to reset\n * the options to the full list at this point.\n *\n * Signature:\n *\n * ```js\n * function(selectedValue){}\n * ```\n */\n onSelect: React.PropTypes.func\n },\n\n getDefaultProps: function() {\n return {\n autocomplete: 'both',\n onInput: k,\n onSelect: k,\n value: null\n };\n },\n\n getInitialState: function() {\n return {\n value: this.props.value,\n // the value displayed in the input\n inputValue: this.findInitialInputValue(),\n isOpen: false,\n focusedIndex: null,\n matchedAutocompleteOption: null,\n // this prevents crazy jumpiness since we focus options on mouseenter\n usingKeyboard: false,\n activedescendant: null,\n listId: 'ic-tokeninput-list-'+(++guid),\n menu: {\n children: [],\n activedescendant: null,\n isEmpty: true\n }\n };\n },\n\n componentWillMount: function() {\n this.setState({menu: this.makeMenu()});\n },\n\n componentWillReceiveProps: function(newProps) {\n this.setState({menu: this.makeMenu(newProps.children)}, function() {\n if(newProps.children.length) {\n this.showList();\n } else {\n this.hideList();\n }\n\n }.bind(this));\n },\n\n /**\n * We don't create the components, the user supplies them,\n * so before rendering we attach handlers to facilitate communication from\n * the ComboboxOption to the Combobox.\n */\n makeMenu: function(children) {\n var activedescendant;\n var isEmpty = true;\n children = children || this.props.children;\n\n // Should this instead use React.addons.cloneWithProps or React.cloneElement?\n React.Children.forEach(children, function(child, index) {\n if (child.type !== ComboboxOption.type)\n // allow random elements to live in this list\n return;\n isEmpty = false;\n // TODO: cloneWithProps and map instead of altering the children in-place\n var props = child.props;\n if (this.state.value === props.value) {\n // need an ID for WAI-ARIA\n props.id = props.id || 'ic-tokeninput-selected-'+(++guid);\n props.isSelected = true\n activedescendant = props.id;\n }\n props.onBlur = this.handleOptionBlur;\n props.onClick = this.selectOption.bind(this, child);\n props.onFocus = this.handleOptionFocus;\n props.onKeyDown = this.handleOptionKeyDown.bind(this, child);\n props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index);\n }.bind(this));\n\n return {\n children: children,\n activedescendant: activedescendant,\n isEmpty: isEmpty\n };\n },\n\n getClassName: function() {\n var className = addClass(this.props.className, 'ic-tokeninput');\n if (this.state.isOpen)\n className = addClass(className, 'ic-tokeninput-is-open');\n return className;\n },\n\n /**\n * When the user begins typing again we need to clear out any state that has\n * to do with an existing or potential selection.\n */\n clearSelectedState: function(cb) {\n this.setState({\n focusedIndex: null,\n inputValue: null,\n value: null,\n matchedAutocompleteOption: null,\n activedescendant: null\n }, cb);\n },\n\n handleInputChange: function(event) {\n var value = this.refs.input.getDOMNode().value;\n this.clearSelectedState(function() {\n this.props.onInput(value);\n }.bind(this));\n },\n\n handleInputBlur: function() {\n var focusedAnOption = this.state.focusedIndex != null;\n if (focusedAnOption)\n return;\n this.maybeSelectAutocompletedOption();\n this.hideList();\n },\n\n handleOptionBlur: function() {\n // don't want to hide the list if we focused another option\n this.blurTimer = setTimeout(this.hideList, 0);\n },\n\n handleOptionFocus: function() {\n // see `handleOptionBlur`\n clearTimeout(this.blurTimer);\n },\n\n handleInputKeyUp: function(event) {\n if (\n this.state.menu.isEmpty ||\n // autocompleting while backspacing feels super weird, so let's not\n event.keyCode === 8 /*backspace*/ ||\n !this.props.autocomplete.match(/both|inline/)\n ) return;\n },\n\n handleButtonClick: function() {\n this.state.isOpen ? this.hideList() : this.showList();\n this.focusInput();\n },\n\n showList: function() {\n if(!this.state.menu.children.length) {\n return\n }\n this.setState({isOpen: true})\n },\n\n hideList: function() {\n this.setState({isOpen: false});\n },\n\n hideOnEscape: function(event) {\n this.hideList();\n this.focusInput();\n event.preventDefault();\n },\n\n focusInput: function() {\n this.refs.input.getDOMNode().focus();\n },\n\n selectInput: function() {\n this.refs.input.getDOMNode().select();\n },\n\n inputKeydownMap: {\n 8: 'removeLastToken',\n 13: 'selectOnEnter',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n optionKeydownMap: {\n 13: 'selectOption',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n handleKeydown: function(event) {\n var handlerName = this.inputKeydownMap[event.keyCode];\n if (!handlerName)\n return\n this.setState({usingKeyboard: true});\n return this[handlerName].call(this,event);\n },\n\n handleOptionKeyDown: function(child, event) {\n var handlerName = this.optionKeydownMap[event.keyCode];\n if (!handlerName) {\n // if the user starts typing again while focused on an option, move focus\n // to the inpute, select so it wipes out any existing value\n this.selectInput();\n return;\n }\n event.preventDefault();\n this.setState({usingKeyboard: true});\n this[handlerName].call(this, child);\n },\n\n handleOptionMouseEnter: function(index) {\n if (this.state.usingKeyboard)\n this.setState({usingKeyboard: false});\n else\n this.focusOptionAtIndex(index);\n },\n\n selectOnEnter: function(event) {\n event.preventDefault();\n this.maybeSelectAutocompletedOption()\n },\n\n maybeSelectAutocompletedOption: function() {\n if (!this.state.matchedAutocompleteOption) {\n this.selectText()\n } else {\n this.selectOption(this.state.matchedAutocompleteOption, {focus: false});\n }\n },\n\n selectOption: function(child, options) {\n options = options || {};\n this.setState({\n // value: child.props.value,\n // inputValue: getLabel(child),\n matchedAutocompleteOption: null\n }, function() {\n this.props.onSelect(child.props.value, child);\n this.hideList();\n this.clearSelectedState(); // added\n if (options.focus !== false)\n this.selectInput();\n }.bind(this));\n this.refs.input.getDOMNode().value = '' // added\n },\n\n selectText: function() {\n var value = this.refs.input.getDOMNode().value;\n if(!value) return;\n this.props.onSelect(value);\n this.clearSelectedState();\n this.refs.input.getDOMNode().value = '' // added\n },\n\n focusNext: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var index = this.state.focusedIndex == null ?\n 0 : this.state.focusedIndex + 1;\n this.focusOptionAtIndex(index);\n },\n\n removeLastToken: function() {\n if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) {\n this.props.onRemoveLast()\n }\n return true\n },\n\n focusPrevious: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var last = this.props.children.length - 1;\n var index = this.state.focusedIndex == null ?\n last : this.state.focusedIndex - 1;\n this.focusOptionAtIndex(index);\n },\n\n focusSelectedOption: function() {\n var selectedIndex;\n React.Children.forEach(this.props.children, function(child, index) {\n if (child.props.value === this.state.value)\n selectedIndex = index;\n }.bind(this));\n this.showList();\n this.setState({\n focusedIndex: selectedIndex\n }, this.focusOption);\n },\n\n findInitialInputValue: function() {\n // TODO: might not need this, we should know this in `makeMenu`\n var inputValue;\n React.Children.forEach(this.props.children, function(child) {\n if (child.props.value === this.props.value)\n inputValue = getLabel(child);\n }.bind(this));\n return inputValue;\n },\n\n focusOptionAtIndex: function(index) {\n if (!this.state.isOpen && this.state.value)\n return this.focusSelectedOption();\n this.showList();\n var length = this.props.children.length;\n if (index === -1)\n index = length - 1;\n else if (index === length)\n index = 0;\n this.setState({\n focusedIndex: index\n }, this.focusOption);\n },\n\n focusOption: function() {\n var index = this.state.focusedIndex;\n this.refs.list.getDOMNode().childNodes[index].focus();\n },\n\n render: function() {\n var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' +\n 'Press the down arrow to navigate results. If you don\\'t find an ' +\n 'acceptable option, you can enter an alternative.'\n\n return div({className: this.getClassName()},\n this.props.value,\n this.state.inputValue,\n input({\n ref: 'input',\n autoComplete: 'off',\n spellCheck: 'false',\n 'aria-label': ariaLabel,\n 'aria-expanded': this.state.isOpen+'',\n 'aria-haspopup': 'true',\n 'aria-activedescendant': this.state.menu.activedescendant,\n 'aria-autocomplete': 'list',\n 'aria-owns': this.state.listId,\n id: this.props.id,\n className: 'ic-tokeninput-input',\n onChange: this.handleInputChange,\n onBlur: this.handleInputBlur,\n onKeyDown: this.handleKeydown,\n onKeyUp: this.handleInputKeyUp,\n role: 'combobox'\n }),\n span({\n 'aria-hidden': 'true',\n className: 'ic-tokeninput-button',\n onClick: this.handleButtonClick\n }, '▾'),\n div({\n id: this.state.listId,\n ref: 'list',\n className: 'ic-tokeninput-list',\n role: 'listbox'\n }, this.state.menu.children)\n );\n }\n});\n\nfunction getLabel(component) {\n return component.props.label || component.props.children;\n}\n\nfunction matchFragment(userInput, firstChildLabel) {\n userInput = userInput.toLowerCase();\n firstChildLabel = firstChildLabel.toLowerCase();\n if (userInput === '' || userInput === firstChildLabel)\n return false;\n if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1)\n return false;\n return true;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/combobox.js\n **/","var React = require('react');\nvar span = React.DOM.span;\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n handleClick: function() {\n this.props.onRemove(this.props.value)\n },\n\n handleKeyDown: function(key) {\n var enterKey = 13;\n if(key.keyCode === enterKey) this.props.onRemove(this.props.value)\n },\n\n render: function() {\n return (\n li({\n className: \"ic-token inline-flex\"\n },\n span({\n role: 'button',\n onClick: this.handleClick,\n onKeyDown: this.handleKeyDown,\n 'aria-label': 'Remove \\'' + this.props.name + '\\'',\n className: \"ic-token-delete-button\",\n tabIndex: 0\n }, \"✕\"),\n span({className: \"ic-token-label\"}, this.props.name)\n )\n )\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/token.js\n **/","module.exports = addClass;\n\nfunction addClass(existing, added) {\n if (!existing) return added;\n if (existing.indexOf(added) > -1) return existing;\n return existing + ' ' + added;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/add-class.js\n **/"],"sourceRoot":"","file":"react-tokeninput.js"} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 7a293cd9a32b2a816802","webpack:///./index.js","webpack:///./lib/main.js","webpack:///./lib/option.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///./lib/combobox.js","webpack:///./lib/token.js","webpack:///./lib/add-class.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,wC;;;;;;;ACtCA,KAAI,UAAU,GAAG,mBAAO,CAAC,CAAY,CAAC;AACtC,WAAU,CAAC,MAAM,GAAG,mBAAO,CAAC,CAAc,CAAC;;AAE3C,OAAM,CAAC,OAAO,GAAG,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(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TokenInput\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"TokenInput\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 7a293cd9a32b2a816802\n **/","var TokenInput = require('./lib/main')\nTokenInput.Option = require('./lib/option')\n\nmodule.exports = TokenInput\n\n\n\n/** WEBPACK FOOTER **\n ** ./index.js\n **/","var React = require('react');\nvar Combobox = React.createFactory(require('./combobox'));\nvar Token = React.createFactory(require('./token'));\n\nvar ul = React.createFactory('ul');\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n propTypes: {\n onInput: React.PropTypes.func,\n onSelect: React.PropTypes.func.isRequired,\n onRemove: React.PropTypes.func.isRequired,\n selected: React.PropTypes.array.isRequired,\n menuContent: React.PropTypes.any\n },\n\n getInitialState: function() {\n return {\n selectedToken: null\n };\n },\n\n handleClick: function() {\n // TODO: Expand combobox API for focus\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleInput: function(event) {\n this.props.onInput(event);\n },\n\n handleSelect: function(event) {\n this.props.onSelect(event)\n this.setState({\n selectedToken: null\n })\n },\n\n handleRemove: function(value) {\n this.props.onRemove(value);\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleRemoveLast: function() {\n this.props.onRemove(this.props.selected[this.props.selected.length - 1]);\n },\n\n render: function() {\n var tokens = this.props.selected.map(function(token) {\n return (\n Token({\n onRemove: this.handleRemove,\n value: token,\n name: token.name,\n key: token.id})\n )\n }.bind(this))\n\n return ul({className: 'ic-tokens flex', onClick: this.handleClick},\n tokens,\n li({className: 'inline-flex', ref: 'combo-li'},\n Combobox({\n id: this.props.id,\n ariaLabel: this.props['combobox-aria-label'],\n onInput: this.handleInput,\n onSelect: this.handleSelect,\n onRemoveLast: this.handleRemoveLast,\n value: this.state.selectedToken\n },\n this.props.menuContent\n )\n )\n );\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/main.js\n **/","var React = require('react');\nvar addClass = require('./add-class');\nvar div = React.createFactory('div');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n\n /**\n * The value that will be sent to the `onSelect` handler of the\n * parent Combobox.\n */\n value: React.PropTypes.any.isRequired,\n\n /**\n * What value to put into the input element when this option is\n * selected, defaults to its children coerced to a string.\n */\n label: React.PropTypes.string\n },\n\n getDefaultProps: function() {\n return {\n role: 'option',\n tabIndex: '-1',\n className: 'ic-tokeninput-option',\n isSelected: false\n };\n },\n\n render: function() {\n var props = this.props;\n if (props.isSelected) {\n props.className = addClass(props.className, 'ic-tokeninput-selected');\n props.ariaSelected = true;\n }\n return div(props);\n }\n\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/option.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n ** module id = 3\n ** module chunks = 0\n **/","var React = require('react');\nvar guid = 0;\nvar k = function(){};\nvar addClass = require('./add-class');\nvar ComboboxOption = React.createFactory(require('./option'));\n\nvar div = React.createFactory('div');\nvar span = React.createFactory('span');\nvar input = React.createFactory('input');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n /**\n * Called when the combobox receives user input, this is your chance to\n * filter the data and rerender the options.\n *\n * Signature:\n *\n * ```js\n * function(userInput){}\n * ```\n */\n onInput: React.PropTypes.func,\n\n /**\n * Called when the combobox receives a selection. You probably want to reset\n * the options to the full list at this point.\n *\n * Signature:\n *\n * ```js\n * function(selectedValue){}\n * ```\n */\n onSelect: React.PropTypes.func\n },\n\n getDefaultProps: function() {\n return {\n autocomplete: 'both',\n onInput: k,\n onSelect: k,\n value: null\n };\n },\n\n getInitialState: function() {\n return {\n value: this.props.value,\n // the value displayed in the input\n inputValue: this.findInitialInputValue(),\n isOpen: false,\n focusedIndex: null,\n matchedAutocompleteOption: null,\n // this prevents crazy jumpiness since we focus options on mouseenter\n usingKeyboard: false,\n activedescendant: null,\n listId: 'ic-tokeninput-list-'+(++guid),\n menu: {\n children: [],\n activedescendant: null,\n isEmpty: true\n }\n };\n },\n\n componentWillMount: function() {\n this.setState({menu: this.makeMenu()});\n },\n\n componentWillReceiveProps: function(newProps) {\n this.setState({menu: this.makeMenu(newProps.children)}, function() {\n if(newProps.children.length && (this.isOpen || document.activeElement === this.refs.input.getDOMNode())) {\n this.showList();\n } else {\n this.hideList();\n }\n\n }.bind(this));\n },\n\n /**\n * We don't create the components, the user supplies them,\n * so before rendering we attach handlers to facilitate communication from\n * the ComboboxOption to the Combobox.\n */\n makeMenu: function(children) {\n var activedescendant;\n var isEmpty = true;\n children = children || this.props.children;\n\n // Should this instead use React.addons.cloneWithProps or React.cloneElement?\n React.Children.forEach(children, function(child, index) {\n if (child.type !== ComboboxOption.type)\n // allow random elements to live in this list\n return;\n isEmpty = false;\n // TODO: cloneWithProps and map instead of altering the children in-place\n var props = child.props;\n if (this.state.value === props.value) {\n // need an ID for WAI-ARIA\n props.id = props.id || 'ic-tokeninput-selected-'+(++guid);\n props.isSelected = true\n activedescendant = props.id;\n }\n props.onBlur = this.handleOptionBlur;\n props.onClick = this.selectOption.bind(this, child);\n props.onFocus = this.handleOptionFocus;\n props.onKeyDown = this.handleOptionKeyDown.bind(this, child);\n props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index);\n }.bind(this));\n\n return {\n children: children,\n activedescendant: activedescendant,\n isEmpty: isEmpty\n };\n },\n\n getClassName: function() {\n var className = addClass(this.props.className, 'ic-tokeninput');\n if (this.state.isOpen)\n className = addClass(className, 'ic-tokeninput-is-open');\n return className;\n },\n\n /**\n * When the user begins typing again we need to clear out any state that has\n * to do with an existing or potential selection.\n */\n clearSelectedState: function(cb) {\n this.setState({\n focusedIndex: null,\n inputValue: null,\n value: null,\n matchedAutocompleteOption: null,\n activedescendant: null\n }, cb);\n },\n\n handleInputChange: function(event) {\n var value = this.refs.input.getDOMNode().value;\n this.clearSelectedState(function() {\n this.props.onInput(value);\n }.bind(this));\n },\n\n handleInputBlur: function() {\n var focusedAnOption = this.state.focusedIndex != null;\n if (focusedAnOption)\n return;\n this.maybeSelectAutocompletedOption();\n this.hideList();\n },\n\n handleOptionBlur: function() {\n // don't want to hide the list if we focused another option\n this.blurTimer = setTimeout(this.hideList, 0);\n },\n\n handleOptionFocus: function() {\n // see `handleOptionBlur`\n clearTimeout(this.blurTimer);\n },\n\n handleInputKeyUp: function(event) {\n if (\n this.state.menu.isEmpty ||\n // autocompleting while backspacing feels super weird, so let's not\n event.keyCode === 8 /*backspace*/ ||\n !this.props.autocomplete.match(/both|inline/)\n ) return;\n },\n\n handleButtonClick: function() {\n this.state.isOpen ? this.hideList() : this.showList();\n this.focusInput();\n },\n\n showList: function() {\n if(!this.state.menu.children.length) {\n return\n }\n this.setState({isOpen: true})\n },\n\n hideList: function() {\n this.setState({isOpen: false});\n },\n\n hideOnEscape: function(event) {\n this.hideList();\n this.focusInput();\n event.preventDefault();\n },\n\n focusInput: function() {\n this.refs.input.getDOMNode().focus();\n },\n\n selectInput: function() {\n this.refs.input.getDOMNode().select();\n },\n\n inputKeydownMap: {\n 8: 'removeLastToken',\n 13: 'selectOnEnter',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n optionKeydownMap: {\n 13: 'selectOption',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n handleKeydown: function(event) {\n var handlerName = this.inputKeydownMap[event.keyCode];\n if (!handlerName)\n return\n this.setState({usingKeyboard: true});\n return this[handlerName].call(this,event);\n },\n\n handleOptionKeyDown: function(child, event) {\n var handlerName = this.optionKeydownMap[event.keyCode];\n if (!handlerName) {\n // if the user starts typing again while focused on an option, move focus\n // to the inpute, select so it wipes out any existing value\n this.selectInput();\n return;\n }\n event.preventDefault();\n this.setState({usingKeyboard: true});\n this[handlerName].call(this, child);\n },\n\n handleOptionMouseEnter: function(index) {\n if (this.state.usingKeyboard)\n this.setState({usingKeyboard: false});\n else\n this.focusOptionAtIndex(index);\n },\n\n selectOnEnter: function(event) {\n event.preventDefault();\n this.maybeSelectAutocompletedOption()\n },\n\n maybeSelectAutocompletedOption: function() {\n if (!this.state.matchedAutocompleteOption) {\n this.selectText()\n } else {\n this.selectOption(this.state.matchedAutocompleteOption, {focus: false});\n }\n },\n\n selectOption: function(child, options) {\n options = options || {};\n this.setState({\n // value: child.props.value,\n // inputValue: getLabel(child),\n matchedAutocompleteOption: null\n }, function() {\n this.props.onSelect(child.props.value, child);\n this.hideList();\n this.clearSelectedState(); // added\n if (options.focus !== false)\n this.selectInput();\n }.bind(this));\n this.refs.input.getDOMNode().value = '' // added\n },\n\n selectText: function() {\n var value = this.refs.input.getDOMNode().value;\n if(!value) return;\n this.props.onSelect(value);\n this.clearSelectedState();\n this.refs.input.getDOMNode().value = '' // added\n },\n\n focusNext: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var index = this.state.focusedIndex == null ?\n 0 : this.state.focusedIndex + 1;\n this.focusOptionAtIndex(index);\n },\n\n removeLastToken: function() {\n if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) {\n this.props.onRemoveLast()\n }\n return true\n },\n\n focusPrevious: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var last = this.props.children.length - 1;\n var index = this.state.focusedIndex == null ?\n last : this.state.focusedIndex - 1;\n this.focusOptionAtIndex(index);\n },\n\n focusSelectedOption: function() {\n var selectedIndex;\n React.Children.forEach(this.props.children, function(child, index) {\n if (child.props.value === this.state.value)\n selectedIndex = index;\n }.bind(this));\n this.showList();\n this.setState({\n focusedIndex: selectedIndex\n }, this.focusOption);\n },\n\n findInitialInputValue: function() {\n // TODO: might not need this, we should know this in `makeMenu`\n var inputValue;\n React.Children.forEach(this.props.children, function(child) {\n if (child.props.value === this.props.value)\n inputValue = getLabel(child);\n }.bind(this));\n return inputValue;\n },\n\n focusOptionAtIndex: function(index) {\n if (!this.state.isOpen && this.state.value)\n return this.focusSelectedOption();\n this.showList();\n var length = this.props.children.length;\n if (index === -1)\n index = length - 1;\n else if (index === length)\n index = 0;\n this.setState({\n focusedIndex: index\n }, this.focusOption);\n },\n\n focusOption: function() {\n var index = this.state.focusedIndex;\n this.refs.list.getDOMNode().childNodes[index].focus();\n },\n\n render: function() {\n var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' +\n 'Press the down arrow to navigate results. If you don\\'t find an ' +\n 'acceptable option, you can enter an alternative.'\n\n return div({className: this.getClassName()},\n this.props.value,\n this.state.inputValue,\n input({\n ref: 'input',\n autoComplete: 'off',\n spellCheck: 'false',\n 'aria-label': ariaLabel,\n 'aria-expanded': this.state.isOpen+'',\n 'aria-haspopup': 'true',\n 'aria-activedescendant': this.state.menu.activedescendant,\n 'aria-autocomplete': 'list',\n 'aria-owns': this.state.listId,\n id: this.props.id,\n className: 'ic-tokeninput-input',\n onChange: this.handleInputChange,\n onBlur: this.handleInputBlur,\n onKeyDown: this.handleKeydown,\n onKeyUp: this.handleInputKeyUp,\n role: 'combobox'\n }),\n span({\n 'aria-hidden': 'true',\n className: 'ic-tokeninput-button',\n onClick: this.handleButtonClick\n }, '▾'),\n div({\n id: this.state.listId,\n ref: 'list',\n className: 'ic-tokeninput-list',\n role: 'listbox'\n }, this.state.menu.children)\n );\n }\n});\n\nfunction getLabel(component) {\n return component.props.label || component.props.children;\n}\n\nfunction matchFragment(userInput, firstChildLabel) {\n userInput = userInput.toLowerCase();\n firstChildLabel = firstChildLabel.toLowerCase();\n if (userInput === '' || userInput === firstChildLabel)\n return false;\n if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1)\n return false;\n return true;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/combobox.js\n **/","var React = require('react');\nvar span = React.DOM.span;\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n handleClick: function() {\n this.props.onRemove(this.props.value)\n },\n\n handleKeyDown: function(key) {\n var enterKey = 13;\n if(key.keyCode === enterKey) this.props.onRemove(this.props.value)\n },\n\n render: function() {\n return (\n li({\n className: \"ic-token inline-flex\"\n },\n span({\n role: 'button',\n onClick: this.handleClick,\n onKeyDown: this.handleKeyDown,\n 'aria-label': 'Remove \\'' + this.props.name + '\\'',\n className: \"ic-token-delete-button\",\n tabIndex: 0\n }, \"✕\"),\n span({className: \"ic-token-label\"}, this.props.name)\n )\n )\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/token.js\n **/","module.exports = addClass;\n\nfunction addClass(existing, added) {\n if (!existing) return added;\n if (existing.indexOf(added) > -1) return existing;\n return existing + ' ' + added;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/add-class.js\n **/"],"sourceRoot":"","file":"react-tokeninput.js"} \ No newline at end of file diff --git a/dist/react-tokeninput.min.js b/dist/react-tokeninput.min.js index 7ffd4f1..855dc74 100644 --- a/dist/react-tokeninput.min.js +++ b/dist/react-tokeninput.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.TokenInput=t(require("react")):e.TokenInput=t(e.React)}(this,function(e){return function(e){function t(i){if(n[i])return n[i].exports;var s=n[i]={exports:{},id:i,loaded:!1};return e[i].call(s.exports,s,s.exports,t),s.loaded=!0,s.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var i=n(1);i.Option=n(2),e.exports=i},function(e,t,n){var i=n(3),s=i.createFactory(n(4)),o=i.createFactory(n(5)),a=i.createFactory("ul"),u=i.createFactory("li");e.exports=i.createClass({displayName:"exports",propTypes:{onInput:i.PropTypes.func,onSelect:i.PropTypes.func.isRequired,onRemove:i.PropTypes.func.isRequired,selected:i.PropTypes.array.isRequired,menuContent:i.PropTypes.any},getInitialState:function(){return{selectedToken:null}},handleClick:function(){this.refs["combo-li"].getDOMNode().querySelector("input").focus()},handleInput:function(e){this.props.onInput(e)},handleSelect:function(e){this.props.onSelect(e),this.setState({selectedToken:null})},handleRemove:function(e){this.props.onRemove(e),this.refs["combo-li"].getDOMNode().querySelector("input").focus()},handleRemoveLast:function(){this.props.onRemove(this.props.selected[this.props.selected.length-1])},render:function(){var e=this.props.selected.map(function(e){return o({onRemove:this.handleRemove,value:e,name:e.name,key:e.id})}.bind(this));return a({className:"ic-tokens flex",onClick:this.handleClick},e,u({className:"inline-flex",ref:"combo-li"},s({id:this.props.id,"aria-label":this.props["combobox-aria-label"],onInput:this.handleInput,onSelect:this.handleSelect,onRemoveLast:this.handleRemoveLast,value:this.state.selectedToken},this.props.menuContent)))}})},function(e,t,n){var i=n(3),s=n(6),o=i.createFactory("div");e.exports=i.createClass({displayName:"exports",propTypes:{value:i.PropTypes.any.isRequired,label:i.PropTypes.string},getDefaultProps:function(){return{role:"option",tabIndex:"-1",className:"ic-tokeninput-option",isSelected:!1}},render:function(){var e=this.props;return e.isSelected&&(e.className=s(e.className,"ic-tokeninput-selected"),e.ariaSelected=!0),o(e)}})},function(t){t.exports=e},function(e,t,n){function i(e){return e.props.label||e.props.children}var s=n(3),o=0,a=function(){},u=n(6),c=s.createFactory(n(2)),l=s.createFactory("div"),r=s.createFactory("span"),p=s.createFactory("input");e.exports=s.createClass({displayName:"exports",propTypes:{onInput:s.PropTypes.func,onSelect:s.PropTypes.func},getDefaultProps:function(){return{autocomplete:"both",onInput:a,onSelect:a,value:null}},getInitialState:function(){return{value:this.props.value,inputValue:this.findInitialInputValue(),isOpen:!1,focusedIndex:null,matchedAutocompleteOption:null,usingKeyboard:!1,activedescendant:null,listId:"ic-tokeninput-list-"+ ++o,menu:{children:[],activedescendant:null,isEmpty:!0}}},componentWillMount:function(){this.setState({menu:this.makeMenu()})},componentWillReceiveProps:function(e){this.setState({menu:this.makeMenu(e.children)})},makeMenu:function(e){var t,n=!0;return e=e||this.props.children,s.Children.forEach(e,function(e,i){if(e.type===c.type){n=!1;var s=e.props;this.state.value===s.value&&(s.id=s.id||"ic-tokeninput-selected-"+ ++o,s.isSelected=!0,t=s.id),s.onBlur=this.handleOptionBlur,s.onClick=this.selectOption.bind(this,e),s.onFocus=this.handleOptionFocus,s.onKeyDown=this.handleOptionKeyDown.bind(this,e),s.onMouseEnter=this.handleOptionMouseEnter.bind(this,i)}}.bind(this)),n&&this.hideList(),{children:e,activedescendant:t,isEmpty:n}},getClassName:function(){var e=u(this.props.className,"ic-tokeninput");return this.state.isOpen&&(e=u(e,"ic-tokeninput-is-open")),e},clearSelectedState:function(e){this.setState({focusedIndex:null,inputValue:null,value:null,matchedAutocompleteOption:null,activedescendant:null},e)},handleInputChange:function(){var e=this.refs.input.getDOMNode().value;this.clearSelectedState(function(){this.props.onInput(e),this.state.isOpen||this.showList()}.bind(this))},handleInputBlur:function(){var e=null!=this.state.focusedIndex;e||(this.maybeSelectAutocompletedOption(),this.hideList())},handleOptionBlur:function(){this.blurTimer=setTimeout(this.hideList,0)},handleOptionFocus:function(){clearTimeout(this.blurTimer)},handleInputKeyUp:function(e){this.state.menu.isEmpty||8===e.keyCode||!this.props.autocomplete.match(/both|inline/)},handleButtonClick:function(){this.state.isOpen?this.hideList():this.showList(),this.focusInput()},showList:function(){this.setState({isOpen:!0})},hideList:function(){this.setState({isOpen:!1})},hideOnEscape:function(e){this.hideList(),this.focusInput(),e.preventDefault()},focusInput:function(){this.refs.input.getDOMNode().focus()},selectInput:function(){this.refs.input.getDOMNode().select()},inputKeydownMap:{8:"removeLastToken",13:"selectOnEnter",27:"hideOnEscape",38:"focusPrevious",40:"focusNext"},optionKeydownMap:{13:"selectOption",27:"hideOnEscape",38:"focusPrevious",40:"focusNext"},handleKeydown:function(e){var t=this.inputKeydownMap[e.keyCode];if(t)return this.setState({usingKeyboard:!0}),this[t].call(this,e)},handleOptionKeyDown:function(e,t){var n=this.optionKeydownMap[t.keyCode];return n?(t.preventDefault(),this.setState({usingKeyboard:!0}),void this[n].call(this,e)):void this.selectInput()},handleOptionMouseEnter:function(e){this.state.usingKeyboard?this.setState({usingKeyboard:!1}):this.focusOptionAtIndex(e)},selectOnEnter:function(e){e.preventDefault(),this.maybeSelectAutocompletedOption()},maybeSelectAutocompletedOption:function(){this.state.matchedAutocompleteOption?this.selectOption(this.state.matchedAutocompleteOption,{focus:!1}):this.selectText()},selectOption:function(e,t){t=t||{},this.setState({matchedAutocompleteOption:null},function(){this.props.onSelect(e.props.value,e),this.hideList(),this.clearSelectedState(),t.focus!==!1&&this.selectInput()}.bind(this)),this.refs.input.getDOMNode().value=""},selectText:function(){var e=this.refs.input.getDOMNode().value;e&&(this.props.onSelect(e),this.clearSelectedState(),this.refs.input.getDOMNode().value="")},focusNext:function(e){if(e.preventDefault&&e.preventDefault(),!this.state.menu.isEmpty){var t=null==this.state.focusedIndex?0:this.state.focusedIndex+1;this.focusOptionAtIndex(t)}},removeLastToken:function(){return this.props.onRemoveLast&&!this.refs.input.getDOMNode().value&&this.props.onRemoveLast(),!0},focusPrevious:function(e){if(e.preventDefault&&e.preventDefault(),!this.state.menu.isEmpty){var t=this.props.children.length-1,n=null==this.state.focusedIndex?t:this.state.focusedIndex-1;this.focusOptionAtIndex(n)}},focusSelectedOption:function(){var e;s.Children.forEach(this.props.children,function(t,n){t.props.value===this.state.value&&(e=n)}.bind(this)),this.showList(),this.setState({focusedIndex:e},this.focusOption)},findInitialInputValue:function(){var e;return s.Children.forEach(this.props.children,function(t){t.props.value===this.props.value&&(e=i(t))}.bind(this)),e},focusOptionAtIndex:function(e){if(!this.state.isOpen&&this.state.value)return this.focusSelectedOption();this.showList();var t=this.props.children.length;-1===e?e=t-1:e===t&&(e=0),this.setState({focusedIndex:e},this.focusOption)},focusOption:function(){var e=this.state.focusedIndex;this.refs.list.getDOMNode().childNodes[e].focus()},render:function(){var e=this.props["aria-label"]||"Start typing to search. Press the down arrow to navigate results. If you don't find an acceptable option, you can enter an alternative.";return l({className:this.getClassName()},this.props.value,this.state.inputValue,p({ref:"input",autoComplete:"off",spellCheck:"false","aria-label":e,"aria-expanded":this.state.isOpen+"","aria-haspopup":"true","aria-activedescendant":this.state.menu.activedescendant,"aria-autocomplete":"list","aria-owns":this.state.listId,id:this.props.id,className:"ic-tokeninput-input",onChange:this.handleInputChange,onBlur:this.handleInputBlur,onKeyDown:this.handleKeydown,onKeyUp:this.handleInputKeyUp,role:"combobox"}),r({"aria-hidden":"true",className:"ic-tokeninput-button",onClick:this.handleButtonClick},"▾"),l({id:this.state.listId,ref:"list",className:"ic-tokeninput-list",role:"listbox"},this.state.menu.children))}})},function(e,t,n){var i=n(3),s=i.DOM.span,o=i.createFactory("li");e.exports=i.createClass({displayName:"exports",handleClick:function(){this.props.onRemove(this.props.value)},handleKeyDown:function(e){var t=13;e.keyCode===t&&this.props.onRemove(this.props.value)},render:function(){return o({className:"ic-token inline-flex"},s({role:"button",onClick:this.handleClick,onKeyDown:this.handleKeyDown,"aria-label":"Remove '"+this.props.name+"'",className:"ic-token-delete-button",tabIndex:0},"✕"),s({className:"ic-token-label"},this.props.name))}})},function(e){function t(e,t){return e?e.indexOf(t)>-1?e:e+" "+t:t}e.exports=t}])}); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.TokenInput=t(require("react")):e.TokenInput=t(e.React)}(this,function(e){return function(e){function t(i){if(n[i])return n[i].exports;var s=n[i]={exports:{},id:i,loaded:!1};return e[i].call(s.exports,s,s.exports,t),s.loaded=!0,s.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var i=n(1);i.Option=n(2),e.exports=i},function(e,t,n){var i=n(3),s=i.createFactory(n(4)),o=i.createFactory(n(5)),a=i.createFactory("ul"),u=i.createFactory("li");e.exports=i.createClass({displayName:"exports",propTypes:{onInput:i.PropTypes.func,onSelect:i.PropTypes.func.isRequired,onRemove:i.PropTypes.func.isRequired,selected:i.PropTypes.array.isRequired,menuContent:i.PropTypes.any},getInitialState:function(){return{selectedToken:null}},handleClick:function(){this.refs["combo-li"].getDOMNode().querySelector("input").focus()},handleInput:function(e){this.props.onInput(e)},handleSelect:function(e){this.props.onSelect(e),this.setState({selectedToken:null})},handleRemove:function(e){this.props.onRemove(e),this.refs["combo-li"].getDOMNode().querySelector("input").focus()},handleRemoveLast:function(){this.props.onRemove(this.props.selected[this.props.selected.length-1])},render:function(){var e=this.props.selected.map(function(e){return o({onRemove:this.handleRemove,value:e,name:e.name,key:e.id})}.bind(this));return a({className:"ic-tokens flex",onClick:this.handleClick},e,u({className:"inline-flex",ref:"combo-li"},s({id:this.props.id,ariaLabel:this.props["combobox-aria-label"],onInput:this.handleInput,onSelect:this.handleSelect,onRemoveLast:this.handleRemoveLast,value:this.state.selectedToken},this.props.menuContent)))}})},function(e,t,n){var i=n(3),s=n(6),o=i.createFactory("div");e.exports=i.createClass({displayName:"exports",propTypes:{value:i.PropTypes.any.isRequired,label:i.PropTypes.string},getDefaultProps:function(){return{role:"option",tabIndex:"-1",className:"ic-tokeninput-option",isSelected:!1}},render:function(){var e=this.props;return e.isSelected&&(e.className=s(e.className,"ic-tokeninput-selected"),e.ariaSelected=!0),o(e)}})},function(t){t.exports=e},function(e,t,n){function i(e){return e.props.label||e.props.children}var s=n(3),o=0,a=function(){},u=n(6),c=s.createFactory(n(2)),l=s.createFactory("div"),r=s.createFactory("span"),p=s.createFactory("input");e.exports=s.createClass({displayName:"exports",propTypes:{onInput:s.PropTypes.func,onSelect:s.PropTypes.func},getDefaultProps:function(){return{autocomplete:"both",onInput:a,onSelect:a,value:null}},getInitialState:function(){return{value:this.props.value,inputValue:this.findInitialInputValue(),isOpen:!1,focusedIndex:null,matchedAutocompleteOption:null,usingKeyboard:!1,activedescendant:null,listId:"ic-tokeninput-list-"+ ++o,menu:{children:[],activedescendant:null,isEmpty:!0}}},componentWillMount:function(){this.setState({menu:this.makeMenu()})},componentWillReceiveProps:function(e){this.setState({menu:this.makeMenu(e.children)},function(){e.children.length&&(this.isOpen||document.activeElement===this.refs.input.getDOMNode())?this.showList():this.hideList()}.bind(this))},makeMenu:function(e){var t,n=!0;return e=e||this.props.children,s.Children.forEach(e,function(e,i){if(e.type===c.type){n=!1;var s=e.props;this.state.value===s.value&&(s.id=s.id||"ic-tokeninput-selected-"+ ++o,s.isSelected=!0,t=s.id),s.onBlur=this.handleOptionBlur,s.onClick=this.selectOption.bind(this,e),s.onFocus=this.handleOptionFocus,s.onKeyDown=this.handleOptionKeyDown.bind(this,e),s.onMouseEnter=this.handleOptionMouseEnter.bind(this,i)}}.bind(this)),{children:e,activedescendant:t,isEmpty:n}},getClassName:function(){var e=u(this.props.className,"ic-tokeninput");return this.state.isOpen&&(e=u(e,"ic-tokeninput-is-open")),e},clearSelectedState:function(e){this.setState({focusedIndex:null,inputValue:null,value:null,matchedAutocompleteOption:null,activedescendant:null},e)},handleInputChange:function(){var e=this.refs.input.getDOMNode().value;this.clearSelectedState(function(){this.props.onInput(e)}.bind(this))},handleInputBlur:function(){var e=null!=this.state.focusedIndex;e||(this.maybeSelectAutocompletedOption(),this.hideList())},handleOptionBlur:function(){this.blurTimer=setTimeout(this.hideList,0)},handleOptionFocus:function(){clearTimeout(this.blurTimer)},handleInputKeyUp:function(e){this.state.menu.isEmpty||8===e.keyCode||!this.props.autocomplete.match(/both|inline/)},handleButtonClick:function(){this.state.isOpen?this.hideList():this.showList(),this.focusInput()},showList:function(){this.state.menu.children.length&&this.setState({isOpen:!0})},hideList:function(){this.setState({isOpen:!1})},hideOnEscape:function(e){this.hideList(),this.focusInput(),e.preventDefault()},focusInput:function(){this.refs.input.getDOMNode().focus()},selectInput:function(){this.refs.input.getDOMNode().select()},inputKeydownMap:{8:"removeLastToken",13:"selectOnEnter",27:"hideOnEscape",38:"focusPrevious",40:"focusNext"},optionKeydownMap:{13:"selectOption",27:"hideOnEscape",38:"focusPrevious",40:"focusNext"},handleKeydown:function(e){var t=this.inputKeydownMap[e.keyCode];if(t)return this.setState({usingKeyboard:!0}),this[t].call(this,e)},handleOptionKeyDown:function(e,t){var n=this.optionKeydownMap[t.keyCode];return n?(t.preventDefault(),this.setState({usingKeyboard:!0}),void this[n].call(this,e)):void this.selectInput()},handleOptionMouseEnter:function(e){this.state.usingKeyboard?this.setState({usingKeyboard:!1}):this.focusOptionAtIndex(e)},selectOnEnter:function(e){e.preventDefault(),this.maybeSelectAutocompletedOption()},maybeSelectAutocompletedOption:function(){this.state.matchedAutocompleteOption?this.selectOption(this.state.matchedAutocompleteOption,{focus:!1}):this.selectText()},selectOption:function(e,t){t=t||{},this.setState({matchedAutocompleteOption:null},function(){this.props.onSelect(e.props.value,e),this.hideList(),this.clearSelectedState(),t.focus!==!1&&this.selectInput()}.bind(this)),this.refs.input.getDOMNode().value=""},selectText:function(){var e=this.refs.input.getDOMNode().value;e&&(this.props.onSelect(e),this.clearSelectedState(),this.refs.input.getDOMNode().value="")},focusNext:function(e){if(e.preventDefault&&e.preventDefault(),!this.state.menu.isEmpty){var t=null==this.state.focusedIndex?0:this.state.focusedIndex+1;this.focusOptionAtIndex(t)}},removeLastToken:function(){return this.props.onRemoveLast&&!this.refs.input.getDOMNode().value&&this.props.onRemoveLast(),!0},focusPrevious:function(e){if(e.preventDefault&&e.preventDefault(),!this.state.menu.isEmpty){var t=this.props.children.length-1,n=null==this.state.focusedIndex?t:this.state.focusedIndex-1;this.focusOptionAtIndex(n)}},focusSelectedOption:function(){var e;s.Children.forEach(this.props.children,function(t,n){t.props.value===this.state.value&&(e=n)}.bind(this)),this.showList(),this.setState({focusedIndex:e},this.focusOption)},findInitialInputValue:function(){var e;return s.Children.forEach(this.props.children,function(t){t.props.value===this.props.value&&(e=i(t))}.bind(this)),e},focusOptionAtIndex:function(e){if(!this.state.isOpen&&this.state.value)return this.focusSelectedOption();this.showList();var t=this.props.children.length;-1===e?e=t-1:e===t&&(e=0),this.setState({focusedIndex:e},this.focusOption)},focusOption:function(){var e=this.state.focusedIndex;this.refs.list.getDOMNode().childNodes[e].focus()},render:function(){var e=this.props["aria-label"]||"Start typing to search. Press the down arrow to navigate results. If you don't find an acceptable option, you can enter an alternative.";return l({className:this.getClassName()},this.props.value,this.state.inputValue,p({ref:"input",autoComplete:"off",spellCheck:"false","aria-label":e,"aria-expanded":this.state.isOpen+"","aria-haspopup":"true","aria-activedescendant":this.state.menu.activedescendant,"aria-autocomplete":"list","aria-owns":this.state.listId,id:this.props.id,className:"ic-tokeninput-input",onChange:this.handleInputChange,onBlur:this.handleInputBlur,onKeyDown:this.handleKeydown,onKeyUp:this.handleInputKeyUp,role:"combobox"}),r({"aria-hidden":"true",className:"ic-tokeninput-button",onClick:this.handleButtonClick},"▾"),l({id:this.state.listId,ref:"list",className:"ic-tokeninput-list",role:"listbox"},this.state.menu.children))}})},function(e,t,n){var i=n(3),s=i.DOM.span,o=i.createFactory("li");e.exports=i.createClass({displayName:"exports",handleClick:function(){this.props.onRemove(this.props.value)},handleKeyDown:function(e){var t=13;e.keyCode===t&&this.props.onRemove(this.props.value)},render:function(){return o({className:"ic-token inline-flex"},s({role:"button",onClick:this.handleClick,onKeyDown:this.handleKeyDown,"aria-label":"Remove '"+this.props.name+"'",className:"ic-token-delete-button",tabIndex:0},"✕"),s({className:"ic-token-label"},this.props.name))}})},function(e){function t(e,t){return e?e.indexOf(t)>-1?e:e+" "+t:t}e.exports=t}])}); //# sourceMappingURL=react-tokeninput.min.js.map \ No newline at end of file diff --git a/dist/react-tokeninput.min.js.map b/dist/react-tokeninput.min.js.map index 764b158..ece851d 100644 --- a/dist/react-tokeninput.min.js.map +++ b/dist/react-tokeninput.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///react-tokeninput.min.js","webpack:///webpack/bootstrap 97c5893b87d8e540f8e7","webpack:///./index.js","webpack:///./lib/main.js","webpack:///./lib/option.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///./lib/combobox.js","webpack:///./lib/token.js","webpack:///./lib/add-class.js"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_3__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","TokenInput","Option","React","Combobox","createFactory","Token","ul","li","createClass","displayName","propTypes","onInput","PropTypes","func","onSelect","isRequired","onRemove","selected","array","menuContent","any","getInitialState","selectedToken","handleClick","refs","getDOMNode","querySelector","focus","handleInput","event","props","handleSelect","setState","handleRemove","value","handleRemoveLast","length","render","tokens","map","token","name","key","bind","className","onClick","ref","aria-label","onRemoveLast","state","addClass","div","label","string","getDefaultProps","role","tabIndex","isSelected","ariaSelected","getLabel","component","children","guid","k","ComboboxOption","span","input","autocomplete","inputValue","findInitialInputValue","isOpen","focusedIndex","matchedAutocompleteOption","usingKeyboard","activedescendant","listId","menu","isEmpty","componentWillMount","makeMenu","componentWillReceiveProps","newProps","Children","forEach","child","index","type","onBlur","handleOptionBlur","selectOption","onFocus","handleOptionFocus","onKeyDown","handleOptionKeyDown","onMouseEnter","handleOptionMouseEnter","hideList","getClassName","clearSelectedState","cb","handleInputChange","showList","handleInputBlur","focusedAnOption","maybeSelectAutocompletedOption","blurTimer","setTimeout","clearTimeout","handleInputKeyUp","keyCode","match","handleButtonClick","focusInput","hideOnEscape","preventDefault","selectInput","select","inputKeydownMap",8,13,27,38,40,"optionKeydownMap","handleKeydown","handlerName","focusOptionAtIndex","selectOnEnter","selectText","options","focusNext","removeLastToken","focusPrevious","last","focusSelectedOption","selectedIndex","focusOption","list","childNodes","ariaLabel","autoComplete","spellCheck","aria-expanded","aria-haspopup","aria-activedescendant","aria-autocomplete","aria-owns","onChange","onKeyUp","aria-hidden","DOM","handleKeyDown","enterKey","existing","added","indexOf"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,UACA,kBAAAC,gBAAAC,IACAD,QAAA,SAAAJ,GACA,gBAAAC,SACAA,QAAA,WAAAD,EAAAG,QAAA,UAEAJ,EAAA,WAAAC,EAAAD,EAAA,QACCO,KAAA,SAAAC,GACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAT,OAGA,IAAAC,GAAAS,EAAAD,IACAT,WACAW,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAZ,EAAAD,QAAAC,IAAAD,QAAAQ,GAGAP,EAAAW,QAAA,EAGAX,EAAAD,QAvBA,GAAAU,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,GAGAR,EAAA,KDgBM,SAASP,EAAQD,EA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AAS,GAAWD,EAClCA,EAAW,IAAMC,EAFFA,EAHxB1K,EAAOD,QAAUmE","file":"react-tokeninput.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TokenInput\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"TokenInput\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TokenInput\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"TokenInput\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar TokenInput = __webpack_require__(1)\n\tTokenInput.Option = __webpack_require__(2)\n\t\n\tmodule.exports = TokenInput\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar Combobox = React.createFactory(__webpack_require__(4));\n\tvar Token = React.createFactory(__webpack_require__(5));\n\t\n\tvar ul = React.createFactory('ul');\n\tvar li = React.createFactory('li');\n\t\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\t propTypes: {\n\t onInput: React.PropTypes.func,\n\t onSelect: React.PropTypes.func.isRequired,\n\t onRemove: React.PropTypes.func.isRequired,\n\t selected: React.PropTypes.array.isRequired,\n\t menuContent: React.PropTypes.any\n\t },\n\t\n\t getInitialState: function() {\n\t return {\n\t selectedToken: null\n\t };\n\t },\n\t\n\t handleClick: function() {\n\t // TODO: Expand combobox API for focus\n\t this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n\t },\n\t\n\t handleInput: function(event) {\n\t this.props.onInput(event);\n\t },\n\t\n\t handleSelect: function(event) {\n\t this.props.onSelect(event)\n\t this.setState({\n\t selectedToken: null\n\t })\n\t },\n\t\n\t handleRemove: function(value) {\n\t this.props.onRemove(value);\n\t this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n\t },\n\t\n\t handleRemoveLast: function() {\n\t this.props.onRemove(this.props.selected[this.props.selected.length - 1]);\n\t },\n\t\n\t render: function() {\n\t var tokens = this.props.selected.map(function(token) {\n\t return (\n\t Token({\n\t onRemove: this.handleRemove,\n\t value: token,\n\t name: token.name,\n\t key: token.id})\n\t )\n\t }.bind(this))\n\t\n\t return ul({className: 'ic-tokens flex', onClick: this.handleClick},\n\t tokens,\n\t li({className: 'inline-flex', ref: 'combo-li'},\n\t Combobox({\n\t id: this.props.id,\n\t 'aria-label': this.props['combobox-aria-label'],\n\t onInput: this.handleInput,\n\t onSelect: this.handleSelect,\n\t onRemoveLast: this.handleRemoveLast,\n\t value: this.state.selectedToken\n\t },\n\t this.props.menuContent\n\t )\n\t )\n\t );\n\t }\n\t})\n\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar addClass = __webpack_require__(6);\n\tvar div = React.createFactory('div');\n\t\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\t\n\t propTypes: {\n\t\n\t /**\n\t * The value that will be sent to the `onSelect` handler of the\n\t * parent Combobox.\n\t */\n\t value: React.PropTypes.any.isRequired,\n\t\n\t /**\n\t * What value to put into the input element when this option is\n\t * selected, defaults to its children coerced to a string.\n\t */\n\t label: React.PropTypes.string\n\t },\n\t\n\t getDefaultProps: function() {\n\t return {\n\t role: 'option',\n\t tabIndex: '-1',\n\t className: 'ic-tokeninput-option',\n\t isSelected: false\n\t };\n\t },\n\t\n\t render: function() {\n\t var props = this.props;\n\t if (props.isSelected) {\n\t props.className = addClass(props.className, 'ic-tokeninput-selected');\n\t props.ariaSelected = true;\n\t }\n\t return div(props);\n\t }\n\t\n\t});\n\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar guid = 0;\n\tvar k = function(){};\n\tvar addClass = __webpack_require__(6);\n\tvar ComboboxOption = React.createFactory(__webpack_require__(2));\n\t\n\tvar div = React.createFactory('div');\n\tvar span = React.createFactory('span');\n\tvar input = React.createFactory('input');\n\t\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\t\n\t propTypes: {\n\t /**\n\t * Called when the combobox receives user input, this is your chance to\n\t * filter the data and rerender the options.\n\t *\n\t * Signature:\n\t *\n\t * ```js\n\t * function(userInput){}\n\t * ```\n\t */\n\t onInput: React.PropTypes.func,\n\t\n\t /**\n\t * Called when the combobox receives a selection. You probably want to reset\n\t * the options to the full list at this point.\n\t *\n\t * Signature:\n\t *\n\t * ```js\n\t * function(selectedValue){}\n\t * ```\n\t */\n\t onSelect: React.PropTypes.func\n\t },\n\t\n\t getDefaultProps: function() {\n\t return {\n\t autocomplete: 'both',\n\t onInput: k,\n\t onSelect: k,\n\t value: null\n\t };\n\t },\n\t\n\t getInitialState: function() {\n\t return {\n\t value: this.props.value,\n\t // the value displayed in the input\n\t inputValue: this.findInitialInputValue(),\n\t isOpen: false,\n\t focusedIndex: null,\n\t matchedAutocompleteOption: null,\n\t // this prevents crazy jumpiness since we focus options on mouseenter\n\t usingKeyboard: false,\n\t activedescendant: null,\n\t listId: 'ic-tokeninput-list-'+(++guid),\n\t menu: {\n\t children: [],\n\t activedescendant: null,\n\t isEmpty: true\n\t }\n\t };\n\t },\n\t\n\t componentWillMount: function() {\n\t this.setState({menu: this.makeMenu()});\n\t },\n\t\n\t componentWillReceiveProps: function(newProps) {\n\t this.setState({menu: this.makeMenu(newProps.children)});\n\t },\n\t\n\t /**\n\t * We don't create the components, the user supplies them,\n\t * so before rendering we attach handlers to facilitate communication from\n\t * the ComboboxOption to the Combobox.\n\t */\n\t makeMenu: function(children) {\n\t var activedescendant;\n\t var isEmpty = true;\n\t children = children || this.props.children;\n\t React.Children.forEach(children, function(child, index) {\n\t if (child.type !== ComboboxOption.type)\n\t // allow random elements to live in this list\n\t return;\n\t isEmpty = false;\n\t // TODO: cloneWithProps and map instead of altering the children in-place\n\t var props = child.props;\n\t if (this.state.value === props.value) {\n\t // need an ID for WAI-ARIA\n\t props.id = props.id || 'ic-tokeninput-selected-'+(++guid);\n\t props.isSelected = true\n\t activedescendant = props.id;\n\t }\n\t props.onBlur = this.handleOptionBlur;\n\t props.onClick = this.selectOption.bind(this, child);\n\t props.onFocus = this.handleOptionFocus;\n\t props.onKeyDown = this.handleOptionKeyDown.bind(this, child);\n\t props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index);\n\t }.bind(this));\n\t\n\t if(isEmpty) {\n\t this.hideList();\n\t }\n\t\n\t return {\n\t children: children,\n\t activedescendant: activedescendant,\n\t isEmpty: isEmpty\n\t };\n\t },\n\t\n\t getClassName: function() {\n\t var className = addClass(this.props.className, 'ic-tokeninput');\n\t if (this.state.isOpen)\n\t className = addClass(className, 'ic-tokeninput-is-open');\n\t return className;\n\t },\n\t\n\t /**\n\t * When the user begins typing again we need to clear out any state that has\n\t * to do with an existing or potential selection.\n\t */\n\t clearSelectedState: function(cb) {\n\t this.setState({\n\t focusedIndex: null,\n\t inputValue: null,\n\t value: null,\n\t matchedAutocompleteOption: null,\n\t activedescendant: null\n\t }, cb);\n\t },\n\t\n\t handleInputChange: function(event) {\n\t var value = this.refs.input.getDOMNode().value;\n\t this.clearSelectedState(function() {\n\t this.props.onInput(value);\n\t if (!this.state.isOpen)\n\t this.showList();\n\t }.bind(this));\n\t },\n\t\n\t handleInputBlur: function() {\n\t var focusedAnOption = this.state.focusedIndex != null;\n\t if (focusedAnOption)\n\t return;\n\t this.maybeSelectAutocompletedOption();\n\t this.hideList();\n\t },\n\t\n\t handleOptionBlur: function() {\n\t // don't want to hide the list if we focused another option\n\t this.blurTimer = setTimeout(this.hideList, 0);\n\t },\n\t\n\t handleOptionFocus: function() {\n\t // see `handleOptionBlur`\n\t clearTimeout(this.blurTimer);\n\t },\n\t\n\t handleInputKeyUp: function(event) {\n\t if (\n\t this.state.menu.isEmpty ||\n\t // autocompleting while backspacing feels super weird, so let's not\n\t event.keyCode === 8 /*backspace*/ ||\n\t !this.props.autocomplete.match(/both|inline/)\n\t ) return;\n\t },\n\t\n\t handleButtonClick: function() {\n\t this.state.isOpen ? this.hideList() : this.showList();\n\t this.focusInput();\n\t },\n\t\n\t showList: function() {\n\t this.setState({isOpen: true})\n\t },\n\t\n\t hideList: function() {\n\t this.setState({isOpen: false});\n\t },\n\t\n\t hideOnEscape: function(event) {\n\t this.hideList();\n\t this.focusInput();\n\t event.preventDefault();\n\t },\n\t\n\t focusInput: function() {\n\t this.refs.input.getDOMNode().focus();\n\t },\n\t\n\t selectInput: function() {\n\t this.refs.input.getDOMNode().select();\n\t },\n\t\n\t inputKeydownMap: {\n\t 8: 'removeLastToken',\n\t 13: 'selectOnEnter',\n\t 27: 'hideOnEscape',\n\t 38: 'focusPrevious',\n\t 40: 'focusNext'\n\t },\n\t\n\t optionKeydownMap: {\n\t 13: 'selectOption',\n\t 27: 'hideOnEscape',\n\t 38: 'focusPrevious',\n\t 40: 'focusNext'\n\t },\n\t\n\t handleKeydown: function(event) {\n\t var handlerName = this.inputKeydownMap[event.keyCode];\n\t if (!handlerName)\n\t return\n\t this.setState({usingKeyboard: true});\n\t return this[handlerName].call(this,event);\n\t },\n\t\n\t handleOptionKeyDown: function(child, event) {\n\t var handlerName = this.optionKeydownMap[event.keyCode];\n\t if (!handlerName) {\n\t // if the user starts typing again while focused on an option, move focus\n\t // to the inpute, select so it wipes out any existing value\n\t this.selectInput();\n\t return;\n\t }\n\t event.preventDefault();\n\t this.setState({usingKeyboard: true});\n\t this[handlerName].call(this, child);\n\t },\n\t\n\t handleOptionMouseEnter: function(index) {\n\t if (this.state.usingKeyboard)\n\t this.setState({usingKeyboard: false});\n\t else\n\t this.focusOptionAtIndex(index);\n\t },\n\t\n\t selectOnEnter: function(event) {\n\t event.preventDefault();\n\t this.maybeSelectAutocompletedOption()\n\t },\n\t\n\t maybeSelectAutocompletedOption: function() {\n\t if (!this.state.matchedAutocompleteOption) {\n\t this.selectText()\n\t } else {\n\t this.selectOption(this.state.matchedAutocompleteOption, {focus: false});\n\t }\n\t },\n\t\n\t selectOption: function(child, options) {\n\t options = options || {};\n\t this.setState({\n\t // value: child.props.value,\n\t // inputValue: getLabel(child),\n\t matchedAutocompleteOption: null\n\t }, function() {\n\t this.props.onSelect(child.props.value, child);\n\t this.hideList();\n\t this.clearSelectedState(); // added\n\t if (options.focus !== false)\n\t this.selectInput();\n\t }.bind(this));\n\t this.refs.input.getDOMNode().value = '' // added\n\t },\n\t\n\t selectText: function() {\n\t var value = this.refs.input.getDOMNode().value;\n\t if(!value) return;\n\t this.props.onSelect(value);\n\t this.clearSelectedState();\n\t this.refs.input.getDOMNode().value = '' // added\n\t },\n\t\n\t focusNext: function(event) {\n\t if(event.preventDefault) event.preventDefault();\n\t if (this.state.menu.isEmpty) return;\n\t var index = this.state.focusedIndex == null ?\n\t 0 : this.state.focusedIndex + 1;\n\t this.focusOptionAtIndex(index);\n\t },\n\t\n\t removeLastToken: function() {\n\t if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) {\n\t this.props.onRemoveLast()\n\t }\n\t return true\n\t },\n\t\n\t focusPrevious: function(event) {\n\t if(event.preventDefault) event.preventDefault();\n\t if (this.state.menu.isEmpty) return;\n\t var last = this.props.children.length - 1;\n\t var index = this.state.focusedIndex == null ?\n\t last : this.state.focusedIndex - 1;\n\t this.focusOptionAtIndex(index);\n\t },\n\t\n\t focusSelectedOption: function() {\n\t var selectedIndex;\n\t React.Children.forEach(this.props.children, function(child, index) {\n\t if (child.props.value === this.state.value)\n\t selectedIndex = index;\n\t }.bind(this));\n\t this.showList();\n\t this.setState({\n\t focusedIndex: selectedIndex\n\t }, this.focusOption);\n\t },\n\t\n\t findInitialInputValue: function() {\n\t // TODO: might not need this, we should know this in `makeMenu`\n\t var inputValue;\n\t React.Children.forEach(this.props.children, function(child) {\n\t if (child.props.value === this.props.value)\n\t inputValue = getLabel(child);\n\t }.bind(this));\n\t return inputValue;\n\t },\n\t\n\t focusOptionAtIndex: function(index) {\n\t if (!this.state.isOpen && this.state.value)\n\t return this.focusSelectedOption();\n\t this.showList();\n\t var length = this.props.children.length;\n\t if (index === -1)\n\t index = length - 1;\n\t else if (index === length)\n\t index = 0;\n\t this.setState({\n\t focusedIndex: index\n\t }, this.focusOption);\n\t },\n\t\n\t focusOption: function() {\n\t var index = this.state.focusedIndex;\n\t this.refs.list.getDOMNode().childNodes[index].focus();\n\t },\n\t\n\t render: function() {\n\t var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' +\n\t 'Press the down arrow to navigate results. If you don\\'t find an ' +\n\t 'acceptable option, you can enter an alternative.'\n\t\n\t return div({className: this.getClassName()},\n\t this.props.value,\n\t this.state.inputValue,\n\t input({\n\t ref: 'input',\n\t autoComplete: 'off',\n\t spellCheck: 'false',\n\t 'aria-label': ariaLabel,\n\t 'aria-expanded': this.state.isOpen+'',\n\t 'aria-haspopup': 'true',\n\t 'aria-activedescendant': this.state.menu.activedescendant,\n\t 'aria-autocomplete': 'list',\n\t 'aria-owns': this.state.listId,\n\t id: this.props.id,\n\t className: 'ic-tokeninput-input',\n\t onChange: this.handleInputChange,\n\t onBlur: this.handleInputBlur,\n\t onKeyDown: this.handleKeydown,\n\t onKeyUp: this.handleInputKeyUp,\n\t role: 'combobox'\n\t }),\n\t span({\n\t 'aria-hidden': 'true',\n\t className: 'ic-tokeninput-button',\n\t onClick: this.handleButtonClick\n\t }, '▾'),\n\t div({\n\t id: this.state.listId,\n\t ref: 'list',\n\t className: 'ic-tokeninput-list',\n\t role: 'listbox'\n\t }, this.state.menu.children)\n\t );\n\t }\n\t});\n\t\n\tfunction getLabel(component) {\n\t return component.props.label || component.props.children;\n\t}\n\t\n\tfunction matchFragment(userInput, firstChildLabel) {\n\t userInput = userInput.toLowerCase();\n\t firstChildLabel = firstChildLabel.toLowerCase();\n\t if (userInput === '' || userInput === firstChildLabel)\n\t return false;\n\t if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1)\n\t return false;\n\t return true;\n\t}\n\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar span = React.DOM.span;\n\tvar li = React.createFactory('li');\n\t\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\t handleClick: function() {\n\t this.props.onRemove(this.props.value)\n\t },\n\t\n\t handleKeyDown: function(key) {\n\t var enterKey = 13;\n\t if(key.keyCode === enterKey) this.props.onRemove(this.props.value)\n\t },\n\t\n\t render: function() {\n\t return (\n\t li({\n\t className: \"ic-token inline-flex\"\n\t },\n\t span({\n\t role: 'button',\n\t onClick: this.handleClick,\n\t onKeyDown: this.handleKeyDown,\n\t 'aria-label': 'Remove \\'' + this.props.name + '\\'',\n\t className: \"ic-token-delete-button\",\n\t tabIndex: 0\n\t }, \"✕\"),\n\t span({className: \"ic-token-label\"}, this.props.name)\n\t )\n\t )\n\t }\n\t})\n\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = addClass;\n\t\n\tfunction addClass(existing, added) {\n\t if (!existing) return added;\n\t if (existing.indexOf(added) > -1) return existing;\n\t return existing + ' ' + added;\n\t}\n\n\n/***/ }\n/******/ ])\n});\n\n\n\n/** WEBPACK FOOTER **\n ** react-tokeninput.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 97c5893b87d8e540f8e7\n **/","var TokenInput = require('./lib/main')\nTokenInput.Option = require('./lib/option')\n\nmodule.exports = TokenInput\n\n\n\n/** WEBPACK FOOTER **\n ** ./index.js\n **/","var React = require('react');\nvar Combobox = React.createFactory(require('./combobox'));\nvar Token = React.createFactory(require('./token'));\n\nvar ul = React.createFactory('ul');\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n propTypes: {\n onInput: React.PropTypes.func,\n onSelect: React.PropTypes.func.isRequired,\n onRemove: React.PropTypes.func.isRequired,\n selected: React.PropTypes.array.isRequired,\n menuContent: React.PropTypes.any\n },\n\n getInitialState: function() {\n return {\n selectedToken: null\n };\n },\n\n handleClick: function() {\n // TODO: Expand combobox API for focus\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleInput: function(event) {\n this.props.onInput(event);\n },\n\n handleSelect: function(event) {\n this.props.onSelect(event)\n this.setState({\n selectedToken: null\n })\n },\n\n handleRemove: function(value) {\n this.props.onRemove(value);\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleRemoveLast: function() {\n this.props.onRemove(this.props.selected[this.props.selected.length - 1]);\n },\n\n render: function() {\n var tokens = this.props.selected.map(function(token) {\n return (\n Token({\n onRemove: this.handleRemove,\n value: token,\n name: token.name,\n key: token.id})\n )\n }.bind(this))\n\n return ul({className: 'ic-tokens flex', onClick: this.handleClick},\n tokens,\n li({className: 'inline-flex', ref: 'combo-li'},\n Combobox({\n id: this.props.id,\n 'aria-label': this.props['combobox-aria-label'],\n onInput: this.handleInput,\n onSelect: this.handleSelect,\n onRemoveLast: this.handleRemoveLast,\n value: this.state.selectedToken\n },\n this.props.menuContent\n )\n )\n );\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/main.js\n **/","var React = require('react');\nvar addClass = require('./add-class');\nvar div = React.createFactory('div');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n\n /**\n * The value that will be sent to the `onSelect` handler of the\n * parent Combobox.\n */\n value: React.PropTypes.any.isRequired,\n\n /**\n * What value to put into the input element when this option is\n * selected, defaults to its children coerced to a string.\n */\n label: React.PropTypes.string\n },\n\n getDefaultProps: function() {\n return {\n role: 'option',\n tabIndex: '-1',\n className: 'ic-tokeninput-option',\n isSelected: false\n };\n },\n\n render: function() {\n var props = this.props;\n if (props.isSelected) {\n props.className = addClass(props.className, 'ic-tokeninput-selected');\n props.ariaSelected = true;\n }\n return div(props);\n }\n\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/option.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n ** module id = 3\n ** module chunks = 0\n **/","var React = require('react');\nvar guid = 0;\nvar k = function(){};\nvar addClass = require('./add-class');\nvar ComboboxOption = React.createFactory(require('./option'));\n\nvar div = React.createFactory('div');\nvar span = React.createFactory('span');\nvar input = React.createFactory('input');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n /**\n * Called when the combobox receives user input, this is your chance to\n * filter the data and rerender the options.\n *\n * Signature:\n *\n * ```js\n * function(userInput){}\n * ```\n */\n onInput: React.PropTypes.func,\n\n /**\n * Called when the combobox receives a selection. You probably want to reset\n * the options to the full list at this point.\n *\n * Signature:\n *\n * ```js\n * function(selectedValue){}\n * ```\n */\n onSelect: React.PropTypes.func\n },\n\n getDefaultProps: function() {\n return {\n autocomplete: 'both',\n onInput: k,\n onSelect: k,\n value: null\n };\n },\n\n getInitialState: function() {\n return {\n value: this.props.value,\n // the value displayed in the input\n inputValue: this.findInitialInputValue(),\n isOpen: false,\n focusedIndex: null,\n matchedAutocompleteOption: null,\n // this prevents crazy jumpiness since we focus options on mouseenter\n usingKeyboard: false,\n activedescendant: null,\n listId: 'ic-tokeninput-list-'+(++guid),\n menu: {\n children: [],\n activedescendant: null,\n isEmpty: true\n }\n };\n },\n\n componentWillMount: function() {\n this.setState({menu: this.makeMenu()});\n },\n\n componentWillReceiveProps: function(newProps) {\n this.setState({menu: this.makeMenu(newProps.children)});\n },\n\n /**\n * We don't create the components, the user supplies them,\n * so before rendering we attach handlers to facilitate communication from\n * the ComboboxOption to the Combobox.\n */\n makeMenu: function(children) {\n var activedescendant;\n var isEmpty = true;\n children = children || this.props.children;\n React.Children.forEach(children, function(child, index) {\n if (child.type !== ComboboxOption.type)\n // allow random elements to live in this list\n return;\n isEmpty = false;\n // TODO: cloneWithProps and map instead of altering the children in-place\n var props = child.props;\n if (this.state.value === props.value) {\n // need an ID for WAI-ARIA\n props.id = props.id || 'ic-tokeninput-selected-'+(++guid);\n props.isSelected = true\n activedescendant = props.id;\n }\n props.onBlur = this.handleOptionBlur;\n props.onClick = this.selectOption.bind(this, child);\n props.onFocus = this.handleOptionFocus;\n props.onKeyDown = this.handleOptionKeyDown.bind(this, child);\n props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index);\n }.bind(this));\n\n if(isEmpty) {\n this.hideList();\n }\n\n return {\n children: children,\n activedescendant: activedescendant,\n isEmpty: isEmpty\n };\n },\n\n getClassName: function() {\n var className = addClass(this.props.className, 'ic-tokeninput');\n if (this.state.isOpen)\n className = addClass(className, 'ic-tokeninput-is-open');\n return className;\n },\n\n /**\n * When the user begins typing again we need to clear out any state that has\n * to do with an existing or potential selection.\n */\n clearSelectedState: function(cb) {\n this.setState({\n focusedIndex: null,\n inputValue: null,\n value: null,\n matchedAutocompleteOption: null,\n activedescendant: null\n }, cb);\n },\n\n handleInputChange: function(event) {\n var value = this.refs.input.getDOMNode().value;\n this.clearSelectedState(function() {\n this.props.onInput(value);\n if (!this.state.isOpen)\n this.showList();\n }.bind(this));\n },\n\n handleInputBlur: function() {\n var focusedAnOption = this.state.focusedIndex != null;\n if (focusedAnOption)\n return;\n this.maybeSelectAutocompletedOption();\n this.hideList();\n },\n\n handleOptionBlur: function() {\n // don't want to hide the list if we focused another option\n this.blurTimer = setTimeout(this.hideList, 0);\n },\n\n handleOptionFocus: function() {\n // see `handleOptionBlur`\n clearTimeout(this.blurTimer);\n },\n\n handleInputKeyUp: function(event) {\n if (\n this.state.menu.isEmpty ||\n // autocompleting while backspacing feels super weird, so let's not\n event.keyCode === 8 /*backspace*/ ||\n !this.props.autocomplete.match(/both|inline/)\n ) return;\n },\n\n handleButtonClick: function() {\n this.state.isOpen ? this.hideList() : this.showList();\n this.focusInput();\n },\n\n showList: function() {\n this.setState({isOpen: true})\n },\n\n hideList: function() {\n this.setState({isOpen: false});\n },\n\n hideOnEscape: function(event) {\n this.hideList();\n this.focusInput();\n event.preventDefault();\n },\n\n focusInput: function() {\n this.refs.input.getDOMNode().focus();\n },\n\n selectInput: function() {\n this.refs.input.getDOMNode().select();\n },\n\n inputKeydownMap: {\n 8: 'removeLastToken',\n 13: 'selectOnEnter',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n optionKeydownMap: {\n 13: 'selectOption',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n handleKeydown: function(event) {\n var handlerName = this.inputKeydownMap[event.keyCode];\n if (!handlerName)\n return\n this.setState({usingKeyboard: true});\n return this[handlerName].call(this,event);\n },\n\n handleOptionKeyDown: function(child, event) {\n var handlerName = this.optionKeydownMap[event.keyCode];\n if (!handlerName) {\n // if the user starts typing again while focused on an option, move focus\n // to the inpute, select so it wipes out any existing value\n this.selectInput();\n return;\n }\n event.preventDefault();\n this.setState({usingKeyboard: true});\n this[handlerName].call(this, child);\n },\n\n handleOptionMouseEnter: function(index) {\n if (this.state.usingKeyboard)\n this.setState({usingKeyboard: false});\n else\n this.focusOptionAtIndex(index);\n },\n\n selectOnEnter: function(event) {\n event.preventDefault();\n this.maybeSelectAutocompletedOption()\n },\n\n maybeSelectAutocompletedOption: function() {\n if (!this.state.matchedAutocompleteOption) {\n this.selectText()\n } else {\n this.selectOption(this.state.matchedAutocompleteOption, {focus: false});\n }\n },\n\n selectOption: function(child, options) {\n options = options || {};\n this.setState({\n // value: child.props.value,\n // inputValue: getLabel(child),\n matchedAutocompleteOption: null\n }, function() {\n this.props.onSelect(child.props.value, child);\n this.hideList();\n this.clearSelectedState(); // added\n if (options.focus !== false)\n this.selectInput();\n }.bind(this));\n this.refs.input.getDOMNode().value = '' // added\n },\n\n selectText: function() {\n var value = this.refs.input.getDOMNode().value;\n if(!value) return;\n this.props.onSelect(value);\n this.clearSelectedState();\n this.refs.input.getDOMNode().value = '' // added\n },\n\n focusNext: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var index = this.state.focusedIndex == null ?\n 0 : this.state.focusedIndex + 1;\n this.focusOptionAtIndex(index);\n },\n\n removeLastToken: function() {\n if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) {\n this.props.onRemoveLast()\n }\n return true\n },\n\n focusPrevious: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var last = this.props.children.length - 1;\n var index = this.state.focusedIndex == null ?\n last : this.state.focusedIndex - 1;\n this.focusOptionAtIndex(index);\n },\n\n focusSelectedOption: function() {\n var selectedIndex;\n React.Children.forEach(this.props.children, function(child, index) {\n if (child.props.value === this.state.value)\n selectedIndex = index;\n }.bind(this));\n this.showList();\n this.setState({\n focusedIndex: selectedIndex\n }, this.focusOption);\n },\n\n findInitialInputValue: function() {\n // TODO: might not need this, we should know this in `makeMenu`\n var inputValue;\n React.Children.forEach(this.props.children, function(child) {\n if (child.props.value === this.props.value)\n inputValue = getLabel(child);\n }.bind(this));\n return inputValue;\n },\n\n focusOptionAtIndex: function(index) {\n if (!this.state.isOpen && this.state.value)\n return this.focusSelectedOption();\n this.showList();\n var length = this.props.children.length;\n if (index === -1)\n index = length - 1;\n else if (index === length)\n index = 0;\n this.setState({\n focusedIndex: index\n }, this.focusOption);\n },\n\n focusOption: function() {\n var index = this.state.focusedIndex;\n this.refs.list.getDOMNode().childNodes[index].focus();\n },\n\n render: function() {\n var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' +\n 'Press the down arrow to navigate results. If you don\\'t find an ' +\n 'acceptable option, you can enter an alternative.'\n\n return div({className: this.getClassName()},\n this.props.value,\n this.state.inputValue,\n input({\n ref: 'input',\n autoComplete: 'off',\n spellCheck: 'false',\n 'aria-label': ariaLabel,\n 'aria-expanded': this.state.isOpen+'',\n 'aria-haspopup': 'true',\n 'aria-activedescendant': this.state.menu.activedescendant,\n 'aria-autocomplete': 'list',\n 'aria-owns': this.state.listId,\n id: this.props.id,\n className: 'ic-tokeninput-input',\n onChange: this.handleInputChange,\n onBlur: this.handleInputBlur,\n onKeyDown: this.handleKeydown,\n onKeyUp: this.handleInputKeyUp,\n role: 'combobox'\n }),\n span({\n 'aria-hidden': 'true',\n className: 'ic-tokeninput-button',\n onClick: this.handleButtonClick\n }, '▾'),\n div({\n id: this.state.listId,\n ref: 'list',\n className: 'ic-tokeninput-list',\n role: 'listbox'\n }, this.state.menu.children)\n );\n }\n});\n\nfunction getLabel(component) {\n return component.props.label || component.props.children;\n}\n\nfunction matchFragment(userInput, firstChildLabel) {\n userInput = userInput.toLowerCase();\n firstChildLabel = firstChildLabel.toLowerCase();\n if (userInput === '' || userInput === firstChildLabel)\n return false;\n if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1)\n return false;\n return true;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/combobox.js\n **/","var React = require('react');\nvar span = React.DOM.span;\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n handleClick: function() {\n this.props.onRemove(this.props.value)\n },\n\n handleKeyDown: function(key) {\n var enterKey = 13;\n if(key.keyCode === enterKey) this.props.onRemove(this.props.value)\n },\n\n render: function() {\n return (\n li({\n className: \"ic-token inline-flex\"\n },\n span({\n role: 'button',\n onClick: this.handleClick,\n onKeyDown: this.handleKeyDown,\n 'aria-label': 'Remove \\'' + this.props.name + '\\'',\n className: \"ic-token-delete-button\",\n tabIndex: 0\n }, \"✕\"),\n span({className: \"ic-token-label\"}, this.props.name)\n )\n )\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/token.js\n **/","module.exports = addClass;\n\nfunction addClass(existing, added) {\n if (!existing) return added;\n if (existing.indexOf(added) > -1) return existing;\n return existing + ' ' + added;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/add-class.js\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///react-tokeninput.min.js","webpack:///webpack/bootstrap d565fa7672eea8600b30","webpack:///./index.js","webpack:///./lib/main.js","webpack:///./lib/option.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///./lib/combobox.js","webpack:///./lib/token.js","webpack:///./lib/add-class.js"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_3__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","TokenInput","Option","React","Combobox","createFactory","Token","ul","li","createClass","displayName","propTypes","onInput","PropTypes","func","onSelect","isRequired","onRemove","selected","array","menuContent","any","getInitialState","selectedToken","handleClick","refs","getDOMNode","querySelector","focus","handleInput","event","props","handleSelect","setState","handleRemove","value","handleRemoveLast","length","render","tokens","map","token","name","key","bind","className","onClick","ref","ariaLabel","onRemoveLast","state","addClass","div","label","string","getDefaultProps","role","tabIndex","isSelected","ariaSelected","getLabel","component","children","guid","k","ComboboxOption","span","input","autocomplete","inputValue","findInitialInputValue","isOpen","focusedIndex","matchedAutocompleteOption","usingKeyboard","activedescendant","listId","menu","isEmpty","componentWillMount","makeMenu","componentWillReceiveProps","newProps","document","activeElement","showList","hideList","Children","forEach","child","index","type","onBlur","handleOptionBlur","selectOption","onFocus","handleOptionFocus","onKeyDown","handleOptionKeyDown","onMouseEnter","handleOptionMouseEnter","getClassName","clearSelectedState","cb","handleInputChange","handleInputBlur","focusedAnOption","maybeSelectAutocompletedOption","blurTimer","setTimeout","clearTimeout","handleInputKeyUp","keyCode","match","handleButtonClick","focusInput","hideOnEscape","preventDefault","selectInput","select","inputKeydownMap",8,13,27,38,40,"optionKeydownMap","handleKeydown","handlerName","focusOptionAtIndex","selectOnEnter","selectText","options","focusNext","removeLastToken","focusPrevious","last","focusSelectedOption","selectedIndex","focusOption","list","childNodes","autoComplete","spellCheck","aria-label","aria-expanded","aria-haspopup","aria-activedescendant","aria-autocomplete","aria-owns","onChange","onKeyUp","aria-hidden","DOM","handleKeyDown","enterKey","existing","added","indexOf"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,UACA,kBAAAC,gBAAAC,IACAD,QAAA,SAAAJ,GACA,gBAAAC,SACAA,QAAA,WAAAD,EAAAG,QAAA,UAEAJ,EAAA,WAAAC,EAAAD,EAAA,QACCO,KAAA,SAAAC,GACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAT,OAGA,IAAAC,GAAAS,EAAAD,IACAT,WACAW,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAZ,EAAAD,QAAAC,IAAAD,QAAAQ,GAGAP,EAAAW,QAAA,EAGAX,EAAAD,QAvBA,GAAAU,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,GAGAR,EAAA,KDgBM,SAASP,EAAQD,EAASQ,GEtDhC,GAAIS,GAAaT,EAAQ,EACzBS,GAAWC,OAASV,EAAQ,GAE5BP,EAAOD,QAAUiB,GF6DX,SAAShB,EAAQD,EAASQ,GGhEhC,GAAIW,GAAQX,EAAQ,GAChBY,EAAWD,EAAME,cAAcb,EAAQ,IACvCc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E","file":"react-tokeninput.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TokenInput\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"TokenInput\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TokenInput\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"TokenInput\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n\n\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar TokenInput = __webpack_require__(1)\n\tTokenInput.Option = __webpack_require__(2)\n\n\tmodule.exports = TokenInput\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar Combobox = React.createFactory(__webpack_require__(4));\n\tvar Token = React.createFactory(__webpack_require__(5));\n\n\tvar ul = React.createFactory('ul');\n\tvar li = React.createFactory('li');\n\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\t propTypes: {\n\t onInput: React.PropTypes.func,\n\t onSelect: React.PropTypes.func.isRequired,\n\t onRemove: React.PropTypes.func.isRequired,\n\t selected: React.PropTypes.array.isRequired,\n\t menuContent: React.PropTypes.any\n\t },\n\n\t getInitialState: function() {\n\t return {\n\t selectedToken: null\n\t };\n\t },\n\n\t handleClick: function() {\n\t // TODO: Expand combobox API for focus\n\t this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n\t },\n\n\t handleInput: function(event) {\n\t this.props.onInput(event);\n\t },\n\n\t handleSelect: function(event) {\n\t this.props.onSelect(event)\n\t this.setState({\n\t selectedToken: null\n\t })\n\t },\n\n\t handleRemove: function(value) {\n\t this.props.onRemove(value);\n\t this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n\t },\n\n\t handleRemoveLast: function() {\n\t this.props.onRemove(this.props.selected[this.props.selected.length - 1]);\n\t },\n\n\t render: function() {\n\t var tokens = this.props.selected.map(function(token) {\n\t return (\n\t Token({\n\t onRemove: this.handleRemove,\n\t value: token,\n\t name: token.name,\n\t key: token.id})\n\t )\n\t }.bind(this))\n\n\t return ul({className: 'ic-tokens flex', onClick: this.handleClick},\n\t tokens,\n\t li({className: 'inline-flex', ref: 'combo-li'},\n\t Combobox({\n\t id: this.props.id,\n\t ariaLabel: this.props['combobox-aria-label'],\n\t onInput: this.handleInput,\n\t onSelect: this.handleSelect,\n\t onRemoveLast: this.handleRemoveLast,\n\t value: this.state.selectedToken\n\t },\n\t this.props.menuContent\n\t )\n\t )\n\t );\n\t }\n\t})\n\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar addClass = __webpack_require__(6);\n\tvar div = React.createFactory('div');\n\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\n\t propTypes: {\n\n\t /**\n\t * The value that will be sent to the `onSelect` handler of the\n\t * parent Combobox.\n\t */\n\t value: React.PropTypes.any.isRequired,\n\n\t /**\n\t * What value to put into the input element when this option is\n\t * selected, defaults to its children coerced to a string.\n\t */\n\t label: React.PropTypes.string\n\t },\n\n\t getDefaultProps: function() {\n\t return {\n\t role: 'option',\n\t tabIndex: '-1',\n\t className: 'ic-tokeninput-option',\n\t isSelected: false\n\t };\n\t },\n\n\t render: function() {\n\t var props = this.props;\n\t if (props.isSelected) {\n\t props.className = addClass(props.className, 'ic-tokeninput-selected');\n\t props.ariaSelected = true;\n\t }\n\t return div(props);\n\t }\n\n\t});\n\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar guid = 0;\n\tvar k = function(){};\n\tvar addClass = __webpack_require__(6);\n\tvar ComboboxOption = React.createFactory(__webpack_require__(2));\n\n\tvar div = React.createFactory('div');\n\tvar span = React.createFactory('span');\n\tvar input = React.createFactory('input');\n\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\n\t propTypes: {\n\t /**\n\t * Called when the combobox receives user input, this is your chance to\n\t * filter the data and rerender the options.\n\t *\n\t * Signature:\n\t *\n\t * ```js\n\t * function(userInput){}\n\t * ```\n\t */\n\t onInput: React.PropTypes.func,\n\n\t /**\n\t * Called when the combobox receives a selection. You probably want to reset\n\t * the options to the full list at this point.\n\t *\n\t * Signature:\n\t *\n\t * ```js\n\t * function(selectedValue){}\n\t * ```\n\t */\n\t onSelect: React.PropTypes.func\n\t },\n\n\t getDefaultProps: function() {\n\t return {\n\t autocomplete: 'both',\n\t onInput: k,\n\t onSelect: k,\n\t value: null\n\t };\n\t },\n\n\t getInitialState: function() {\n\t return {\n\t value: this.props.value,\n\t // the value displayed in the input\n\t inputValue: this.findInitialInputValue(),\n\t isOpen: false,\n\t focusedIndex: null,\n\t matchedAutocompleteOption: null,\n\t // this prevents crazy jumpiness since we focus options on mouseenter\n\t usingKeyboard: false,\n\t activedescendant: null,\n\t listId: 'ic-tokeninput-list-'+(++guid),\n\t menu: {\n\t children: [],\n\t activedescendant: null,\n\t isEmpty: true\n\t }\n\t };\n\t },\n\n\t componentWillMount: function() {\n\t this.setState({menu: this.makeMenu()});\n\t },\n\n\t componentWillReceiveProps: function(newProps) {\n\t this.setState({menu: this.makeMenu(newProps.children)}, function() {\n\t if(newProps.children.length && (this.isOpen || document.activeElement === this.refs.input.getDOMNode())) {\n\t this.showList();\n\t } else {\n\t this.hideList();\n\t }\n\n\t }.bind(this));\n\t },\n\n\t /**\n\t * We don't create the components, the user supplies them,\n\t * so before rendering we attach handlers to facilitate communication from\n\t * the ComboboxOption to the Combobox.\n\t */\n\t makeMenu: function(children) {\n\t var activedescendant;\n\t var isEmpty = true;\n\t children = children || this.props.children;\n\n\t // Should this instead use React.addons.cloneWithProps or React.cloneElement?\n\t React.Children.forEach(children, function(child, index) {\n\t if (child.type !== ComboboxOption.type)\n\t // allow random elements to live in this list\n\t return;\n\t isEmpty = false;\n\t // TODO: cloneWithProps and map instead of altering the children in-place\n\t var props = child.props;\n\t if (this.state.value === props.value) {\n\t // need an ID for WAI-ARIA\n\t props.id = props.id || 'ic-tokeninput-selected-'+(++guid);\n\t props.isSelected = true\n\t activedescendant = props.id;\n\t }\n\t props.onBlur = this.handleOptionBlur;\n\t props.onClick = this.selectOption.bind(this, child);\n\t props.onFocus = this.handleOptionFocus;\n\t props.onKeyDown = this.handleOptionKeyDown.bind(this, child);\n\t props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index);\n\t }.bind(this));\n\n\t return {\n\t children: children,\n\t activedescendant: activedescendant,\n\t isEmpty: isEmpty\n\t };\n\t },\n\n\t getClassName: function() {\n\t var className = addClass(this.props.className, 'ic-tokeninput');\n\t if (this.state.isOpen)\n\t className = addClass(className, 'ic-tokeninput-is-open');\n\t return className;\n\t },\n\n\t /**\n\t * When the user begins typing again we need to clear out any state that has\n\t * to do with an existing or potential selection.\n\t */\n\t clearSelectedState: function(cb) {\n\t this.setState({\n\t focusedIndex: null,\n\t inputValue: null,\n\t value: null,\n\t matchedAutocompleteOption: null,\n\t activedescendant: null\n\t }, cb);\n\t },\n\n\t handleInputChange: function(event) {\n\t var value = this.refs.input.getDOMNode().value;\n\t this.clearSelectedState(function() {\n\t this.props.onInput(value);\n\t }.bind(this));\n\t },\n\n\t handleInputBlur: function() {\n\t var focusedAnOption = this.state.focusedIndex != null;\n\t if (focusedAnOption)\n\t return;\n\t this.maybeSelectAutocompletedOption();\n\t this.hideList();\n\t },\n\n\t handleOptionBlur: function() {\n\t // don't want to hide the list if we focused another option\n\t this.blurTimer = setTimeout(this.hideList, 0);\n\t },\n\n\t handleOptionFocus: function() {\n\t // see `handleOptionBlur`\n\t clearTimeout(this.blurTimer);\n\t },\n\n\t handleInputKeyUp: function(event) {\n\t if (\n\t this.state.menu.isEmpty ||\n\t // autocompleting while backspacing feels super weird, so let's not\n\t event.keyCode === 8 /*backspace*/ ||\n\t !this.props.autocomplete.match(/both|inline/)\n\t ) return;\n\t },\n\n\t handleButtonClick: function() {\n\t this.state.isOpen ? this.hideList() : this.showList();\n\t this.focusInput();\n\t },\n\n\t showList: function() {\n\t if(!this.state.menu.children.length) {\n\t return\n\t }\n\t this.setState({isOpen: true})\n\t },\n\n\t hideList: function() {\n\t this.setState({isOpen: false});\n\t },\n\n\t hideOnEscape: function(event) {\n\t this.hideList();\n\t this.focusInput();\n\t event.preventDefault();\n\t },\n\n\t focusInput: function() {\n\t this.refs.input.getDOMNode().focus();\n\t },\n\n\t selectInput: function() {\n\t this.refs.input.getDOMNode().select();\n\t },\n\n\t inputKeydownMap: {\n\t 8: 'removeLastToken',\n\t 13: 'selectOnEnter',\n\t 27: 'hideOnEscape',\n\t 38: 'focusPrevious',\n\t 40: 'focusNext'\n\t },\n\n\t optionKeydownMap: {\n\t 13: 'selectOption',\n\t 27: 'hideOnEscape',\n\t 38: 'focusPrevious',\n\t 40: 'focusNext'\n\t },\n\n\t handleKeydown: function(event) {\n\t var handlerName = this.inputKeydownMap[event.keyCode];\n\t if (!handlerName)\n\t return\n\t this.setState({usingKeyboard: true});\n\t return this[handlerName].call(this,event);\n\t },\n\n\t handleOptionKeyDown: function(child, event) {\n\t var handlerName = this.optionKeydownMap[event.keyCode];\n\t if (!handlerName) {\n\t // if the user starts typing again while focused on an option, move focus\n\t // to the inpute, select so it wipes out any existing value\n\t this.selectInput();\n\t return;\n\t }\n\t event.preventDefault();\n\t this.setState({usingKeyboard: true});\n\t this[handlerName].call(this, child);\n\t },\n\n\t handleOptionMouseEnter: function(index) {\n\t if (this.state.usingKeyboard)\n\t this.setState({usingKeyboard: false});\n\t else\n\t this.focusOptionAtIndex(index);\n\t },\n\n\t selectOnEnter: function(event) {\n\t event.preventDefault();\n\t this.maybeSelectAutocompletedOption()\n\t },\n\n\t maybeSelectAutocompletedOption: function() {\n\t if (!this.state.matchedAutocompleteOption) {\n\t this.selectText()\n\t } else {\n\t this.selectOption(this.state.matchedAutocompleteOption, {focus: false});\n\t }\n\t },\n\n\t selectOption: function(child, options) {\n\t options = options || {};\n\t this.setState({\n\t // value: child.props.value,\n\t // inputValue: getLabel(child),\n\t matchedAutocompleteOption: null\n\t }, function() {\n\t this.props.onSelect(child.props.value, child);\n\t this.hideList();\n\t this.clearSelectedState(); // added\n\t if (options.focus !== false)\n\t this.selectInput();\n\t }.bind(this));\n\t this.refs.input.getDOMNode().value = '' // added\n\t },\n\n\t selectText: function() {\n\t var value = this.refs.input.getDOMNode().value;\n\t if(!value) return;\n\t this.props.onSelect(value);\n\t this.clearSelectedState();\n\t this.refs.input.getDOMNode().value = '' // added\n\t },\n\n\t focusNext: function(event) {\n\t if(event.preventDefault) event.preventDefault();\n\t if (this.state.menu.isEmpty) return;\n\t var index = this.state.focusedIndex == null ?\n\t 0 : this.state.focusedIndex + 1;\n\t this.focusOptionAtIndex(index);\n\t },\n\n\t removeLastToken: function() {\n\t if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) {\n\t this.props.onRemoveLast()\n\t }\n\t return true\n\t },\n\n\t focusPrevious: function(event) {\n\t if(event.preventDefault) event.preventDefault();\n\t if (this.state.menu.isEmpty) return;\n\t var last = this.props.children.length - 1;\n\t var index = this.state.focusedIndex == null ?\n\t last : this.state.focusedIndex - 1;\n\t this.focusOptionAtIndex(index);\n\t },\n\n\t focusSelectedOption: function() {\n\t var selectedIndex;\n\t React.Children.forEach(this.props.children, function(child, index) {\n\t if (child.props.value === this.state.value)\n\t selectedIndex = index;\n\t }.bind(this));\n\t this.showList();\n\t this.setState({\n\t focusedIndex: selectedIndex\n\t }, this.focusOption);\n\t },\n\n\t findInitialInputValue: function() {\n\t // TODO: might not need this, we should know this in `makeMenu`\n\t var inputValue;\n\t React.Children.forEach(this.props.children, function(child) {\n\t if (child.props.value === this.props.value)\n\t inputValue = getLabel(child);\n\t }.bind(this));\n\t return inputValue;\n\t },\n\n\t focusOptionAtIndex: function(index) {\n\t if (!this.state.isOpen && this.state.value)\n\t return this.focusSelectedOption();\n\t this.showList();\n\t var length = this.props.children.length;\n\t if (index === -1)\n\t index = length - 1;\n\t else if (index === length)\n\t index = 0;\n\t this.setState({\n\t focusedIndex: index\n\t }, this.focusOption);\n\t },\n\n\t focusOption: function() {\n\t var index = this.state.focusedIndex;\n\t this.refs.list.getDOMNode().childNodes[index].focus();\n\t },\n\n\t render: function() {\n\t var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' +\n\t 'Press the down arrow to navigate results. If you don\\'t find an ' +\n\t 'acceptable option, you can enter an alternative.'\n\n\t return div({className: this.getClassName()},\n\t this.props.value,\n\t this.state.inputValue,\n\t input({\n\t ref: 'input',\n\t autoComplete: 'off',\n\t spellCheck: 'false',\n\t 'aria-label': ariaLabel,\n\t 'aria-expanded': this.state.isOpen+'',\n\t 'aria-haspopup': 'true',\n\t 'aria-activedescendant': this.state.menu.activedescendant,\n\t 'aria-autocomplete': 'list',\n\t 'aria-owns': this.state.listId,\n\t id: this.props.id,\n\t className: 'ic-tokeninput-input',\n\t onChange: this.handleInputChange,\n\t onBlur: this.handleInputBlur,\n\t onKeyDown: this.handleKeydown,\n\t onKeyUp: this.handleInputKeyUp,\n\t role: 'combobox'\n\t }),\n\t span({\n\t 'aria-hidden': 'true',\n\t className: 'ic-tokeninput-button',\n\t onClick: this.handleButtonClick\n\t }, '▾'),\n\t div({\n\t id: this.state.listId,\n\t ref: 'list',\n\t className: 'ic-tokeninput-list',\n\t role: 'listbox'\n\t }, this.state.menu.children)\n\t );\n\t }\n\t});\n\n\tfunction getLabel(component) {\n\t return component.props.label || component.props.children;\n\t}\n\n\tfunction matchFragment(userInput, firstChildLabel) {\n\t userInput = userInput.toLowerCase();\n\t firstChildLabel = firstChildLabel.toLowerCase();\n\t if (userInput === '' || userInput === firstChildLabel)\n\t return false;\n\t if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1)\n\t return false;\n\t return true;\n\t}\n\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar span = React.DOM.span;\n\tvar li = React.createFactory('li');\n\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\t handleClick: function() {\n\t this.props.onRemove(this.props.value)\n\t },\n\n\t handleKeyDown: function(key) {\n\t var enterKey = 13;\n\t if(key.keyCode === enterKey) this.props.onRemove(this.props.value)\n\t },\n\n\t render: function() {\n\t return (\n\t li({\n\t className: \"ic-token inline-flex\"\n\t },\n\t span({\n\t role: 'button',\n\t onClick: this.handleClick,\n\t onKeyDown: this.handleKeyDown,\n\t 'aria-label': 'Remove \\'' + this.props.name + '\\'',\n\t className: \"ic-token-delete-button\",\n\t tabIndex: 0\n\t }, \"✕\"),\n\t span({className: \"ic-token-label\"}, this.props.name)\n\t )\n\t )\n\t }\n\t})\n\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = addClass;\n\n\tfunction addClass(existing, added) {\n\t if (!existing) return added;\n\t if (existing.indexOf(added) > -1) return existing;\n\t return existing + ' ' + added;\n\t}\n\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** react-tokeninput.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap d565fa7672eea8600b30\n **/","var TokenInput = require('./lib/main')\nTokenInput.Option = require('./lib/option')\n\nmodule.exports = TokenInput\n\n\n\n/** WEBPACK FOOTER **\n ** ./index.js\n **/","var React = require('react');\nvar Combobox = React.createFactory(require('./combobox'));\nvar Token = React.createFactory(require('./token'));\n\nvar ul = React.createFactory('ul');\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n propTypes: {\n onInput: React.PropTypes.func,\n onSelect: React.PropTypes.func.isRequired,\n onRemove: React.PropTypes.func.isRequired,\n selected: React.PropTypes.array.isRequired,\n menuContent: React.PropTypes.any\n },\n\n getInitialState: function() {\n return {\n selectedToken: null\n };\n },\n\n handleClick: function() {\n // TODO: Expand combobox API for focus\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleInput: function(event) {\n this.props.onInput(event);\n },\n\n handleSelect: function(event) {\n this.props.onSelect(event)\n this.setState({\n selectedToken: null\n })\n },\n\n handleRemove: function(value) {\n this.props.onRemove(value);\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleRemoveLast: function() {\n this.props.onRemove(this.props.selected[this.props.selected.length - 1]);\n },\n\n render: function() {\n var tokens = this.props.selected.map(function(token) {\n return (\n Token({\n onRemove: this.handleRemove,\n value: token,\n name: token.name,\n key: token.id})\n )\n }.bind(this))\n\n return ul({className: 'ic-tokens flex', onClick: this.handleClick},\n tokens,\n li({className: 'inline-flex', ref: 'combo-li'},\n Combobox({\n id: this.props.id,\n ariaLabel: this.props['combobox-aria-label'],\n onInput: this.handleInput,\n onSelect: this.handleSelect,\n onRemoveLast: this.handleRemoveLast,\n value: this.state.selectedToken\n },\n this.props.menuContent\n )\n )\n );\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/main.js\n **/","var React = require('react');\nvar addClass = require('./add-class');\nvar div = React.createFactory('div');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n\n /**\n * The value that will be sent to the `onSelect` handler of the\n * parent Combobox.\n */\n value: React.PropTypes.any.isRequired,\n\n /**\n * What value to put into the input element when this option is\n * selected, defaults to its children coerced to a string.\n */\n label: React.PropTypes.string\n },\n\n getDefaultProps: function() {\n return {\n role: 'option',\n tabIndex: '-1',\n className: 'ic-tokeninput-option',\n isSelected: false\n };\n },\n\n render: function() {\n var props = this.props;\n if (props.isSelected) {\n props.className = addClass(props.className, 'ic-tokeninput-selected');\n props.ariaSelected = true;\n }\n return div(props);\n }\n\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/option.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n ** module id = 3\n ** module chunks = 0\n **/","var React = require('react');\nvar guid = 0;\nvar k = function(){};\nvar addClass = require('./add-class');\nvar ComboboxOption = React.createFactory(require('./option'));\n\nvar div = React.createFactory('div');\nvar span = React.createFactory('span');\nvar input = React.createFactory('input');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n /**\n * Called when the combobox receives user input, this is your chance to\n * filter the data and rerender the options.\n *\n * Signature:\n *\n * ```js\n * function(userInput){}\n * ```\n */\n onInput: React.PropTypes.func,\n\n /**\n * Called when the combobox receives a selection. You probably want to reset\n * the options to the full list at this point.\n *\n * Signature:\n *\n * ```js\n * function(selectedValue){}\n * ```\n */\n onSelect: React.PropTypes.func\n },\n\n getDefaultProps: function() {\n return {\n autocomplete: 'both',\n onInput: k,\n onSelect: k,\n value: null\n };\n },\n\n getInitialState: function() {\n return {\n value: this.props.value,\n // the value displayed in the input\n inputValue: this.findInitialInputValue(),\n isOpen: false,\n focusedIndex: null,\n matchedAutocompleteOption: null,\n // this prevents crazy jumpiness since we focus options on mouseenter\n usingKeyboard: false,\n activedescendant: null,\n listId: 'ic-tokeninput-list-'+(++guid),\n menu: {\n children: [],\n activedescendant: null,\n isEmpty: true\n }\n };\n },\n\n componentWillMount: function() {\n this.setState({menu: this.makeMenu()});\n },\n\n componentWillReceiveProps: function(newProps) {\n this.setState({menu: this.makeMenu(newProps.children)}, function() {\n if(newProps.children.length && (this.isOpen || document.activeElement === this.refs.input.getDOMNode())) {\n this.showList();\n } else {\n this.hideList();\n }\n\n }.bind(this));\n },\n\n /**\n * We don't create the components, the user supplies them,\n * so before rendering we attach handlers to facilitate communication from\n * the ComboboxOption to the Combobox.\n */\n makeMenu: function(children) {\n var activedescendant;\n var isEmpty = true;\n children = children || this.props.children;\n\n // Should this instead use React.addons.cloneWithProps or React.cloneElement?\n React.Children.forEach(children, function(child, index) {\n if (child.type !== ComboboxOption.type)\n // allow random elements to live in this list\n return;\n isEmpty = false;\n // TODO: cloneWithProps and map instead of altering the children in-place\n var props = child.props;\n if (this.state.value === props.value) {\n // need an ID for WAI-ARIA\n props.id = props.id || 'ic-tokeninput-selected-'+(++guid);\n props.isSelected = true\n activedescendant = props.id;\n }\n props.onBlur = this.handleOptionBlur;\n props.onClick = this.selectOption.bind(this, child);\n props.onFocus = this.handleOptionFocus;\n props.onKeyDown = this.handleOptionKeyDown.bind(this, child);\n props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index);\n }.bind(this));\n\n return {\n children: children,\n activedescendant: activedescendant,\n isEmpty: isEmpty\n };\n },\n\n getClassName: function() {\n var className = addClass(this.props.className, 'ic-tokeninput');\n if (this.state.isOpen)\n className = addClass(className, 'ic-tokeninput-is-open');\n return className;\n },\n\n /**\n * When the user begins typing again we need to clear out any state that has\n * to do with an existing or potential selection.\n */\n clearSelectedState: function(cb) {\n this.setState({\n focusedIndex: null,\n inputValue: null,\n value: null,\n matchedAutocompleteOption: null,\n activedescendant: null\n }, cb);\n },\n\n handleInputChange: function(event) {\n var value = this.refs.input.getDOMNode().value;\n this.clearSelectedState(function() {\n this.props.onInput(value);\n }.bind(this));\n },\n\n handleInputBlur: function() {\n var focusedAnOption = this.state.focusedIndex != null;\n if (focusedAnOption)\n return;\n this.maybeSelectAutocompletedOption();\n this.hideList();\n },\n\n handleOptionBlur: function() {\n // don't want to hide the list if we focused another option\n this.blurTimer = setTimeout(this.hideList, 0);\n },\n\n handleOptionFocus: function() {\n // see `handleOptionBlur`\n clearTimeout(this.blurTimer);\n },\n\n handleInputKeyUp: function(event) {\n if (\n this.state.menu.isEmpty ||\n // autocompleting while backspacing feels super weird, so let's not\n event.keyCode === 8 /*backspace*/ ||\n !this.props.autocomplete.match(/both|inline/)\n ) return;\n },\n\n handleButtonClick: function() {\n this.state.isOpen ? this.hideList() : this.showList();\n this.focusInput();\n },\n\n showList: function() {\n if(!this.state.menu.children.length) {\n return\n }\n this.setState({isOpen: true})\n },\n\n hideList: function() {\n this.setState({isOpen: false});\n },\n\n hideOnEscape: function(event) {\n this.hideList();\n this.focusInput();\n event.preventDefault();\n },\n\n focusInput: function() {\n this.refs.input.getDOMNode().focus();\n },\n\n selectInput: function() {\n this.refs.input.getDOMNode().select();\n },\n\n inputKeydownMap: {\n 8: 'removeLastToken',\n 13: 'selectOnEnter',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n optionKeydownMap: {\n 13: 'selectOption',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n handleKeydown: function(event) {\n var handlerName = this.inputKeydownMap[event.keyCode];\n if (!handlerName)\n return\n this.setState({usingKeyboard: true});\n return this[handlerName].call(this,event);\n },\n\n handleOptionKeyDown: function(child, event) {\n var handlerName = this.optionKeydownMap[event.keyCode];\n if (!handlerName) {\n // if the user starts typing again while focused on an option, move focus\n // to the inpute, select so it wipes out any existing value\n this.selectInput();\n return;\n }\n event.preventDefault();\n this.setState({usingKeyboard: true});\n this[handlerName].call(this, child);\n },\n\n handleOptionMouseEnter: function(index) {\n if (this.state.usingKeyboard)\n this.setState({usingKeyboard: false});\n else\n this.focusOptionAtIndex(index);\n },\n\n selectOnEnter: function(event) {\n event.preventDefault();\n this.maybeSelectAutocompletedOption()\n },\n\n maybeSelectAutocompletedOption: function() {\n if (!this.state.matchedAutocompleteOption) {\n this.selectText()\n } else {\n this.selectOption(this.state.matchedAutocompleteOption, {focus: false});\n }\n },\n\n selectOption: function(child, options) {\n options = options || {};\n this.setState({\n // value: child.props.value,\n // inputValue: getLabel(child),\n matchedAutocompleteOption: null\n }, function() {\n this.props.onSelect(child.props.value, child);\n this.hideList();\n this.clearSelectedState(); // added\n if (options.focus !== false)\n this.selectInput();\n }.bind(this));\n this.refs.input.getDOMNode().value = '' // added\n },\n\n selectText: function() {\n var value = this.refs.input.getDOMNode().value;\n if(!value) return;\n this.props.onSelect(value);\n this.clearSelectedState();\n this.refs.input.getDOMNode().value = '' // added\n },\n\n focusNext: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var index = this.state.focusedIndex == null ?\n 0 : this.state.focusedIndex + 1;\n this.focusOptionAtIndex(index);\n },\n\n removeLastToken: function() {\n if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) {\n this.props.onRemoveLast()\n }\n return true\n },\n\n focusPrevious: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var last = this.props.children.length - 1;\n var index = this.state.focusedIndex == null ?\n last : this.state.focusedIndex - 1;\n this.focusOptionAtIndex(index);\n },\n\n focusSelectedOption: function() {\n var selectedIndex;\n React.Children.forEach(this.props.children, function(child, index) {\n if (child.props.value === this.state.value)\n selectedIndex = index;\n }.bind(this));\n this.showList();\n this.setState({\n focusedIndex: selectedIndex\n }, this.focusOption);\n },\n\n findInitialInputValue: function() {\n // TODO: might not need this, we should know this in `makeMenu`\n var inputValue;\n React.Children.forEach(this.props.children, function(child) {\n if (child.props.value === this.props.value)\n inputValue = getLabel(child);\n }.bind(this));\n return inputValue;\n },\n\n focusOptionAtIndex: function(index) {\n if (!this.state.isOpen && this.state.value)\n return this.focusSelectedOption();\n this.showList();\n var length = this.props.children.length;\n if (index === -1)\n index = length - 1;\n else if (index === length)\n index = 0;\n this.setState({\n focusedIndex: index\n }, this.focusOption);\n },\n\n focusOption: function() {\n var index = this.state.focusedIndex;\n this.refs.list.getDOMNode().childNodes[index].focus();\n },\n\n render: function() {\n var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' +\n 'Press the down arrow to navigate results. If you don\\'t find an ' +\n 'acceptable option, you can enter an alternative.'\n\n return div({className: this.getClassName()},\n this.props.value,\n this.state.inputValue,\n input({\n ref: 'input',\n autoComplete: 'off',\n spellCheck: 'false',\n 'aria-label': ariaLabel,\n 'aria-expanded': this.state.isOpen+'',\n 'aria-haspopup': 'true',\n 'aria-activedescendant': this.state.menu.activedescendant,\n 'aria-autocomplete': 'list',\n 'aria-owns': this.state.listId,\n id: this.props.id,\n className: 'ic-tokeninput-input',\n onChange: this.handleInputChange,\n onBlur: this.handleInputBlur,\n onKeyDown: this.handleKeydown,\n onKeyUp: this.handleInputKeyUp,\n role: 'combobox'\n }),\n span({\n 'aria-hidden': 'true',\n className: 'ic-tokeninput-button',\n onClick: this.handleButtonClick\n }, '▾'),\n div({\n id: this.state.listId,\n ref: 'list',\n className: 'ic-tokeninput-list',\n role: 'listbox'\n }, this.state.menu.children)\n );\n }\n});\n\nfunction getLabel(component) {\n return component.props.label || component.props.children;\n}\n\nfunction matchFragment(userInput, firstChildLabel) {\n userInput = userInput.toLowerCase();\n firstChildLabel = firstChildLabel.toLowerCase();\n if (userInput === '' || userInput === firstChildLabel)\n return false;\n if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1)\n return false;\n return true;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/combobox.js\n **/","var React = require('react');\nvar span = React.DOM.span;\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n handleClick: function() {\n this.props.onRemove(this.props.value)\n },\n\n handleKeyDown: function(key) {\n var enterKey = 13;\n if(key.keyCode === enterKey) this.props.onRemove(this.props.value)\n },\n\n render: function() {\n return (\n li({\n className: \"ic-token inline-flex\"\n },\n span({\n role: 'button',\n onClick: this.handleClick,\n onKeyDown: this.handleKeyDown,\n 'aria-label': 'Remove \\'' + this.props.name + '\\'',\n className: \"ic-token-delete-button\",\n tabIndex: 0\n }, \"✕\"),\n span({className: \"ic-token-label\"}, this.props.name)\n )\n )\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/token.js\n **/","module.exports = addClass;\n\nfunction addClass(existing, added) {\n if (!existing) return added;\n if (existing.indexOf(added) > -1) return existing;\n return existing + ' ' + added;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/add-class.js\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/example/flavors.js b/example/flavors.js deleted file mode 100644 index dc6f64e..0000000 --- a/example/flavors.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = [ - { id: "1", name: "Vanilla"}, - { id: "2", name: "Chocolate"} -]; diff --git a/example/main.js b/example/main.js index c81d91b..c212907 100644 --- a/example/main.js +++ b/example/main.js @@ -1,18 +1,16 @@ -/** @jsx React.DOM */ - var React = require('react') var TokenInput = require('../index') var ComboboxOption = require('../index').Option var without = require('lodash-node/modern/arrays/without') var uniq = require('lodash-node/modern/arrays/uniq') -var flavors = require('./flavors') +var names = require('./names') var App = React.createClass({ getInitialState: function() { return { selected: [], - options: flavors + options: names }; }, @@ -50,18 +48,18 @@ var App = React.createClass({ if (userInput === '') return this.setState({options: []}); var filter = new RegExp('^'+userInput, 'i'); - this.setState({options: flavors.filter(function(state) { + this.setState({options: names.filter(function(state) { return filter.test(state.name) || filter.test(state.id); })}); }, renderComboboxOptions: function() { - return this.state.options.map(function(flavor) { + return this.state.options.map(function(name) { return ( {flavor.name} + key={name.id} + value={name} + >{name.name} ); }); }, diff --git a/example/names.js b/example/names.js new file mode 100644 index 0000000..2cb0b2e --- /dev/null +++ b/example/names.js @@ -0,0 +1,1808 @@ +module.exports = [ + "Aaliyah", + "Aarushi", + "Abagail", + "Abbey", + "Abbi", + "Abbie", + "Abby", + "Abi", + "Abia", + "Abigail", + "Aby", + "Acacia", + "Ada", + "Adalia", + "Adalyn", + "Addie", + "Addison", + "Adelaide", + "Adele", + "Adelia", + "Adelina", + "Adeline", + "Adreanna", + "Adriana", + "Adrianna", + "Adrianne", + "Adrienne", + "Aerona", + "Agatha", + "Aggie", + "Agnes", + "Aida", + "Aileen", + "Aimee", + "Aine", + "Ainsleigh", + "Ainsley", + "Aisha", + "Aisling", + "Aislinn", + "Alaina", + "Alana", + "Alanis", + "Alanna", + "Alannah", + "Alayah", + "Alayna", + "Alba", + "Alberta", + "Aleah", + "Alecia", + "Aleisha", + "Alejandra", + "Alena", + "Alessandra", + "Alessia", + "Alex", + "Alexa", + "Alexandra", + "Alexandria", + "Alexia", + "Alexis", + "Alexus", + "Ali", + "Alia", + "Alice", + "Alicia", + "Alina", + "Alisa", + "Alisha", + "Alison", + "Alissa", + "Alivia", + "Aliyah", + "Alize", + "Alka", + "Allie", + "Allison", + "Ally", + "Allyson", + "Alma", + "Alondra", + "Alycia", + "Alyshialynn", + "Alyson", + "Alyssa", + "Alyssia", + "Amalia", + "Amanda", + "Amani", + "Amara", + "Amari", + "Amaris", + "Amaya", + "Amber", + "Amberly", + "Amelia", + "Amelie", + "America", + "Amethyst", + "Amie", + "Amina", + "Amirah", + "Amity", + "Amy", + "Amya", + "Ana", + "Anabel", + "Anabelle", + "Anahi", + "Anais", + "Anamaria", + "Ananya", + "Anastasia", + "Andie", + "Andrea", + "Andromeda", + "Angel", + "Angela", + "Angelia", + "Angelica", + "Angelina", + "Angeline", + "Angelique", + "Angie", + "Anika", + "Anisa", + "Anita", + "Aniya", + "Aniyah", + "Anjali", + "Ann", + "Anna", + "Annabel", + "Annabella", + "Annabelle", + "Annabeth", + "Annalisa", + "Annalise", + "Anne", + "Anneke", + "Annemarie", + "Annette", + "Annie", + "Annika", + "Annmarie", + "Anthea", + "Antoinette", + "Antonia", + "Anuja", + "Anusha", + "Anushka", + "Anya", + "Aoibhe", + "Aoibheann", + "Aoife", + "Aphrodite", + "Apple", + "April", + "Aqua", + "Arabella", + "Aria", + "Ariadne", + "Ariana", + "Arianna", + "Arianne", + "Ariel", + "Ariella", + "Arielle", + "Arisha", + "Arleen", + "Arlene", + "Artemis", + "Arwen", + "Arya", + "Asha", + "Ashanti", + "Ashlee", + "Ashleigh", + "Ashley", + "Ashlie", + "Ashlyn", + "Ashlynn", + "Ashton", + "Ashvini", + "Asia", + "Asma", + "Aspen", + "Astrid", + "Athena", + "Aubree", + "Aubrey", + "Audra", + "Audrey", + "Audrina", + "Augustina", + "Aurelia", + "Aurora", + "Autumn", + "Ava", + "Avalon", + "Avery", + "Avril", + "Aya", + "Ayana", + "Ayanna", + "Ayesha", + "Ayisha", + "Ayla", + "Azalea", + "Azaria", + "Azariah", + "Bailey", + "Barbara", + "Barbie", + "Bay", + "Baylee", + "Bea", + "Beatrice", + "Beatrix", + "Becca", + "Beccy", + "Becky", + "Belinda", + "Bella", + "Bellatrix", + "Belle", + "Benita", + "Bernadette", + "Bernice", + "Bertha", + "Beryl", + "Bess", + "Beth", + "Bethan", + "Bethanie", + "Bethany", + "Betsy", + "Bettina", + "Betty", + "Beverly", + "Beyonce", + "Bianca", + "Billie", + "Blair", + "Blaire", + "Blake", + "Blanche", + "Bliss", + "Bloom", + "Blossom", + "Blythe", + "Bobbi", + "Bobbie", + "Bonita", + "Bonnie", + "Bonquesha", + "Braelyn", + "Brandi", + "Brandy", + "Braylee", + "Brea", + "Breanna", + "Bree", + "Breeze", + "Brenda", + "Brenna", + "Bria", + "Briana", + "Brianna", + "Brianne", + "Briar", + "Bridget", + "Bridgette", + "Bridie", + "Briella", + "Brielle", + "Brigid", + "Briley", + "Brinley", + "Briony", + "Brisa", + "Britney", + "Britt", + "Brittany", + "Brittney", + "Brogan", + "Bronte", + "Bronwen", + "Bronwyn", + "Brooke", + "Brooklyn", + "Brooklynn", + "Bryanna", + "Brylee", + "Bryn", + "Brynlee", + "Brynn", + "Bryony", + "Bunty", + "Cadence", + "Cailin", + "Caitlan", + "Caitlin", + "Caitlyn", + "Caleigh", + "Cali", + "Callie", + "Calliope", + "Callista", + "Calypso", + "Cambria", + "Cameron", + "Cami", + "Camila", + "Camilla", + "Camille", + "Camryn", + "Candace", + "Candice", + "Candis", + "Candy", + "Caoimhe", + "Caprice", + "Cara", + "Carina", + "Caris", + "Carissa", + "Carla", + "Carley", + "Carlie", + "Carly", + "Carlynn", + "Carmel", + "Carmela", + "Carmen", + "Carol", + "Carole", + "Carolina", + "Caroline", + "Carolyn", + "Carrie", + "Carter", + "Carys", + "Casey", + "Cassandra", + "Cassia", + "Cassidy", + "Cassie", + "Cat", + "Cate", + "Caterina", + "Cathalina", + "Catherine", + "Cathleen", + "Cathy", + "Catlin", + "Catrina", + "Catriona", + "Cayla", + "Cecelia", + "Cecilia", + "Cecily", + "Celeste", + "Celestia", + "Celestine", + "Celia", + "Celina", + "Celine", + "Cerys", + "Chanel", + "Chanelle", + "Chantal", + "Chantelle", + "Charis", + "Charissa", + "Charity", + "Charlene", + "Charley", + "Charlie", + "Charlize", + "Charlotte", + "Charmaine", + "Chastity", + "Chelsea", + "Chelsey", + "Chenille", + "Cher", + "Cheri", + "Cherie", + "Cherry", + "Cheryl", + "Cheyanne", + "Cheyenne", + "Chiara", + "Chloe", + "Chris", + "Chrissy", + "Christa", + "Christabel", + "Christal", + "Christen", + "Christi", + "Christiana", + "Christie", + "Christina", + "Christine", + "Christy", + "Chrystal", + "Ciara", + "Cici", + "Ciel", + "Cierra", + "Cindy", + "Claire", + "Clara", + "Clarabelle", + "Clare", + "Clarice", + "Claris", + "Clarissa", + "Clarisse", + "Clarity", + "Clary", + "Claudette", + "Claudia", + "Claudine", + "Clea", + "Clementine", + "Cleo", + "Clodagh", + "Clotilde", + "Clover", + "Coco", + "Colette", + "Colleen", + "Connie", + "Constance", + "Cora", + "Coral", + "Coralie", + "Coraline", + "Cordelia", + "Cori", + "Corina", + "Corinne", + "Cornelia", + "Corra", + "Cosette", + "Courtney", + "Cressida", + "Cristina", + "Crystal", + "Cynthia", + "Dagmar", + "Dahlia", + "Daisy", + "Dakota", + "Dana", + "Danette", + "Dani", + "Danica", + "Daniela", + "Daniella", + "Danielle", + "Danika", + "Daphne", + "Dara", + "Darby", + "Darcey", + "Darcie", + "Darcy", + "Daria", + "Darla", + "Darlene", + "Dasia", + "Davida", + "Davina", + "Dawn", + "Dayna", + "Daysha", + "Deana", + "Deandra", + "Deann", + "Deanna", + "Deanne", + "Deb", + "Debbie", + "Debby", + "Debora", + "Deborah", + "Debra", + "Dee", + "Deedee", + "Deena", + "Deidre", + "Deirdre", + "Deja", + "Delaney", + "Delanie", + "Delia", + "Delilah", + "Della", + "Delores", + "Delphine", + "Demetria", + "Demi", + "Dena", + "Denise", + "Denny", + "Desiree", + "Destinee", + "Destiny", + "Diamond", + "Diana", + "Diane", + "Dianna", + "Dianne", + "Dido", + "Dina", + "Dionne", + "Dior", + "Dixie", + "Dolly", + "Dolores", + "Dominique", + "Donna", + "Dora", + "Doreen", + "Doris", + "Dorothy", + "Dot", + "Drew", + "Dulce", + "Eabha", + "Ebony", + "Echo", + "Eden", + "Edie", + "Edith", + "Edna", + "Edwina", + "Effie", + "Eileen", + "Eilidh", + "Eimear", + "Elaina", + "Elaine", + "Elana", + "Eleanor", + "Electra", + "Elektra", + "Elena", + "Eliana", + "Elin", + "Elina", + "Elisa", + "Elisabeth", + "Elise", + "Eliza", + "Elizabeth", + "Ella", + "Elle", + "Ellen", + "Ellery", + "Ellie", + "Ellis", + "Elly", + "Elodie", + "Eloise", + "Elora", + "Elsa", + "Elsie", + "Elspeth", + "Elva", + "Elvira", + "Elysia", + "Elyza", + "Emanuela", + "Ember", + "Emelda", + "Emely", + "Emer", + "Emerald", + "Emerson", + "Emilee", + "Emilia", + "Emilie", + "Emily", + "Emma", + "Emmaline", + "Emmalyn", + "Emmanuelle", + "Emmeline", + "Emmie", + "Emmy", + "Enya", + "Erica", + "Erika", + "Erin", + "Eris", + "Eryn", + "Esmay", + "Esme", + "Esmeralda", + "Esperanza", + "Estee", + "Estelle", + "Ester", + "Esther", + "Estrella", + "Ethel", + "Eugenie", + "Eunice", + "Eva", + "Evangeline", + "Eve", + "Evelin", + "Evelyn", + "Everly", + "Evie", + "Evita", + "Fabrizia", + "Faith", + "Fallon", + "Fanny", + "Farah", + "Farrah", + "Fatima", + "Fawn", + "Fay", + "Faye", + "Felicia", + "Felicity", + "Fern", + "Fernanda", + "Ffion", + "Fifi", + "Fiona", + "Fleur", + "Flor", + "Flora", + "Florence", + "Fran", + "Frances", + "Francesca", + "Francine", + "Frankie", + "Freda", + "Freya", + "Frida", + "Gabby", + "Gabriela", + "Gabriella", + "Gabrielle", + "Gail", + "Gayle", + "Gaynor", + "Geena", + "Gemma", + "Gena", + "Genesis", + "Genevieve", + "Georgette", + "Georgia", + "Georgie", + "Georgina", + "Geraldine", + "Gert", + "Gertrude", + "Gia", + "Gianna", + "Gigi", + "Gillian", + "Gina", + "Ginger", + "Ginny", + "Giovanna", + "Giselle", + "Gisselle", + "Gladys", + "Glenda", + "Glenys", + "Gloria", + "Golda", + "Grace", + "Gracelyn", + "Gracie", + "Grainne", + "Greta", + "Gretchen", + "Griselda", + "Guadalupe", + "Guinevere", + "Gwen", + "Gwendolyn", + "Gwyneth", + "Habiba", + "Hadley", + "Hailee", + "Hailey", + "Haleigh", + "Haley", + "Halle", + "Hallie", + "Hanna", + "Hannah", + "Harley", + "Harmony", + "Harper", + "Harriet", + "Hattie", + "Haven", + "Hayden", + "Haylee", + "Hayley", + "Hazel", + "Hazeline", + "Heather", + "Heaven", + "Heidi", + "Helen", + "Helena", + "Helene", + "Helga", + "Helina", + "Henrietta", + "Hepsiba", + "Hera", + "Hermione", + "Hester", + "Hetty", + "Hilary", + "Hilda", + "Hollie", + "Holly", + "Honesty", + "Honey", + "Honor", + "Honour", + "Hope", + "Hyacinth", + "Ianthe", + "Ida", + "Ila", + "Ilene", + "Iliana", + "Ilona", + "Ilse", + "Imani", + "Imelda", + "Imogen", + "India", + "Indie", + "Indigo", + "Indira", + "Ines", + "Ingrid", + "Iona", + "Ira", + "Irene", + "Irina", + "Iris", + "Irma", + "Isa", + "Isabel", + "Isabella", + "Isabelle", + "Isha", + "Isis", + "Isla", + "Isobel", + "Isolde", + "Itzel", + "Ivana", + "Ivy", + "Iyanna", + "Izabella", + "Izidora", + "Izzy", + "Jacinda", + "Jacinta", + "Jackie", + "Jacqueline", + "Jacquelyn", + "Jada", + "Jade", + "Jaden", + "Jadyn", + "Jaelynn", + "Jaida", + "Jaime", + "Jamie", + "Jamiya", + "Jan", + "Jana", + "Jancis", + "Jane", + "Janelle", + "Janessa", + "Janet", + "Janette", + "Janice", + "Janie", + "Janine", + "Janis", + "Janiya", + "January", + "Jaqueline", + "Jasmin", + "Jasmine", + "Jaya", + "Jayda", + "Jayden", + "Jayla", + "Jaylinn", + "Jaylynn", + "Jayne", + "Jazlyn", + "Jazmin", + "Jazmine", + "Jean", + "Jeanette", + "Jeanine", + "Jeanne", + "Jeannette", + "Jeannie", + "Jeannine", + "Jemima", + "Jemma", + "Jen", + "Jena", + "Jenelle", + "Jenessa", + "Jenna", + "Jenni", + "Jennie", + "Jennifer", + "Jenny", + "Jensen", + "Jeri", + "Jerri", + "Jess", + "Jessa", + "Jessica", + "Jessie", + "Jet", + "Jewel", + "Jill", + "Jillian", + "Jo", + "Joan", + "Joann", + "Joanna", + "Joanne", + "Jocelyn", + "Jodi", + "Jodie", + "Jody", + "Joelle", + "Johanna", + "Joleen", + "Jolene", + "Jolie", + "Joni", + "Jordan", + "Jordana", + "Jordyn", + "Jorja", + "Joselyn", + "Josephine", + "Josie", + "Joy", + "Joyce", + "Juanita", + "Judith", + "Judy", + "Jules", + "Julia", + "Juliana", + "Julianna", + "Julianne", + "Julie", + "Juliet", + "Juliette", + "Julissa", + "July", + "June", + "Juno", + "Justice", + "Justina", + "Justine", + "Kacey", + "Kadence", + "Kaidence", + "Kailey", + "Kailyn", + "Kaitlin", + "Kaitlyn", + "Kaitlynn", + "Kalea", + "Kaleigh", + "Kali", + "Kalia", + "Kamala", + "Kamryn", + "Kara", + "Karen", + "Kari", + "Karin", + "Karina", + "Karissa", + "Karla", + "Karlee", + "Karly", + "Karolina", + "Karyn", + "Kasey", + "Kassandra", + "Kassidy", + "Kassie", + "Kat", + "Katara", + "Katarina", + "Kate", + "Katelyn", + "Katelynn", + "Katerina", + "Katharine", + "Katherine", + "Kathleen", + "Kathryn", + "Kathy", + "Katia", + "Katie", + "Katlyn", + "Katniss", + "Katrina", + "Katy", + "Katya", + "Kay", + "Kaya", + "Kaye", + "Kayla", + "Kaylee", + "Kayleigh", + "Kayley", + "Kaylie", + "Kaylin", + "Keara", + "Keeley", + "Keely", + "Keira", + "Keisha", + "Kelis", + "Kelley", + "Kelli", + "Kellie", + "Kelly", + "Kelsey", + "Kelsie", + "Kendall", + "Kendra", + "Kenna", + "Kennedy", + "Kenzie", + "Keri", + "Kerian", + "Kerri", + "Kerry", + "Kia", + "Kiana", + "Kiara", + "Kiera", + "Kierra", + "Kiersten", + "Kiki", + "Kiley", + "Kim", + "Kimberlee", + "Kimberley", + "Kimberly", + "Kimbriella", + "Kimmy", + "Kinley", + "Kinsey", + "Kinsley", + "Kira", + "Kirsten", + "Kirstin", + "Kirsty", + "Kitty", + "Kizzy", + "Kloe", + "Kora", + "Kori", + "Kourtney", + "Kris", + "Krista", + "Kristen", + "Kristi", + "Kristie", + "Kristin", + "Kristina", + "Kristine", + "Kristy", + "Krystal", + "Kyla", + "Kylee", + "Kyleigh", + "Kylie", + "Kyra", + "Lacey", + "Lacie", + "Lacy", + "Ladonna", + "Laila", + "Lakyn", + "Lala", + "Lana", + "Laney", + "Lara", + "Larissa", + "Latoya", + "Laura", + "Laurel", + "Lauren", + "Laurie", + "Lauryn", + "Lavana", + "Lavender", + "Lavinia", + "Layla", + "Lea", + "Leah", + "Leandra", + "Leann", + "Leanna", + "Leanne", + "Lee", + "Leela", + "Leena", + "Leia", + "Leigh", + "Leila", + "Leilani", + "Lela", + "Lena", + "Lenore", + "Leona", + "Leonie", + "Leora", + "Lesley", + "Leslie", + "Lesly", + "Leticia", + "Lettie", + "Lexi", + "Lexia", + "Lexie", + "Lexis", + "Lia", + "Liana", + "Lianne", + "Libby", + "Liberty", + "Lidia", + "Liesl", + "Lila", + "Lilac", + "Lilah", + "Lili", + "Lilian", + "Liliana", + "Lilita", + "Lilith", + "Lillian", + "Lillie", + "Lilly", + "Lily", + "Lina", + "Linda", + "Lindsay", + "Lindsey", + "Lindy", + "Lisa", + "Lisette", + "Liv", + "Livia", + "Livvy", + "Liz", + "Liza", + "Lizbeth", + "Lizette", + "Lizzie", + "Lizzy", + "Logan", + "Lois", + "Lola", + "Lolita", + "London", + "Lora", + "Loran", + "Lorelei", + "Loren", + "Lorena", + "Loretta", + "Lori", + "Lorie", + "Lorna", + "Lorraine", + "Lorri", + "Lorrie", + "Lottie", + "Lotus", + "Lou", + "Louisa", + "Louise", + "Luann", + "Lucia", + "Luciana", + "Lucie", + "Lucille", + "Lucinda", + "Lucky", + "Lucy", + "Luisa", + "Lulu", + "Luna", + "Lupita", + "Luz", + "Lydia", + "Lyla", + "Lynda", + "Lyndsey", + "Lynette", + "Lynn", + "Lynne", + "Lynnette", + "Lynsey", + "Lyra", + "Lyric", + "Mabel", + "Macey", + "Macie", + "Mackenzie", + "Macy", + "Madalyn", + "Maddie", + "Maddison", + "Maddy", + "Madeleine", + "Madeline", + "Madelyn", + "Madison", + "Madisyn", + "Madyson", + "Mae", + "Maeve", + "Magda", + "Magdalena", + "Magdalene", + "Maggie", + "Maia", + "Maire", + "Mairead", + "Maisie", + "Maisy", + "Maja", + "Makayla", + "Makenna", + "Makenzie", + "Malia", + "Malinda", + "Mallory", + "Malory", + "Mandy", + "Manuela", + "Mara", + "Marcela", + "Marcella", + "Marci", + "Marcia", + "Marcy", + "Margaret", + "Margarita", + "Margaux", + "Margie", + "Margo", + "Margot", + "Margret", + "Maria", + "Mariah", + "Mariam", + "Marian", + "Mariana", + "Marianna", + "Marianne", + "Maribel", + "Marie", + "Mariela", + "Marilyn", + "Marina", + "Marion", + "Marisa", + "Marisol", + "Marissa", + "Maritza", + "Marjorie", + "Marla", + "Marlee", + "Marlene", + "Marley", + "Marnie", + "Marsha", + "Martha", + "Martina", + "Mary", + "Maryam", + "Maryann", + "Marybeth", + "Masie", + "Matilda", + "Maude", + "Maura", + "Maureen", + "Mavis", + "Maxine", + "May", + "Maya", + "Mazie", + "Mckayla", + "Mckenna", + "Mckenzie", + "Mea", + "Meadow", + "Meagan", + "Meera", + "Meg", + "Megan", + "Meghan", + "Mei", + "Mel", + "Melanie", + "Melina", + "Melinda", + "Melissa", + "Melody", + "Mercedes", + "Mercy", + "Meredith", + "Merida", + "Meryl", + "Mia", + "Michaela", + "Michele", + "Michelle", + "Mika", + "Mikaela", + "Mikayla", + "Mikhaela", + "Mila", + "Mildred", + "Milena", + "Miley", + "Millicent", + "Millie", + "Milly", + "Mimi", + "Mina", + "Mindy", + "Minerva", + "Minnie", + "Mira", + "Miracle", + "Miranda", + "Miriam", + "Missie", + "Misty", + "Mitzi", + "Moira", + "Mollie", + "Molly", + "Mona", + "Monica", + "Monika", + "Monique", + "Montana", + "Morgan", + "Morgana", + "Moya", + "Muriel", + "Mya", + "Myfanwy", + "Myla", + "Myra", + "Myrna", + "Nadene", + "Nadia", + "Nadine", + "Naja", + "Nala", + "Nana", + "Nancy", + "Nanette", + "Naomi", + "Natalia", + "Natalie", + "Natasha", + "Naya", + "Nayeli", + "Nell", + "Nellie", + "Nelly", + "Nena", + "Nerissa", + "Nessa", + "Nevaeh", + "Neve", + "Nia", + "Niamh", + "Nichola", + "Nichole", + "Nicki", + "Nicky", + "Nicola", + "Nicole", + "Nicolette", + "Nieve", + "Niki", + "Nikita", + "Nikki", + "Nila", + "Nina", + "Nishka", + "Noelle", + "Nola", + "Nora", + "Norah", + "Noreen", + "Norma", + "Nova", + "Nyla", + "Oasis", + "Ocean", + "Octavia", + "Odalis", + "Odele", + "Odelia", + "Odette", + "Olga", + "Olive", + "Olivia", + "Oonagh", + "Opal", + "Ophelia", + "Oriana", + "Orianna", + "Orla", + "Orlaith", + "Page", + "Paige", + "Paisley", + "Paloma", + "Pam", + "Pamela", + "Pandora", + "Pansy", + "Paola", + "Paris", + "Patience", + "Patrice", + "Patricia", + "Patsy", + "Patti", + "Patty", + "Paula", + "Paulette", + "Paulina", + "Pauline", + "Payton", + "Pearl", + "Peggy", + "Penelope", + "Penny", + "Perla", + "Perrie", + "Persephone", + "Petra", + "Petunia", + "Peyton", + "Phillipa", + "Philomena", + "Phoebe", + "Phoenix", + "Phyllis", + "Piper", + "Pippa", + "Pixie", + "Polly", + "Poppy", + "Portia", + "Precious", + "Presley", + "Preslie", + "Primrose", + "Princess", + "Priscilla", + "Priya", + "Promise", + "Prudence", + "Prue", + "Queenie", + "Quiana", + "Quinn", + "Rabia", + "Rachael", + "Rachel", + "Rachelle", + "Rae", + "Raegan", + "Raelyn", + "Raina", + "Raine", + "Ramona", + "Ramsha", + "Randi", + "Rani", + "Rania", + "Raquel", + "Raven", + "Raya", + "Rayna", + "Rayne", + "Reagan", + "Reanna", + "Reanne", + "Rebecca", + "Rebekah", + "Reese", + "Regan", + "Regina", + "Reilly", + "Reina", + "Remi", + "Rena", + "Renata", + "Rene", + "Renee", + "Renesmee", + "Reyna", + "Rhea", + "Rhian", + "Rhianna", + "Rhiannon", + "Rhoda", + "Rhona", + "Rhonda", + "Ria", + "Rianna", + "Ricki", + "Rihanna", + "Rikki", + "Riley", + "Rita", + "River", + "Riya", + "Roanne", + "Roberta", + "Robin", + "Robyn", + "Rochelle", + "Rocio", + "Roisin", + "Rolanda", + "Ronda", + "Roni", + "Rosa", + "Rosalie", + "Rosalind", + "Rosalinda", + "Rosalynn", + "Rosanna", + "Rose", + "Rosella", + "Rosemarie", + "Rosemary", + "Rosetta", + "Rosie", + "Rosy", + "Rowan", + "Rowena", + "Roxana", + "Roxanne", + "Roxie", + "Roxy", + "Rozlynn", + "Ruby", + "Rue", + "Ruth", + "Rydel", + "Rylee", + "Ryleigh", + "Rylie", + "Sabina", + "Sabine", + "Sabrina", + "Sade", + "Sadhbh", + "Sadie", + "Saffron", + "Safire", + "Safiya", + "Sage", + "Sahara", + "Saige", + "Saira", + "Sally", + "Salma", + "Salome", + "Sam", + "Samantha", + "Samara", + "Samia", + "Samira", + "Sammie", + "Sammy", + "Sandra", + "Sandy", + "Saoirse", + "Sapphire", + "Sara", + "Sarah", + "Sarina", + "Sariya", + "Sascha", + "Sasha", + "Saskia", + "Savanna", + "Savannah", + "Scarlet", + "Scarlett", + "Sebastianne", + "Selah", + "Selena", + "Selene", + "Selina", + "Selma", + "Senuri", + "September", + "Seren", + "Serena", + "Serenity", + "Shakira", + "Shana", + "Shania", + "Shannon", + "Shari", + "Sharon", + "Shary", + "Shauna", + "Shawn", + "Shawna", + "Shawnette", + "Shayla", + "Shea", + "Sheena", + "Sheila", + "Shelby", + "Shelia", + "Shelley", + "Shelly", + "Sheri", + "Sheridan", + "Sherri", + "Sherrie", + "Sherry", + "Sheryl", + "Shirley", + "Shivani", + "Shona", + "Shreya", + "Shyla", + "Sian", + "Sidney", + "Sienna", + "Sierra", + "Sigourney", + "Silvia", + "Simone", + "Simran", + "Sinead", + "Siobhan", + "Sky", + "Skye", + "Skylar", + "Skyler", + "Sloane", + "Snow", + "Sofia", + "Sofie", + "Sondra", + "Sonia", + "Sonja", + "Sonya", + "Sophia", + "Sophie", + "Sophy", + "Spring", + "Stacey", + "Staci", + "Stacie", + "Stacy", + "Star", + "Starla", + "Stefanie", + "Stella", + "Steph", + "Stephanie", + "Sue", + "Suki", + "Summer", + "Susan", + "Susanna", + "Susannah", + "Susanne", + "Susie", + "Sutton", + "Suzanna", + "Suzanne", + "Suzette", + "Suzie", + "Suzy", + "Sybil", + "Sydney", + "Sylvia", + "Sylvie", + "Tabatha", + "Tabitha", + "Tahlia", + "Tala", + "Talia", + "Taliyah", + "Tallulah", + "Tamara", + "Tamera", + "Tami", + "Tamia", + "Tamika", + "Tammi", + "Tammie", + "Tammy", + "Tamra", + "Tamsin", + "Tania", + "Tanisha", + "Tanya", + "Tara", + "Taryn", + "Tasha", + "Tasmin", + "Tatiana", + "Tatum", + "Tawana", + "Taya", + "Tayla", + "Taylah", + "Tayler", + "Taylor", + "Teagan", + "Teegan", + "Tegan", + "Tenille", + "Teresa", + "Teri", + "Terri", + "Terrie", + "Terry", + "Tess", + "Tessa", + "Thalia", + "Thea", + "Thelma", + "Theodora", + "Theresa", + "Therese", + "Thomasina", + "Tia", + "Tiana", + "Tiegan", + "Tiffany", + "Tilly", + "Tina", + "Toni", + "Tonia", + "Tonya", + "Tori", + "Tracey", + "Traci", + "Tracie", + "Tracy", + "Tricia", + "Trina", + "Trinity", + "Trish", + "Trisha", + "Trista", + "Trixie", + "Trixy", + "Trudy", + "Tula", + "Tyra", + "Ulrica", + "Uma", + "Una", + "Ursula", + "Valarie", + "Valentina", + "Valeria", + "Valerie", + "Vanessa", + "Veda", + "Velma", + "Venetia", + "Venus", + "Vera", + "Verity", + "Veronica", + "Vicki", + "Vickie", + "Vicky", + "Victoria", + "Vienna", + "Viola", + "Violet", + "Violetta", + "Virginia", + "Vivian", + "Viviana", + "Vivien", + "Vivienne", + "Wallis", + "Wanda", + "Waverley", + "Wendi", + "Wendy", + "Whitney", + "Wilhelmina", + "Willa", + "Willow", + "Wilma", + "Winnie", + "Winnifred", + "Winona", + "Winter", + "Xandra", + "Xanthe", + "Xaviera", + "Xena", + "Xia", + "Ximena", + "Xochil", + "Xochitl", + "Yasmin", + "Yasmine", + "Yazmin", + "Yelena", + "Yesenia", + "Yolanda", + "Ysabel", + "Yulissa", + "Yvaine", + "Yvette", + "Yvonne", + "Zada", + "Zaheera", + "Zahra", + "Zaira", + "Zakia", + "Zali", + "Zara", + "Zaria", + "Zaya", + "Zayla", + "Zelda", + "Zelida", + "Zelina", + "Zena", + "Zendaya", + "Zia", + "Zina", + "Ziva", + "Zoe", + "Zoey", + "Zola", + "Zora", + "Zoya", + "Zula", + "Zuri", + "Zyana" +].map(function(name) { + return { + id: name, + name: name + } +}); + diff --git a/example/webpack.config.js b/example/webpack.config.js new file mode 100644 index 0000000..519550d --- /dev/null +++ b/example/webpack.config.js @@ -0,0 +1,16 @@ +module.exports = { + entry: { + './example/bundle': './example/main.js' + }, + output: { + filename: "[name].js" + }, + debug: true, + devtool: '#inline-source-map', + module: { + loaders: [ + { test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader?experimental'} + ] + } +}; + diff --git a/lib/combobox.js b/lib/combobox.js index 17ef867..45a3fc4 100644 --- a/lib/combobox.js +++ b/lib/combobox.js @@ -71,7 +71,7 @@ module.exports = React.createClass({ componentWillReceiveProps: function(newProps) { this.setState({menu: this.makeMenu(newProps.children)}, function() { - if(newProps.children.length) { + if(newProps.children.length && (this.isOpen || document.activeElement === this.refs.input.getDOMNode())) { this.showList(); } else { this.hideList(); diff --git a/package.json b/package.json index 5e94b1a..1530533 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "react-tokeninput", - "version": "0.3.3", + "version": "0.3.4", "description": "Tokeninput component for React", "main": "index.js", "scripts": { - "build": "NODE_ENV=production webpack index.js dist/react-tokeninput.js", - "build-min": "NODE_ENV=production webpack index.js dist/react-tokeninput.min.js --optimize-minimize", - "test": "node_modules/.bin/karma start" + "build": "NODE_ENV=production webpack index.js dist/react-tokeninput.js && NODE_ENV=production webpack index.js dist/react-tokeninput.min.js --optimize-minimize", + "test": "node_modules/.bin/karma start", + "dev": "webpack --watch --config example/webpack.config.js" }, "repository": { "type": "git", @@ -19,8 +19,9 @@ }, "homepage": "https://github.com/instructure/react-tokeninput", "devDependencies": { + "babel-core": "^4.7.16", + "babel-loader": "^4.2.0", "chai": "^1.10.0", - "jsx-loader": "^0.12.1", "karma": "^0.12.24", "karma-chai": "^0.1.0", "karma-chrome-launcher": "^0.1.5", diff --git a/script/dev b/script/dev deleted file mode 100755 index 0b76a30..0000000 --- a/script/dev +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -webpack --watch --devtool inline-source-map From 5b04a2c6b3c220fd2d7349daf723df9cbbbdda9b Mon Sep 17 00:00:00 2001 From: Aaron Shafovaloff Date: Wed, 25 Mar 2015 13:20:50 -0600 Subject: [PATCH 10/62] Update .npmignore --- .npmignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.npmignore b/.npmignore index a14ba69..57f1936 100644 --- a/.npmignore +++ b/.npmignore @@ -2,3 +2,4 @@ example script webpack.config.js test +.travis.yml From 0487f8a064890ada3ae42f2a4beb4b53e86672d3 Mon Sep 17 00:00:00 2001 From: Michael Nomitch Date: Fri, 24 Apr 2015 10:10:49 -0500 Subject: [PATCH 11/62] added showListOnFocus prop --- dist/react-tokeninput.js | 15 +++++++++++++-- dist/react-tokeninput.js.map | 2 +- dist/react-tokeninput.min.js | 2 +- dist/react-tokeninput.min.js.map | 2 +- lib/combobox.js | 11 ++++++++++- lib/main.js | 4 +++- 6 files changed, 29 insertions(+), 7 deletions(-) diff --git a/dist/react-tokeninput.js b/dist/react-tokeninput.js index 9c11a2f..4cd86be 100644 --- a/dist/react-tokeninput.js +++ b/dist/react-tokeninput.js @@ -77,7 +77,8 @@ return /******/ (function(modules) { // webpackBootstrap onSelect: React.PropTypes.func.isRequired, onRemove: React.PropTypes.func.isRequired, selected: React.PropTypes.array.isRequired, - menuContent: React.PropTypes.any + menuContent: React.PropTypes.any, + showListOnFocus: React.PropTypes.bool }, getInitialState: function() { @@ -129,6 +130,7 @@ return /******/ (function(modules) { // webpackBootstrap id: this.props.id, ariaLabel: this.props['combobox-aria-label'], onInput: this.handleInput, + showListOnFocus: this.props.showListOnFocus, onSelect: this.handleSelect, onRemoveLast: this.handleRemoveLast, value: this.state.selectedToken @@ -240,7 +242,8 @@ return /******/ (function(modules) { // webpackBootstrap autocomplete: 'both', onInput: k, onSelect: k, - value: null + value: null, + showListOnFocus: false }; }, @@ -345,6 +348,12 @@ return /******/ (function(modules) { // webpackBootstrap }.bind(this)); }, + handleInputFocus: function() { + if (this.props.showListOnFocus){ + this.showList() + } + }, + handleInputBlur: function() { var focusedAnOption = this.state.focusedIndex != null; if (focusedAnOption) @@ -358,6 +367,7 @@ return /******/ (function(modules) { // webpackBootstrap this.blurTimer = setTimeout(this.hideList, 0); }, + handleOptionFocus: function() { // see `handleOptionBlur` clearTimeout(this.blurTimer); @@ -567,6 +577,7 @@ return /******/ (function(modules) { // webpackBootstrap 'aria-owns': this.state.listId, id: this.props.id, className: 'ic-tokeninput-input', + onFocus: this.handleInputFocus, onChange: this.handleInputChange, onBlur: this.handleInputBlur, onKeyDown: this.handleKeydown, diff --git a/dist/react-tokeninput.js.map b/dist/react-tokeninput.js.map index ae65823..95ef766 100644 --- a/dist/react-tokeninput.js.map +++ b/dist/react-tokeninput.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 7a293cd9a32b2a816802","webpack:///./index.js","webpack:///./lib/main.js","webpack:///./lib/option.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///./lib/combobox.js","webpack:///./lib/token.js","webpack:///./lib/add-class.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,wC;;;;;;;ACtCA,KAAI,UAAU,GAAG,mBAAO,CAAC,CAAY,CAAC;AACtC,WAAU,CAAC,MAAM,GAAG,mBAAO,CAAC,CAAc,CAAC;;AAE3C,OAAM,CAAC,OAAO,GAAG,UAAU;;;;;;;ACH3B,KAAI,KAAK,GAAG,mBAAO,CAAC,CAAO,CAAC,CAAC;AAC7B,KAAI,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,mBAAO,CAAC,CAAY,CAAC,CA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EAAE,WAAW;KACtB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;AACzC,IAAG;;GAED,aAAa,EAAE,SAAS,GAAG,EAAE;KAC3B,IAAI,QAAQ,GAAG,EAAE,CAAC;KAClB,GAAG,GAAG,CAAC,OAAO,KAAK,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;AACtE,IAAG;;GAED,MAAM,EAAE,WAAW;KACjB;OACE,EAAE,CAAC;SACD,SAAS,EAAE,sBAAsB;QAClC;SACC,IAAI,CAAC;WACH,IAAI,EAAE,QAAQ;WACd,OAAO,EAAE,IAAI,CAAC,WAAW;WACzB,SAAS,EAAE,IAAI,CAAC,aAAa;WAC7B,YAAY,EAAE,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI;WAClD,SAAS,EAAE,wBAAwB;WACnC,QAAQ,EAAE,CAAC;UACZ,EAAE,GAAG,CAAC;SACP,IAAI,CAAC,CAAC,SAAS,EAAE,gBAAgB,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;QACrD;MACF;IACF;EACF,CAAC;;;;;;;AC/BF,OAAM,CAAC,OAAO,GAAG,QAAQ,CAAC;;AAE1B,UAAS,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAE;GACjC,IAAI,CAAC,QAAQ,EAAE,OAAO,KAAK,CAAC;GAC5B,IAAI,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,QAAQ,CAAC;GAClD,OAAO,QAAQ,GAAG,GAAG,GAAG,KAAK,CAAC;EAC/B","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TokenInput\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"TokenInput\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 7a293cd9a32b2a816802\n **/","var TokenInput = require('./lib/main')\nTokenInput.Option = require('./lib/option')\n\nmodule.exports = TokenInput\n\n\n\n/** WEBPACK FOOTER **\n ** ./index.js\n **/","var React = require('react');\nvar Combobox = React.createFactory(require('./combobox'));\nvar Token = React.createFactory(require('./token'));\n\nvar ul = React.createFactory('ul');\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n propTypes: {\n onInput: React.PropTypes.func,\n onSelect: React.PropTypes.func.isRequired,\n onRemove: React.PropTypes.func.isRequired,\n selected: React.PropTypes.array.isRequired,\n menuContent: React.PropTypes.any\n },\n\n getInitialState: function() {\n return {\n selectedToken: null\n };\n },\n\n handleClick: function() {\n // TODO: Expand combobox API for focus\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleInput: function(event) {\n this.props.onInput(event);\n },\n\n handleSelect: function(event) {\n this.props.onSelect(event)\n this.setState({\n selectedToken: null\n })\n },\n\n handleRemove: function(value) {\n this.props.onRemove(value);\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleRemoveLast: function() {\n this.props.onRemove(this.props.selected[this.props.selected.length - 1]);\n },\n\n render: function() {\n var tokens = this.props.selected.map(function(token) {\n return (\n Token({\n onRemove: this.handleRemove,\n value: token,\n name: token.name,\n key: token.id})\n )\n }.bind(this))\n\n return ul({className: 'ic-tokens flex', onClick: this.handleClick},\n tokens,\n li({className: 'inline-flex', ref: 'combo-li'},\n Combobox({\n id: this.props.id,\n ariaLabel: this.props['combobox-aria-label'],\n onInput: this.handleInput,\n onSelect: this.handleSelect,\n onRemoveLast: this.handleRemoveLast,\n value: this.state.selectedToken\n },\n this.props.menuContent\n )\n )\n );\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/main.js\n **/","var React = require('react');\nvar addClass = require('./add-class');\nvar div = React.createFactory('div');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n\n /**\n * The value that will be sent to the `onSelect` handler of the\n * parent Combobox.\n */\n value: React.PropTypes.any.isRequired,\n\n /**\n * What value to put into the input element when this option is\n * selected, defaults to its children coerced to a string.\n */\n label: React.PropTypes.string\n },\n\n getDefaultProps: function() {\n return {\n role: 'option',\n tabIndex: '-1',\n className: 'ic-tokeninput-option',\n isSelected: false\n };\n },\n\n render: function() {\n var props = this.props;\n if (props.isSelected) {\n props.className = addClass(props.className, 'ic-tokeninput-selected');\n props.ariaSelected = true;\n }\n return div(props);\n }\n\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/option.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n ** module id = 3\n ** module chunks = 0\n **/","var React = require('react');\nvar guid = 0;\nvar k = function(){};\nvar addClass = require('./add-class');\nvar ComboboxOption = React.createFactory(require('./option'));\n\nvar div = React.createFactory('div');\nvar span = React.createFactory('span');\nvar input = React.createFactory('input');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n /**\n * Called when the combobox receives user input, this is your chance to\n * filter the data and rerender the options.\n *\n * Signature:\n *\n * ```js\n * function(userInput){}\n * ```\n */\n onInput: React.PropTypes.func,\n\n /**\n * Called when the combobox receives a selection. You probably want to reset\n * the options to the full list at this point.\n *\n * Signature:\n *\n * ```js\n * function(selectedValue){}\n * ```\n */\n onSelect: React.PropTypes.func\n },\n\n getDefaultProps: function() {\n return {\n autocomplete: 'both',\n onInput: k,\n onSelect: k,\n value: null\n };\n },\n\n getInitialState: function() {\n return {\n value: this.props.value,\n // the value displayed in the input\n inputValue: this.findInitialInputValue(),\n isOpen: false,\n focusedIndex: null,\n matchedAutocompleteOption: null,\n // this prevents crazy jumpiness since we focus options on mouseenter\n usingKeyboard: false,\n activedescendant: null,\n listId: 'ic-tokeninput-list-'+(++guid),\n menu: {\n children: [],\n activedescendant: null,\n isEmpty: true\n }\n };\n },\n\n componentWillMount: function() {\n this.setState({menu: this.makeMenu()});\n },\n\n componentWillReceiveProps: function(newProps) {\n this.setState({menu: this.makeMenu(newProps.children)}, function() {\n if(newProps.children.length && (this.isOpen || document.activeElement === this.refs.input.getDOMNode())) {\n this.showList();\n } else {\n this.hideList();\n }\n\n }.bind(this));\n },\n\n /**\n * We don't create the components, the user supplies them,\n * so before rendering we attach handlers to facilitate communication from\n * the ComboboxOption to the Combobox.\n */\n makeMenu: function(children) {\n var activedescendant;\n var isEmpty = true;\n children = children || this.props.children;\n\n // Should this instead use React.addons.cloneWithProps or React.cloneElement?\n React.Children.forEach(children, function(child, index) {\n if (child.type !== ComboboxOption.type)\n // allow random elements to live in this list\n return;\n isEmpty = false;\n // TODO: cloneWithProps and map instead of altering the children in-place\n var props = child.props;\n if (this.state.value === props.value) {\n // need an ID for WAI-ARIA\n props.id = props.id || 'ic-tokeninput-selected-'+(++guid);\n props.isSelected = true\n activedescendant = props.id;\n }\n props.onBlur = this.handleOptionBlur;\n props.onClick = this.selectOption.bind(this, child);\n props.onFocus = this.handleOptionFocus;\n props.onKeyDown = this.handleOptionKeyDown.bind(this, child);\n props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index);\n }.bind(this));\n\n return {\n children: children,\n activedescendant: activedescendant,\n isEmpty: isEmpty\n };\n },\n\n getClassName: function() {\n var className = addClass(this.props.className, 'ic-tokeninput');\n if (this.state.isOpen)\n className = addClass(className, 'ic-tokeninput-is-open');\n return className;\n },\n\n /**\n * When the user begins typing again we need to clear out any state that has\n * to do with an existing or potential selection.\n */\n clearSelectedState: function(cb) {\n this.setState({\n focusedIndex: null,\n inputValue: null,\n value: null,\n matchedAutocompleteOption: null,\n activedescendant: null\n }, cb);\n },\n\n handleInputChange: function(event) {\n var value = this.refs.input.getDOMNode().value;\n this.clearSelectedState(function() {\n this.props.onInput(value);\n }.bind(this));\n },\n\n handleInputBlur: function() {\n var focusedAnOption = this.state.focusedIndex != null;\n if (focusedAnOption)\n return;\n this.maybeSelectAutocompletedOption();\n this.hideList();\n },\n\n handleOptionBlur: function() {\n // don't want to hide the list if we focused another option\n this.blurTimer = setTimeout(this.hideList, 0);\n },\n\n handleOptionFocus: function() {\n // see `handleOptionBlur`\n clearTimeout(this.blurTimer);\n },\n\n handleInputKeyUp: function(event) {\n if (\n this.state.menu.isEmpty ||\n // autocompleting while backspacing feels super weird, so let's not\n event.keyCode === 8 /*backspace*/ ||\n !this.props.autocomplete.match(/both|inline/)\n ) return;\n },\n\n handleButtonClick: function() {\n this.state.isOpen ? this.hideList() : this.showList();\n this.focusInput();\n },\n\n showList: function() {\n if(!this.state.menu.children.length) {\n return\n }\n this.setState({isOpen: true})\n },\n\n hideList: function() {\n this.setState({isOpen: false});\n },\n\n hideOnEscape: function(event) {\n this.hideList();\n this.focusInput();\n event.preventDefault();\n },\n\n focusInput: function() {\n this.refs.input.getDOMNode().focus();\n },\n\n selectInput: function() {\n this.refs.input.getDOMNode().select();\n },\n\n inputKeydownMap: {\n 8: 'removeLastToken',\n 13: 'selectOnEnter',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n optionKeydownMap: {\n 13: 'selectOption',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n handleKeydown: function(event) {\n var handlerName = this.inputKeydownMap[event.keyCode];\n if (!handlerName)\n return\n this.setState({usingKeyboard: true});\n return this[handlerName].call(this,event);\n },\n\n handleOptionKeyDown: function(child, event) {\n var handlerName = this.optionKeydownMap[event.keyCode];\n if (!handlerName) {\n // if the user starts typing again while focused on an option, move focus\n // to the inpute, select so it wipes out any existing value\n this.selectInput();\n return;\n }\n event.preventDefault();\n this.setState({usingKeyboard: true});\n this[handlerName].call(this, child);\n },\n\n handleOptionMouseEnter: function(index) {\n if (this.state.usingKeyboard)\n this.setState({usingKeyboard: false});\n else\n this.focusOptionAtIndex(index);\n },\n\n selectOnEnter: function(event) {\n event.preventDefault();\n this.maybeSelectAutocompletedOption()\n },\n\n maybeSelectAutocompletedOption: function() {\n if (!this.state.matchedAutocompleteOption) {\n this.selectText()\n } else {\n this.selectOption(this.state.matchedAutocompleteOption, {focus: false});\n }\n },\n\n selectOption: function(child, options) {\n options = options || {};\n this.setState({\n // value: child.props.value,\n // inputValue: getLabel(child),\n matchedAutocompleteOption: null\n }, function() {\n this.props.onSelect(child.props.value, child);\n this.hideList();\n this.clearSelectedState(); // added\n if (options.focus !== false)\n this.selectInput();\n }.bind(this));\n this.refs.input.getDOMNode().value = '' // added\n },\n\n selectText: function() {\n var value = this.refs.input.getDOMNode().value;\n if(!value) return;\n this.props.onSelect(value);\n this.clearSelectedState();\n this.refs.input.getDOMNode().value = '' // added\n },\n\n focusNext: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var index = this.state.focusedIndex == null ?\n 0 : this.state.focusedIndex + 1;\n this.focusOptionAtIndex(index);\n },\n\n removeLastToken: function() {\n if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) {\n this.props.onRemoveLast()\n }\n return true\n },\n\n focusPrevious: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var last = this.props.children.length - 1;\n var index = this.state.focusedIndex == null ?\n last : this.state.focusedIndex - 1;\n this.focusOptionAtIndex(index);\n },\n\n focusSelectedOption: function() {\n var selectedIndex;\n React.Children.forEach(this.props.children, function(child, index) {\n if (child.props.value === this.state.value)\n selectedIndex = index;\n }.bind(this));\n this.showList();\n this.setState({\n focusedIndex: selectedIndex\n }, this.focusOption);\n },\n\n findInitialInputValue: function() {\n // TODO: might not need this, we should know this in `makeMenu`\n var inputValue;\n React.Children.forEach(this.props.children, function(child) {\n if (child.props.value === this.props.value)\n inputValue = getLabel(child);\n }.bind(this));\n return inputValue;\n },\n\n focusOptionAtIndex: function(index) {\n if (!this.state.isOpen && this.state.value)\n return this.focusSelectedOption();\n this.showList();\n var length = this.props.children.length;\n if (index === -1)\n index = length - 1;\n else if (index === length)\n index = 0;\n this.setState({\n focusedIndex: index\n }, this.focusOption);\n },\n\n focusOption: function() {\n var index = this.state.focusedIndex;\n this.refs.list.getDOMNode().childNodes[index].focus();\n },\n\n render: function() {\n var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' +\n 'Press the down arrow to navigate results. If you don\\'t find an ' +\n 'acceptable option, you can enter an alternative.'\n\n return div({className: this.getClassName()},\n this.props.value,\n this.state.inputValue,\n input({\n ref: 'input',\n autoComplete: 'off',\n spellCheck: 'false',\n 'aria-label': ariaLabel,\n 'aria-expanded': this.state.isOpen+'',\n 'aria-haspopup': 'true',\n 'aria-activedescendant': this.state.menu.activedescendant,\n 'aria-autocomplete': 'list',\n 'aria-owns': this.state.listId,\n id: this.props.id,\n className: 'ic-tokeninput-input',\n onChange: this.handleInputChange,\n onBlur: this.handleInputBlur,\n onKeyDown: this.handleKeydown,\n onKeyUp: this.handleInputKeyUp,\n role: 'combobox'\n }),\n span({\n 'aria-hidden': 'true',\n className: 'ic-tokeninput-button',\n onClick: this.handleButtonClick\n }, '▾'),\n div({\n id: this.state.listId,\n ref: 'list',\n className: 'ic-tokeninput-list',\n role: 'listbox'\n }, this.state.menu.children)\n );\n }\n});\n\nfunction getLabel(component) {\n return component.props.label || component.props.children;\n}\n\nfunction matchFragment(userInput, firstChildLabel) {\n userInput = userInput.toLowerCase();\n firstChildLabel = firstChildLabel.toLowerCase();\n if (userInput === '' || userInput === firstChildLabel)\n return false;\n if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1)\n return false;\n return true;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/combobox.js\n **/","var React = require('react');\nvar span = React.DOM.span;\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n handleClick: function() {\n this.props.onRemove(this.props.value)\n },\n\n handleKeyDown: function(key) {\n var enterKey = 13;\n if(key.keyCode === enterKey) this.props.onRemove(this.props.value)\n },\n\n render: function() {\n return (\n li({\n className: \"ic-token inline-flex\"\n },\n span({\n role: 'button',\n onClick: this.handleClick,\n onKeyDown: this.handleKeyDown,\n 'aria-label': 'Remove \\'' + this.props.name + '\\'',\n className: \"ic-token-delete-button\",\n tabIndex: 0\n }, \"✕\"),\n span({className: \"ic-token-label\"}, this.props.name)\n )\n )\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/token.js\n **/","module.exports = addClass;\n\nfunction addClass(existing, added) {\n if (!existing) return added;\n if (existing.indexOf(added) > -1) return existing;\n return existing + ' ' + added;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/add-class.js\n **/"],"sourceRoot":"","file":"react-tokeninput.js"} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 174075feb8b4dabd9215","webpack:///./index.js","webpack:///./lib/main.js","webpack:///./lib/option.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///./lib/combobox.js","webpack:///./lib/token.js","webpack:///./lib/add-class.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACtCA,KAAI,UAAU,GAAG,mBAAO,CAAC,CAAY,CAAC;AACtC,WAAU,CAAC,MAAM,GAAG,mBAAO,CAAC,CAAc,CAAC;;AAE3C,OAAM,CAAC,OAAO,GAAG,UAAU;;;;;;;ACH3B,KAAI,KAAK,GAAG,mBAAO,CAAC,CAAO,CAAC,CAAC;AAC7B,KAAI,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,mBAAO,CAAC,CAAY,CAAC,CAAC,CAAC;AAC1D,KAAI,KAAK,GAAG,KAAK,CAAC,aAAa,CAAC,mBAAO,CAAC,CAAS,CAAC,CAAC,CAAC;;AAEpD,KAAI,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;AACnC,KAAI,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;;AAEnC,qCAAoC;GAClC,SAAS,EAAE;KACT,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI;KAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU;KACzC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU;KACzC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU;KAC1C,WAAW,EAAE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E,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;AACtE,IAAG;;GAED,MAAM,EAAE,WAAW;KACjB;OACE,EAAE,CAAC;SACD,SAAS,EAAE,sBAAsB;QAClC;SACC,IAAI,CAAC;WACH,IAAI,EAAE,QAAQ;WACd,OAAO,EAAE,IAAI,CAAC,WAAW;WACzB,SAAS,EAAE,IAAI,CAAC,aAAa;WAC7B,YAAY,EAAE,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI;WAClD,SAAS,EAAE,wBAAwB;WACnC,QAAQ,EAAE,CAAC;UACZ,EAAE,GAAG,CAAC;SACP,IAAI,CAAC,CAAC,SAAS,EAAE,gBAAgB,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;QACrD;MACF;IACF;EACF,CAAC;;;;;;;AC/BF,OAAM,CAAC,OAAO,GAAG,QAAQ,CAAC;;AAE1B,UAAS,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAE;GACjC,IAAI,CAAC,QAAQ,EAAE,OAAO,KAAK,CAAC;GAC5B,IAAI,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,QAAQ,CAAC;GAClD,OAAO,QAAQ,GAAG,GAAG,GAAG,KAAK,CAAC;EAC/B","file":"react-tokeninput.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TokenInput\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"TokenInput\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 174075feb8b4dabd9215\n **/","var TokenInput = require('./lib/main')\nTokenInput.Option = require('./lib/option')\n\nmodule.exports = TokenInput\n\n\n\n/** WEBPACK FOOTER **\n ** ./index.js\n **/","var React = require('react');\nvar Combobox = React.createFactory(require('./combobox'));\nvar Token = React.createFactory(require('./token'));\n\nvar ul = React.createFactory('ul');\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n propTypes: {\n onInput: React.PropTypes.func,\n onSelect: React.PropTypes.func.isRequired,\n onRemove: React.PropTypes.func.isRequired,\n selected: React.PropTypes.array.isRequired,\n menuContent: React.PropTypes.any,\n showListOnFocus: React.PropTypes.bool\n },\n\n getInitialState: function() {\n return {\n selectedToken: null\n };\n },\n\n handleClick: function() {\n // TODO: Expand combobox API for focus\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleInput: function(event) {\n this.props.onInput(event);\n },\n\n handleSelect: function(event) {\n this.props.onSelect(event)\n this.setState({\n selectedToken: null\n })\n },\n\n handleRemove: function(value) {\n this.props.onRemove(value);\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleRemoveLast: function() {\n this.props.onRemove(this.props.selected[this.props.selected.length - 1]);\n },\n\n render: function() {\n var tokens = this.props.selected.map(function(token) {\n return (\n Token({\n onRemove: this.handleRemove,\n value: token,\n name: token.name,\n key: token.id})\n )\n }.bind(this))\n\n return ul({className: 'ic-tokens flex', onClick: this.handleClick},\n tokens,\n li({className: 'inline-flex', ref: 'combo-li'},\n Combobox({\n id: this.props.id,\n ariaLabel: this.props['combobox-aria-label'],\n onInput: this.handleInput,\n showListOnFocus: this.props.showListOnFocus,\n onSelect: this.handleSelect,\n onRemoveLast: this.handleRemoveLast,\n value: this.state.selectedToken\n },\n this.props.menuContent\n )\n )\n );\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/main.js\n **/","var React = require('react');\nvar addClass = require('./add-class');\nvar div = React.createFactory('div');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n\n /**\n * The value that will be sent to the `onSelect` handler of the\n * parent Combobox.\n */\n value: React.PropTypes.any.isRequired,\n\n /**\n * What value to put into the input element when this option is\n * selected, defaults to its children coerced to a string.\n */\n label: React.PropTypes.string\n },\n\n getDefaultProps: function() {\n return {\n role: 'option',\n tabIndex: '-1',\n className: 'ic-tokeninput-option',\n isSelected: false\n };\n },\n\n render: function() {\n var props = this.props;\n if (props.isSelected) {\n props.className = addClass(props.className, 'ic-tokeninput-selected');\n props.ariaSelected = true;\n }\n return div(props);\n }\n\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/option.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n ** module id = 3\n ** module chunks = 0\n **/","var React = require('react');\nvar guid = 0;\nvar k = function(){};\nvar addClass = require('./add-class');\nvar ComboboxOption = React.createFactory(require('./option'));\n\nvar div = React.createFactory('div');\nvar span = React.createFactory('span');\nvar input = React.createFactory('input');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n /**\n * Called when the combobox receives user input, this is your chance to\n * filter the data and rerender the options.\n *\n * Signature:\n *\n * ```js\n * function(userInput){}\n * ```\n */\n onInput: React.PropTypes.func,\n\n /**\n * Called when the combobox receives a selection. You probably want to reset\n * the options to the full list at this point.\n *\n * Signature:\n *\n * ```js\n * function(selectedValue){}\n * ```\n */\n onSelect: React.PropTypes.func\n },\n\n getDefaultProps: function() {\n return {\n autocomplete: 'both',\n onInput: k,\n onSelect: k,\n value: null,\n showListOnFocus: false\n };\n },\n\n getInitialState: function() {\n return {\n value: this.props.value,\n // the value displayed in the input\n inputValue: this.findInitialInputValue(),\n isOpen: false,\n focusedIndex: null,\n matchedAutocompleteOption: null,\n // this prevents crazy jumpiness since we focus options on mouseenter\n usingKeyboard: false,\n activedescendant: null,\n listId: 'ic-tokeninput-list-'+(++guid),\n menu: {\n children: [],\n activedescendant: null,\n isEmpty: true\n }\n };\n },\n\n componentWillMount: function() {\n this.setState({menu: this.makeMenu()});\n },\n\n componentWillReceiveProps: function(newProps) {\n this.setState({menu: this.makeMenu(newProps.children)}, function() {\n if(newProps.children.length && (this.isOpen || document.activeElement === this.refs.input.getDOMNode())) {\n this.showList();\n } else {\n this.hideList();\n }\n\n }.bind(this));\n },\n\n /**\n * We don't create the components, the user supplies them,\n * so before rendering we attach handlers to facilitate communication from\n * the ComboboxOption to the Combobox.\n */\n makeMenu: function(children) {\n var activedescendant;\n var isEmpty = true;\n children = children || this.props.children;\n\n // Should this instead use React.addons.cloneWithProps or React.cloneElement?\n React.Children.forEach(children, function(child, index) {\n if (child.type !== ComboboxOption.type)\n // allow random elements to live in this list\n return;\n isEmpty = false;\n // TODO: cloneWithProps and map instead of altering the children in-place\n var props = child.props;\n if (this.state.value === props.value) {\n // need an ID for WAI-ARIA\n props.id = props.id || 'ic-tokeninput-selected-'+(++guid);\n props.isSelected = true\n activedescendant = props.id;\n }\n props.onBlur = this.handleOptionBlur;\n props.onClick = this.selectOption.bind(this, child);\n props.onFocus = this.handleOptionFocus;\n props.onKeyDown = this.handleOptionKeyDown.bind(this, child);\n props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index);\n }.bind(this));\n\n return {\n children: children,\n activedescendant: activedescendant,\n isEmpty: isEmpty\n };\n },\n\n getClassName: function() {\n var className = addClass(this.props.className, 'ic-tokeninput');\n if (this.state.isOpen)\n className = addClass(className, 'ic-tokeninput-is-open');\n return className;\n },\n\n /**\n * When the user begins typing again we need to clear out any state that has\n * to do with an existing or potential selection.\n */\n clearSelectedState: function(cb) {\n this.setState({\n focusedIndex: null,\n inputValue: null,\n value: null,\n matchedAutocompleteOption: null,\n activedescendant: null\n }, cb);\n },\n\n handleInputChange: function(event) {\n var value = this.refs.input.getDOMNode().value;\n this.clearSelectedState(function() {\n this.props.onInput(value);\n }.bind(this));\n },\n\n handleInputFocus: function() {\n if (this.props.showListOnFocus){\n this.showList()\n }\n },\n\n handleInputBlur: function() {\n var focusedAnOption = this.state.focusedIndex != null;\n if (focusedAnOption)\n return;\n this.maybeSelectAutocompletedOption();\n this.hideList();\n },\n\n handleOptionBlur: function() {\n // don't want to hide the list if we focused another option\n this.blurTimer = setTimeout(this.hideList, 0);\n },\n\n\n handleOptionFocus: function() {\n // see `handleOptionBlur`\n clearTimeout(this.blurTimer);\n },\n\n handleInputKeyUp: function(event) {\n if (\n this.state.menu.isEmpty ||\n // autocompleting while backspacing feels super weird, so let's not\n event.keyCode === 8 /*backspace*/ ||\n !this.props.autocomplete.match(/both|inline/)\n ) return;\n },\n\n handleButtonClick: function() {\n this.state.isOpen ? this.hideList() : this.showList();\n this.focusInput();\n },\n\n showList: function() {\n if(!this.state.menu.children.length) {\n return\n }\n this.setState({isOpen: true})\n },\n\n hideList: function() {\n this.setState({isOpen: false});\n },\n\n hideOnEscape: function(event) {\n this.hideList();\n this.focusInput();\n event.preventDefault();\n },\n\n focusInput: function() {\n this.refs.input.getDOMNode().focus();\n },\n\n selectInput: function() {\n this.refs.input.getDOMNode().select();\n },\n\n inputKeydownMap: {\n 8: 'removeLastToken',\n 13: 'selectOnEnter',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n optionKeydownMap: {\n 13: 'selectOption',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n handleKeydown: function(event) {\n var handlerName = this.inputKeydownMap[event.keyCode];\n if (!handlerName)\n return\n this.setState({usingKeyboard: true});\n return this[handlerName].call(this,event);\n },\n\n handleOptionKeyDown: function(child, event) {\n var handlerName = this.optionKeydownMap[event.keyCode];\n if (!handlerName) {\n // if the user starts typing again while focused on an option, move focus\n // to the inpute, select so it wipes out any existing value\n this.selectInput();\n return;\n }\n event.preventDefault();\n this.setState({usingKeyboard: true});\n this[handlerName].call(this, child);\n },\n\n handleOptionMouseEnter: function(index) {\n if (this.state.usingKeyboard)\n this.setState({usingKeyboard: false});\n else\n this.focusOptionAtIndex(index);\n },\n\n selectOnEnter: function(event) {\n event.preventDefault();\n this.maybeSelectAutocompletedOption()\n },\n\n maybeSelectAutocompletedOption: function() {\n if (!this.state.matchedAutocompleteOption) {\n this.selectText()\n } else {\n this.selectOption(this.state.matchedAutocompleteOption, {focus: false});\n }\n },\n\n selectOption: function(child, options) {\n options = options || {};\n this.setState({\n // value: child.props.value,\n // inputValue: getLabel(child),\n matchedAutocompleteOption: null\n }, function() {\n this.props.onSelect(child.props.value, child);\n this.hideList();\n this.clearSelectedState(); // added\n if (options.focus !== false)\n this.selectInput();\n }.bind(this));\n this.refs.input.getDOMNode().value = '' // added\n },\n\n selectText: function() {\n var value = this.refs.input.getDOMNode().value;\n if(!value) return;\n this.props.onSelect(value);\n this.clearSelectedState();\n this.refs.input.getDOMNode().value = '' // added\n },\n\n focusNext: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var index = this.state.focusedIndex == null ?\n 0 : this.state.focusedIndex + 1;\n this.focusOptionAtIndex(index);\n },\n\n removeLastToken: function() {\n if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) {\n this.props.onRemoveLast()\n }\n return true\n },\n\n focusPrevious: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var last = this.props.children.length - 1;\n var index = this.state.focusedIndex == null ?\n last : this.state.focusedIndex - 1;\n this.focusOptionAtIndex(index);\n },\n\n focusSelectedOption: function() {\n var selectedIndex;\n React.Children.forEach(this.props.children, function(child, index) {\n if (child.props.value === this.state.value)\n selectedIndex = index;\n }.bind(this));\n this.showList();\n this.setState({\n focusedIndex: selectedIndex\n }, this.focusOption);\n },\n\n findInitialInputValue: function() {\n // TODO: might not need this, we should know this in `makeMenu`\n var inputValue;\n React.Children.forEach(this.props.children, function(child) {\n if (child.props.value === this.props.value)\n inputValue = getLabel(child);\n }.bind(this));\n return inputValue;\n },\n\n focusOptionAtIndex: function(index) {\n if (!this.state.isOpen && this.state.value)\n return this.focusSelectedOption();\n this.showList();\n var length = this.props.children.length;\n if (index === -1)\n index = length - 1;\n else if (index === length)\n index = 0;\n this.setState({\n focusedIndex: index\n }, this.focusOption);\n },\n\n focusOption: function() {\n var index = this.state.focusedIndex;\n this.refs.list.getDOMNode().childNodes[index].focus();\n },\n\n render: function() {\n var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' +\n 'Press the down arrow to navigate results. If you don\\'t find an ' +\n 'acceptable option, you can enter an alternative.'\n\n return div({className: this.getClassName()},\n this.props.value,\n this.state.inputValue,\n input({\n ref: 'input',\n autoComplete: 'off',\n spellCheck: 'false',\n 'aria-label': ariaLabel,\n 'aria-expanded': this.state.isOpen+'',\n 'aria-haspopup': 'true',\n 'aria-activedescendant': this.state.menu.activedescendant,\n 'aria-autocomplete': 'list',\n 'aria-owns': this.state.listId,\n id: this.props.id,\n className: 'ic-tokeninput-input',\n onFocus: this.handleInputFocus,\n onChange: this.handleInputChange,\n onBlur: this.handleInputBlur,\n onKeyDown: this.handleKeydown,\n onKeyUp: this.handleInputKeyUp,\n role: 'combobox'\n }),\n span({\n 'aria-hidden': 'true',\n className: 'ic-tokeninput-button',\n onClick: this.handleButtonClick\n }, '▾'),\n div({\n id: this.state.listId,\n ref: 'list',\n className: 'ic-tokeninput-list',\n role: 'listbox'\n }, this.state.menu.children)\n );\n }\n});\n\nfunction getLabel(component) {\n return component.props.label || component.props.children;\n}\n\nfunction matchFragment(userInput, firstChildLabel) {\n userInput = userInput.toLowerCase();\n firstChildLabel = firstChildLabel.toLowerCase();\n if (userInput === '' || userInput === firstChildLabel)\n return false;\n if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1)\n return false;\n return true;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/combobox.js\n **/","var React = require('react');\nvar span = React.DOM.span;\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n handleClick: function() {\n this.props.onRemove(this.props.value)\n },\n\n handleKeyDown: function(key) {\n var enterKey = 13;\n if(key.keyCode === enterKey) this.props.onRemove(this.props.value)\n },\n\n render: function() {\n return (\n li({\n className: \"ic-token inline-flex\"\n },\n span({\n role: 'button',\n onClick: this.handleClick,\n onKeyDown: this.handleKeyDown,\n 'aria-label': 'Remove \\'' + this.props.name + '\\'',\n className: \"ic-token-delete-button\",\n tabIndex: 0\n }, \"✕\"),\n span({className: \"ic-token-label\"}, this.props.name)\n )\n )\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/token.js\n **/","module.exports = addClass;\n\nfunction addClass(existing, added) {\n if (!existing) return added;\n if (existing.indexOf(added) > -1) return existing;\n return existing + ' ' + added;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/add-class.js\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/react-tokeninput.min.js b/dist/react-tokeninput.min.js index 855dc74..1022b3e 100644 --- a/dist/react-tokeninput.min.js +++ b/dist/react-tokeninput.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.TokenInput=t(require("react")):e.TokenInput=t(e.React)}(this,function(e){return function(e){function t(i){if(n[i])return n[i].exports;var s=n[i]={exports:{},id:i,loaded:!1};return e[i].call(s.exports,s,s.exports,t),s.loaded=!0,s.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var i=n(1);i.Option=n(2),e.exports=i},function(e,t,n){var i=n(3),s=i.createFactory(n(4)),o=i.createFactory(n(5)),a=i.createFactory("ul"),u=i.createFactory("li");e.exports=i.createClass({displayName:"exports",propTypes:{onInput:i.PropTypes.func,onSelect:i.PropTypes.func.isRequired,onRemove:i.PropTypes.func.isRequired,selected:i.PropTypes.array.isRequired,menuContent:i.PropTypes.any},getInitialState:function(){return{selectedToken:null}},handleClick:function(){this.refs["combo-li"].getDOMNode().querySelector("input").focus()},handleInput:function(e){this.props.onInput(e)},handleSelect:function(e){this.props.onSelect(e),this.setState({selectedToken:null})},handleRemove:function(e){this.props.onRemove(e),this.refs["combo-li"].getDOMNode().querySelector("input").focus()},handleRemoveLast:function(){this.props.onRemove(this.props.selected[this.props.selected.length-1])},render:function(){var e=this.props.selected.map(function(e){return o({onRemove:this.handleRemove,value:e,name:e.name,key:e.id})}.bind(this));return a({className:"ic-tokens flex",onClick:this.handleClick},e,u({className:"inline-flex",ref:"combo-li"},s({id:this.props.id,ariaLabel:this.props["combobox-aria-label"],onInput:this.handleInput,onSelect:this.handleSelect,onRemoveLast:this.handleRemoveLast,value:this.state.selectedToken},this.props.menuContent)))}})},function(e,t,n){var i=n(3),s=n(6),o=i.createFactory("div");e.exports=i.createClass({displayName:"exports",propTypes:{value:i.PropTypes.any.isRequired,label:i.PropTypes.string},getDefaultProps:function(){return{role:"option",tabIndex:"-1",className:"ic-tokeninput-option",isSelected:!1}},render:function(){var e=this.props;return e.isSelected&&(e.className=s(e.className,"ic-tokeninput-selected"),e.ariaSelected=!0),o(e)}})},function(t){t.exports=e},function(e,t,n){function i(e){return e.props.label||e.props.children}var s=n(3),o=0,a=function(){},u=n(6),c=s.createFactory(n(2)),l=s.createFactory("div"),r=s.createFactory("span"),p=s.createFactory("input");e.exports=s.createClass({displayName:"exports",propTypes:{onInput:s.PropTypes.func,onSelect:s.PropTypes.func},getDefaultProps:function(){return{autocomplete:"both",onInput:a,onSelect:a,value:null}},getInitialState:function(){return{value:this.props.value,inputValue:this.findInitialInputValue(),isOpen:!1,focusedIndex:null,matchedAutocompleteOption:null,usingKeyboard:!1,activedescendant:null,listId:"ic-tokeninput-list-"+ ++o,menu:{children:[],activedescendant:null,isEmpty:!0}}},componentWillMount:function(){this.setState({menu:this.makeMenu()})},componentWillReceiveProps:function(e){this.setState({menu:this.makeMenu(e.children)},function(){e.children.length&&(this.isOpen||document.activeElement===this.refs.input.getDOMNode())?this.showList():this.hideList()}.bind(this))},makeMenu:function(e){var t,n=!0;return e=e||this.props.children,s.Children.forEach(e,function(e,i){if(e.type===c.type){n=!1;var s=e.props;this.state.value===s.value&&(s.id=s.id||"ic-tokeninput-selected-"+ ++o,s.isSelected=!0,t=s.id),s.onBlur=this.handleOptionBlur,s.onClick=this.selectOption.bind(this,e),s.onFocus=this.handleOptionFocus,s.onKeyDown=this.handleOptionKeyDown.bind(this,e),s.onMouseEnter=this.handleOptionMouseEnter.bind(this,i)}}.bind(this)),{children:e,activedescendant:t,isEmpty:n}},getClassName:function(){var e=u(this.props.className,"ic-tokeninput");return this.state.isOpen&&(e=u(e,"ic-tokeninput-is-open")),e},clearSelectedState:function(e){this.setState({focusedIndex:null,inputValue:null,value:null,matchedAutocompleteOption:null,activedescendant:null},e)},handleInputChange:function(){var e=this.refs.input.getDOMNode().value;this.clearSelectedState(function(){this.props.onInput(e)}.bind(this))},handleInputBlur:function(){var e=null!=this.state.focusedIndex;e||(this.maybeSelectAutocompletedOption(),this.hideList())},handleOptionBlur:function(){this.blurTimer=setTimeout(this.hideList,0)},handleOptionFocus:function(){clearTimeout(this.blurTimer)},handleInputKeyUp:function(e){this.state.menu.isEmpty||8===e.keyCode||!this.props.autocomplete.match(/both|inline/)},handleButtonClick:function(){this.state.isOpen?this.hideList():this.showList(),this.focusInput()},showList:function(){this.state.menu.children.length&&this.setState({isOpen:!0})},hideList:function(){this.setState({isOpen:!1})},hideOnEscape:function(e){this.hideList(),this.focusInput(),e.preventDefault()},focusInput:function(){this.refs.input.getDOMNode().focus()},selectInput:function(){this.refs.input.getDOMNode().select()},inputKeydownMap:{8:"removeLastToken",13:"selectOnEnter",27:"hideOnEscape",38:"focusPrevious",40:"focusNext"},optionKeydownMap:{13:"selectOption",27:"hideOnEscape",38:"focusPrevious",40:"focusNext"},handleKeydown:function(e){var t=this.inputKeydownMap[e.keyCode];if(t)return this.setState({usingKeyboard:!0}),this[t].call(this,e)},handleOptionKeyDown:function(e,t){var n=this.optionKeydownMap[t.keyCode];return n?(t.preventDefault(),this.setState({usingKeyboard:!0}),void this[n].call(this,e)):void this.selectInput()},handleOptionMouseEnter:function(e){this.state.usingKeyboard?this.setState({usingKeyboard:!1}):this.focusOptionAtIndex(e)},selectOnEnter:function(e){e.preventDefault(),this.maybeSelectAutocompletedOption()},maybeSelectAutocompletedOption:function(){this.state.matchedAutocompleteOption?this.selectOption(this.state.matchedAutocompleteOption,{focus:!1}):this.selectText()},selectOption:function(e,t){t=t||{},this.setState({matchedAutocompleteOption:null},function(){this.props.onSelect(e.props.value,e),this.hideList(),this.clearSelectedState(),t.focus!==!1&&this.selectInput()}.bind(this)),this.refs.input.getDOMNode().value=""},selectText:function(){var e=this.refs.input.getDOMNode().value;e&&(this.props.onSelect(e),this.clearSelectedState(),this.refs.input.getDOMNode().value="")},focusNext:function(e){if(e.preventDefault&&e.preventDefault(),!this.state.menu.isEmpty){var t=null==this.state.focusedIndex?0:this.state.focusedIndex+1;this.focusOptionAtIndex(t)}},removeLastToken:function(){return this.props.onRemoveLast&&!this.refs.input.getDOMNode().value&&this.props.onRemoveLast(),!0},focusPrevious:function(e){if(e.preventDefault&&e.preventDefault(),!this.state.menu.isEmpty){var t=this.props.children.length-1,n=null==this.state.focusedIndex?t:this.state.focusedIndex-1;this.focusOptionAtIndex(n)}},focusSelectedOption:function(){var e;s.Children.forEach(this.props.children,function(t,n){t.props.value===this.state.value&&(e=n)}.bind(this)),this.showList(),this.setState({focusedIndex:e},this.focusOption)},findInitialInputValue:function(){var e;return s.Children.forEach(this.props.children,function(t){t.props.value===this.props.value&&(e=i(t))}.bind(this)),e},focusOptionAtIndex:function(e){if(!this.state.isOpen&&this.state.value)return this.focusSelectedOption();this.showList();var t=this.props.children.length;-1===e?e=t-1:e===t&&(e=0),this.setState({focusedIndex:e},this.focusOption)},focusOption:function(){var e=this.state.focusedIndex;this.refs.list.getDOMNode().childNodes[e].focus()},render:function(){var e=this.props["aria-label"]||"Start typing to search. Press the down arrow to navigate results. If you don't find an acceptable option, you can enter an alternative.";return l({className:this.getClassName()},this.props.value,this.state.inputValue,p({ref:"input",autoComplete:"off",spellCheck:"false","aria-label":e,"aria-expanded":this.state.isOpen+"","aria-haspopup":"true","aria-activedescendant":this.state.menu.activedescendant,"aria-autocomplete":"list","aria-owns":this.state.listId,id:this.props.id,className:"ic-tokeninput-input",onChange:this.handleInputChange,onBlur:this.handleInputBlur,onKeyDown:this.handleKeydown,onKeyUp:this.handleInputKeyUp,role:"combobox"}),r({"aria-hidden":"true",className:"ic-tokeninput-button",onClick:this.handleButtonClick},"▾"),l({id:this.state.listId,ref:"list",className:"ic-tokeninput-list",role:"listbox"},this.state.menu.children))}})},function(e,t,n){var i=n(3),s=i.DOM.span,o=i.createFactory("li");e.exports=i.createClass({displayName:"exports",handleClick:function(){this.props.onRemove(this.props.value)},handleKeyDown:function(e){var t=13;e.keyCode===t&&this.props.onRemove(this.props.value)},render:function(){return o({className:"ic-token inline-flex"},s({role:"button",onClick:this.handleClick,onKeyDown:this.handleKeyDown,"aria-label":"Remove '"+this.props.name+"'",className:"ic-token-delete-button",tabIndex:0},"✕"),s({className:"ic-token-label"},this.props.name))}})},function(e){function t(e,t){return e?e.indexOf(t)>-1?e:e+" "+t:t}e.exports=t}])}); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.TokenInput=t(require("react")):e.TokenInput=t(e.React)}(this,function(e){return function(e){function t(s){if(n[s])return n[s].exports;var i=n[s]={exports:{},id:s,loaded:!1};return e[s].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var s=n(1);s.Option=n(2),e.exports=s},function(e,t,n){var s=n(3),i=s.createFactory(n(4)),o=s.createFactory(n(5)),a=s.createFactory("ul"),u=s.createFactory("li");e.exports=s.createClass({displayName:"exports",propTypes:{onInput:s.PropTypes.func,onSelect:s.PropTypes.func.isRequired,onRemove:s.PropTypes.func.isRequired,selected:s.PropTypes.array.isRequired,menuContent:s.PropTypes.any,showListOnFocus:s.PropTypes.bool},getInitialState:function(){return{selectedToken:null}},handleClick:function(){this.refs["combo-li"].getDOMNode().querySelector("input").focus()},handleInput:function(e){this.props.onInput(e)},handleSelect:function(e){this.props.onSelect(e),this.setState({selectedToken:null})},handleRemove:function(e){this.props.onRemove(e),this.refs["combo-li"].getDOMNode().querySelector("input").focus()},handleRemoveLast:function(){this.props.onRemove(this.props.selected[this.props.selected.length-1])},render:function(){var e=this.props.selected.map(function(e){return o({onRemove:this.handleRemove,value:e,name:e.name,key:e.id})}.bind(this));return a({className:"ic-tokens flex",onClick:this.handleClick},e,u({className:"inline-flex",ref:"combo-li"},i({id:this.props.id,ariaLabel:this.props["combobox-aria-label"],onInput:this.handleInput,showListOnFocus:this.props.showListOnFocus,onSelect:this.handleSelect,onRemoveLast:this.handleRemoveLast,value:this.state.selectedToken},this.props.menuContent)))}})},function(e,t,n){var s=n(3),i=n(6),o=s.createFactory("div");e.exports=s.createClass({displayName:"exports",propTypes:{value:s.PropTypes.any.isRequired,label:s.PropTypes.string},getDefaultProps:function(){return{role:"option",tabIndex:"-1",className:"ic-tokeninput-option",isSelected:!1}},render:function(){var e=this.props;return e.isSelected&&(e.className=i(e.className,"ic-tokeninput-selected"),e.ariaSelected=!0),o(e)}})},function(t,n,s){t.exports=e},function(e,t,n){function s(e){return e.props.label||e.props.children}var i=n(3),o=0,a=function(){},u=n(6),c=i.createFactory(n(2)),l=i.createFactory("div"),r=i.createFactory("span"),p=i.createFactory("input");e.exports=i.createClass({displayName:"exports",propTypes:{onInput:i.PropTypes.func,onSelect:i.PropTypes.func},getDefaultProps:function(){return{autocomplete:"both",onInput:a,onSelect:a,value:null,showListOnFocus:!1}},getInitialState:function(){return{value:this.props.value,inputValue:this.findInitialInputValue(),isOpen:!1,focusedIndex:null,matchedAutocompleteOption:null,usingKeyboard:!1,activedescendant:null,listId:"ic-tokeninput-list-"+ ++o,menu:{children:[],activedescendant:null,isEmpty:!0}}},componentWillMount:function(){this.setState({menu:this.makeMenu()})},componentWillReceiveProps:function(e){this.setState({menu:this.makeMenu(e.children)},function(){e.children.length&&(this.isOpen||document.activeElement===this.refs.input.getDOMNode())?this.showList():this.hideList()}.bind(this))},makeMenu:function(e){var t,n=!0;return e=e||this.props.children,i.Children.forEach(e,function(e,s){if(e.type===c.type){n=!1;var i=e.props;this.state.value===i.value&&(i.id=i.id||"ic-tokeninput-selected-"+ ++o,i.isSelected=!0,t=i.id),i.onBlur=this.handleOptionBlur,i.onClick=this.selectOption.bind(this,e),i.onFocus=this.handleOptionFocus,i.onKeyDown=this.handleOptionKeyDown.bind(this,e),i.onMouseEnter=this.handleOptionMouseEnter.bind(this,s)}}.bind(this)),{children:e,activedescendant:t,isEmpty:n}},getClassName:function(){var e=u(this.props.className,"ic-tokeninput");return this.state.isOpen&&(e=u(e,"ic-tokeninput-is-open")),e},clearSelectedState:function(e){this.setState({focusedIndex:null,inputValue:null,value:null,matchedAutocompleteOption:null,activedescendant:null},e)},handleInputChange:function(e){var t=this.refs.input.getDOMNode().value;this.clearSelectedState(function(){this.props.onInput(t)}.bind(this))},handleInputFocus:function(){this.props.showListOnFocus&&this.showList()},handleInputBlur:function(){var e=null!=this.state.focusedIndex;e||(this.maybeSelectAutocompletedOption(),this.hideList())},handleOptionBlur:function(){this.blurTimer=setTimeout(this.hideList,0)},handleOptionFocus:function(){clearTimeout(this.blurTimer)},handleInputKeyUp:function(e){this.state.menu.isEmpty||8===e.keyCode||!this.props.autocomplete.match(/both|inline/)},handleButtonClick:function(){this.state.isOpen?this.hideList():this.showList(),this.focusInput()},showList:function(){this.state.menu.children.length&&this.setState({isOpen:!0})},hideList:function(){this.setState({isOpen:!1})},hideOnEscape:function(e){this.hideList(),this.focusInput(),e.preventDefault()},focusInput:function(){this.refs.input.getDOMNode().focus()},selectInput:function(){this.refs.input.getDOMNode().select()},inputKeydownMap:{8:"removeLastToken",13:"selectOnEnter",27:"hideOnEscape",38:"focusPrevious",40:"focusNext"},optionKeydownMap:{13:"selectOption",27:"hideOnEscape",38:"focusPrevious",40:"focusNext"},handleKeydown:function(e){var t=this.inputKeydownMap[e.keyCode];if(t)return this.setState({usingKeyboard:!0}),this[t].call(this,e)},handleOptionKeyDown:function(e,t){var n=this.optionKeydownMap[t.keyCode];return n?(t.preventDefault(),this.setState({usingKeyboard:!0}),void this[n].call(this,e)):void this.selectInput()},handleOptionMouseEnter:function(e){this.state.usingKeyboard?this.setState({usingKeyboard:!1}):this.focusOptionAtIndex(e)},selectOnEnter:function(e){e.preventDefault(),this.maybeSelectAutocompletedOption()},maybeSelectAutocompletedOption:function(){this.state.matchedAutocompleteOption?this.selectOption(this.state.matchedAutocompleteOption,{focus:!1}):this.selectText()},selectOption:function(e,t){t=t||{},this.setState({matchedAutocompleteOption:null},function(){this.props.onSelect(e.props.value,e),this.hideList(),this.clearSelectedState(),t.focus!==!1&&this.selectInput()}.bind(this)),this.refs.input.getDOMNode().value=""},selectText:function(){var e=this.refs.input.getDOMNode().value;e&&(this.props.onSelect(e),this.clearSelectedState(),this.refs.input.getDOMNode().value="")},focusNext:function(e){if(e.preventDefault&&e.preventDefault(),!this.state.menu.isEmpty){var t=null==this.state.focusedIndex?0:this.state.focusedIndex+1;this.focusOptionAtIndex(t)}},removeLastToken:function(){return this.props.onRemoveLast&&!this.refs.input.getDOMNode().value&&this.props.onRemoveLast(),!0},focusPrevious:function(e){if(e.preventDefault&&e.preventDefault(),!this.state.menu.isEmpty){var t=this.props.children.length-1,n=null==this.state.focusedIndex?t:this.state.focusedIndex-1;this.focusOptionAtIndex(n)}},focusSelectedOption:function(){var e;i.Children.forEach(this.props.children,function(t,n){t.props.value===this.state.value&&(e=n)}.bind(this)),this.showList(),this.setState({focusedIndex:e},this.focusOption)},findInitialInputValue:function(){var e;return i.Children.forEach(this.props.children,function(t){t.props.value===this.props.value&&(e=s(t))}.bind(this)),e},focusOptionAtIndex:function(e){if(!this.state.isOpen&&this.state.value)return this.focusSelectedOption();this.showList();var t=this.props.children.length;-1===e?e=t-1:e===t&&(e=0),this.setState({focusedIndex:e},this.focusOption)},focusOption:function(){var e=this.state.focusedIndex;this.refs.list.getDOMNode().childNodes[e].focus()},render:function(){var e=this.props["aria-label"]||"Start typing to search. Press the down arrow to navigate results. If you don't find an acceptable option, you can enter an alternative.";return l({className:this.getClassName()},this.props.value,this.state.inputValue,p({ref:"input",autoComplete:"off",spellCheck:"false","aria-label":e,"aria-expanded":this.state.isOpen+"","aria-haspopup":"true","aria-activedescendant":this.state.menu.activedescendant,"aria-autocomplete":"list","aria-owns":this.state.listId,id:this.props.id,className:"ic-tokeninput-input",onFocus:this.handleInputFocus,onChange:this.handleInputChange,onBlur:this.handleInputBlur,onKeyDown:this.handleKeydown,onKeyUp:this.handleInputKeyUp,role:"combobox"}),r({"aria-hidden":"true",className:"ic-tokeninput-button",onClick:this.handleButtonClick},"▾"),l({id:this.state.listId,ref:"list",className:"ic-tokeninput-list",role:"listbox"},this.state.menu.children))}})},function(e,t,n){var s=n(3),i=s.DOM.span,o=s.createFactory("li");e.exports=s.createClass({displayName:"exports",handleClick:function(){this.props.onRemove(this.props.value)},handleKeyDown:function(e){var t=13;e.keyCode===t&&this.props.onRemove(this.props.value)},render:function(){return o({className:"ic-token inline-flex"},i({role:"button",onClick:this.handleClick,onKeyDown:this.handleKeyDown,"aria-label":"Remove '"+this.props.name+"'",className:"ic-token-delete-button",tabIndex:0},"✕"),i({className:"ic-token-label"},this.props.name))}})},function(e,t,n){function s(e,t){return e?e.indexOf(t)>-1?e:e+" "+t:t}e.exports=s}])}); //# sourceMappingURL=react-tokeninput.min.js.map \ No newline at end of file diff --git a/dist/react-tokeninput.min.js.map b/dist/react-tokeninput.min.js.map index ece851d..f3c1e1d 100644 --- a/dist/react-tokeninput.min.js.map +++ b/dist/react-tokeninput.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///react-tokeninput.min.js","webpack:///webpack/bootstrap d565fa7672eea8600b30","webpack:///./index.js","webpack:///./lib/main.js","webpack:///./lib/option.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///./lib/combobox.js","webpack:///./lib/token.js","webpack:///./lib/add-class.js"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_3__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","TokenInput","Option","React","Combobox","createFactory","Token","ul","li","createClass","displayName","propTypes","onInput","PropTypes","func","onSelect","isRequired","onRemove","selected","array","menuContent","any","getInitialState","selectedToken","handleClick","refs","getDOMNode","querySelector","focus","handleInput","event","props","handleSelect","setState","handleRemove","value","handleRemoveLast","length","render","tokens","map","token","name","key","bind","className","onClick","ref","ariaLabel","onRemoveLast","state","addClass","div","label","string","getDefaultProps","role","tabIndex","isSelected","ariaSelected","getLabel","component","children","guid","k","ComboboxOption","span","input","autocomplete","inputValue","findInitialInputValue","isOpen","focusedIndex","matchedAutocompleteOption","usingKeyboard","activedescendant","listId","menu","isEmpty","componentWillMount","makeMenu","componentWillReceiveProps","newProps","document","activeElement","showList","hideList","Children","forEach","child","index","type","onBlur","handleOptionBlur","selectOption","onFocus","handleOptionFocus","onKeyDown","handleOptionKeyDown","onMouseEnter","handleOptionMouseEnter","getClassName","clearSelectedState","cb","handleInputChange","handleInputBlur","focusedAnOption","maybeSelectAutocompletedOption","blurTimer","setTimeout","clearTimeout","handleInputKeyUp","keyCode","match","handleButtonClick","focusInput","hideOnEscape","preventDefault","selectInput","select","inputKeydownMap",8,13,27,38,40,"optionKeydownMap","handleKeydown","handlerName","focusOptionAtIndex","selectOnEnter","selectText","options","focusNext","removeLastToken","focusPrevious","last","focusSelectedOption","selectedIndex","focusOption","list","childNodes","autoComplete","spellCheck","aria-label","aria-expanded","aria-haspopup","aria-activedescendant","aria-autocomplete","aria-owns","onChange","onKeyUp","aria-hidden","DOM","handleKeyDown","enterKey","existing","added","indexOf"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,UACA,kBAAAC,gBAAAC,IACAD,QAAA,SAAAJ,GACA,gBAAAC,SACAA,QAAA,WAAAD,EAAAG,QAAA,UAEAJ,EAAA,WAAAC,EAAAD,EAAA,QACCO,KAAA,SAAAC,GACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAT,OAGA,IAAAC,GAAAS,EAAAD,IACAT,WACAW,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAZ,EAAAD,QAAAC,IAAAD,QAAAQ,GAGAP,EAAAW,QAAA,EAGAX,EAAAD,QAvBA,GAAAU,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,GAGAR,EAAA,KDgBM,SAASP,EAAQD,EAASQ,GEtDhC,GAAIS,GAAaT,EAAQ,EACzBS,G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P0mBjD,SAASzD,GQnoBf,QAASkE,GAASyG,EAAUC,GAC1B,MAAKD,GACDA,EAASE,QAAQD,GAAS,GAAWD,EAClCA,EAAW,IAAMC,EAFFA,EAHxB5K,EAAOD,QAAUmE","file":"react-tokeninput.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TokenInput\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"TokenInput\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TokenInput\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"TokenInput\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n\n\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar TokenInput = __webpack_require__(1)\n\tTokenInput.Option = __webpack_require__(2)\n\n\tmodule.exports = TokenInput\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar Combobox = React.createFactory(__webpack_require__(4));\n\tvar Token = React.createFactory(__webpack_require__(5));\n\n\tvar ul = React.createFactory('ul');\n\tvar li = React.createFactory('li');\n\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\t propTypes: {\n\t onInput: React.PropTypes.func,\n\t onSelect: React.PropTypes.func.isRequired,\n\t onRemove: React.PropTypes.func.isRequired,\n\t selected: React.PropTypes.array.isRequired,\n\t menuContent: React.PropTypes.any\n\t },\n\n\t getInitialState: function() {\n\t return {\n\t selectedToken: null\n\t };\n\t },\n\n\t handleClick: function() {\n\t // TODO: Expand combobox API for focus\n\t this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n\t },\n\n\t handleInput: function(event) {\n\t this.props.onInput(event);\n\t },\n\n\t handleSelect: function(event) {\n\t this.props.onSelect(event)\n\t this.setState({\n\t selectedToken: null\n\t })\n\t },\n\n\t handleRemove: function(value) {\n\t this.props.onRemove(value);\n\t this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n\t },\n\n\t handleRemoveLast: function() {\n\t this.props.onRemove(this.props.selected[this.props.selected.length - 1]);\n\t },\n\n\t render: function() {\n\t var tokens = this.props.selected.map(function(token) {\n\t return (\n\t Token({\n\t onRemove: this.handleRemove,\n\t value: token,\n\t name: token.name,\n\t key: token.id})\n\t )\n\t }.bind(this))\n\n\t return ul({className: 'ic-tokens flex', onClick: this.handleClick},\n\t tokens,\n\t li({className: 'inline-flex', ref: 'combo-li'},\n\t Combobox({\n\t id: this.props.id,\n\t ariaLabel: this.props['combobox-aria-label'],\n\t onInput: this.handleInput,\n\t onSelect: this.handleSelect,\n\t onRemoveLast: this.handleRemoveLast,\n\t value: this.state.selectedToken\n\t },\n\t this.props.menuContent\n\t )\n\t )\n\t );\n\t }\n\t})\n\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar addClass = __webpack_require__(6);\n\tvar div = React.createFactory('div');\n\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\n\t propTypes: {\n\n\t /**\n\t * The value that will be sent to the `onSelect` handler of the\n\t * parent Combobox.\n\t */\n\t value: React.PropTypes.any.isRequired,\n\n\t /**\n\t * What value to put into the input element when this option is\n\t * selected, defaults to its children coerced to a string.\n\t */\n\t label: React.PropTypes.string\n\t },\n\n\t getDefaultProps: function() {\n\t return {\n\t role: 'option',\n\t tabIndex: '-1',\n\t className: 'ic-tokeninput-option',\n\t isSelected: false\n\t };\n\t },\n\n\t render: function() {\n\t var props = this.props;\n\t if (props.isSelected) {\n\t props.className = addClass(props.className, 'ic-tokeninput-selected');\n\t props.ariaSelected = true;\n\t }\n\t return div(props);\n\t }\n\n\t});\n\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar guid = 0;\n\tvar k = function(){};\n\tvar addClass = __webpack_require__(6);\n\tvar ComboboxOption = React.createFactory(__webpack_require__(2));\n\n\tvar div = React.createFactory('div');\n\tvar span = React.createFactory('span');\n\tvar input = React.createFactory('input');\n\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\n\t propTypes: {\n\t /**\n\t * Called when the combobox receives user input, this is your chance to\n\t * filter the data and rerender the options.\n\t *\n\t * Signature:\n\t *\n\t * ```js\n\t * function(userInput){}\n\t * ```\n\t */\n\t onInput: React.PropTypes.func,\n\n\t /**\n\t * Called when the combobox receives a selection. You probably want to reset\n\t * the options to the full list at this point.\n\t *\n\t * Signature:\n\t *\n\t * ```js\n\t * function(selectedValue){}\n\t * ```\n\t */\n\t onSelect: React.PropTypes.func\n\t },\n\n\t getDefaultProps: function() {\n\t return {\n\t autocomplete: 'both',\n\t onInput: k,\n\t onSelect: k,\n\t value: null\n\t };\n\t },\n\n\t getInitialState: function() {\n\t return {\n\t value: this.props.value,\n\t // the value displayed in the input\n\t inputValue: this.findInitialInputValue(),\n\t isOpen: false,\n\t focusedIndex: null,\n\t matchedAutocompleteOption: null,\n\t // this prevents crazy jumpiness since we focus options on mouseenter\n\t usingKeyboard: false,\n\t activedescendant: null,\n\t listId: 'ic-tokeninput-list-'+(++guid),\n\t menu: {\n\t children: [],\n\t activedescendant: null,\n\t isEmpty: true\n\t }\n\t };\n\t },\n\n\t componentWillMount: function() {\n\t this.setState({menu: this.makeMenu()});\n\t },\n\n\t componentWillReceiveProps: function(newProps) {\n\t this.setState({menu: this.makeMenu(newProps.children)}, function() {\n\t if(newProps.children.length && (this.isOpen || document.activeElement === this.refs.input.getDOMNode())) {\n\t this.showList();\n\t } else {\n\t this.hideList();\n\t }\n\n\t }.bind(this));\n\t },\n\n\t /**\n\t * We don't create the components, the user supplies them,\n\t * so before rendering we attach handlers to facilitate communication from\n\t * the ComboboxOption to the Combobox.\n\t */\n\t makeMenu: function(children) {\n\t var activedescendant;\n\t var isEmpty = true;\n\t children = children || this.props.children;\n\n\t // Should this instead use React.addons.cloneWithProps or React.cloneElement?\n\t React.Children.forEach(children, function(child, index) {\n\t if (child.type !== ComboboxOption.type)\n\t // allow random elements to live in this list\n\t return;\n\t isEmpty = false;\n\t // TODO: cloneWithProps and map instead of altering the children in-place\n\t var props = child.props;\n\t if (this.state.value === props.value) {\n\t // need an ID for WAI-ARIA\n\t props.id = props.id || 'ic-tokeninput-selected-'+(++guid);\n\t props.isSelected = true\n\t activedescendant = props.id;\n\t }\n\t props.onBlur = this.handleOptionBlur;\n\t props.onClick = this.selectOption.bind(this, child);\n\t props.onFocus = this.handleOptionFocus;\n\t props.onKeyDown = this.handleOptionKeyDown.bind(this, child);\n\t props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index);\n\t }.bind(this));\n\n\t return {\n\t children: children,\n\t activedescendant: activedescendant,\n\t isEmpty: isEmpty\n\t };\n\t },\n\n\t getClassName: function() {\n\t var className = addClass(this.props.className, 'ic-tokeninput');\n\t if (this.state.isOpen)\n\t className = addClass(className, 'ic-tokeninput-is-open');\n\t return className;\n\t },\n\n\t /**\n\t * When the user begins typing again we need to clear out any state that has\n\t * to do with an existing or potential selection.\n\t */\n\t clearSelectedState: function(cb) {\n\t this.setState({\n\t focusedIndex: null,\n\t inputValue: null,\n\t value: null,\n\t matchedAutocompleteOption: null,\n\t activedescendant: null\n\t }, cb);\n\t },\n\n\t handleInputChange: function(event) {\n\t var value = this.refs.input.getDOMNode().value;\n\t this.clearSelectedState(function() {\n\t this.props.onInput(value);\n\t }.bind(this));\n\t },\n\n\t handleInputBlur: function() {\n\t var focusedAnOption = this.state.focusedIndex != null;\n\t if (focusedAnOption)\n\t return;\n\t this.maybeSelectAutocompletedOption();\n\t this.hideList();\n\t },\n\n\t handleOptionBlur: function() {\n\t // don't want to hide the list if we focused another option\n\t this.blurTimer = setTimeout(this.hideList, 0);\n\t },\n\n\t handleOptionFocus: function() {\n\t // see `handleOptionBlur`\n\t clearTimeout(this.blurTimer);\n\t },\n\n\t handleInputKeyUp: function(event) {\n\t if (\n\t this.state.menu.isEmpty ||\n\t // autocompleting while backspacing feels super weird, so let's not\n\t event.keyCode === 8 /*backspace*/ ||\n\t !this.props.autocomplete.match(/both|inline/)\n\t ) return;\n\t },\n\n\t handleButtonClick: function() {\n\t this.state.isOpen ? this.hideList() : this.showList();\n\t this.focusInput();\n\t },\n\n\t showList: function() {\n\t if(!this.state.menu.children.length) {\n\t return\n\t }\n\t this.setState({isOpen: true})\n\t },\n\n\t hideList: function() {\n\t this.setState({isOpen: false});\n\t },\n\n\t hideOnEscape: function(event) {\n\t this.hideList();\n\t this.focusInput();\n\t event.preventDefault();\n\t },\n\n\t focusInput: function() {\n\t this.refs.input.getDOMNode().focus();\n\t },\n\n\t selectInput: function() {\n\t this.refs.input.getDOMNode().select();\n\t },\n\n\t inputKeydownMap: {\n\t 8: 'removeLastToken',\n\t 13: 'selectOnEnter',\n\t 27: 'hideOnEscape',\n\t 38: 'focusPrevious',\n\t 40: 'focusNext'\n\t },\n\n\t optionKeydownMap: {\n\t 13: 'selectOption',\n\t 27: 'hideOnEscape',\n\t 38: 'focusPrevious',\n\t 40: 'focusNext'\n\t },\n\n\t handleKeydown: function(event) {\n\t var handlerName = this.inputKeydownMap[event.keyCode];\n\t if (!handlerName)\n\t return\n\t this.setState({usingKeyboard: true});\n\t return this[handlerName].call(this,event);\n\t },\n\n\t handleOptionKeyDown: function(child, event) {\n\t var handlerName = this.optionKeydownMap[event.keyCode];\n\t if (!handlerName) {\n\t // if the user starts typing again while focused on an option, move focus\n\t // to the inpute, select so it wipes out any existing value\n\t this.selectInput();\n\t return;\n\t }\n\t event.preventDefault();\n\t this.setState({usingKeyboard: true});\n\t this[handlerName].call(this, child);\n\t },\n\n\t handleOptionMouseEnter: function(index) {\n\t if (this.state.usingKeyboard)\n\t this.setState({usingKeyboard: false});\n\t else\n\t this.focusOptionAtIndex(index);\n\t },\n\n\t selectOnEnter: function(event) {\n\t event.preventDefault();\n\t this.maybeSelectAutocompletedOption()\n\t },\n\n\t maybeSelectAutocompletedOption: function() {\n\t if (!this.state.matchedAutocompleteOption) {\n\t this.selectText()\n\t } else {\n\t this.selectOption(this.state.matchedAutocompleteOption, {focus: false});\n\t }\n\t },\n\n\t selectOption: function(child, options) {\n\t options = options || {};\n\t this.setState({\n\t // value: child.props.value,\n\t // inputValue: getLabel(child),\n\t matchedAutocompleteOption: null\n\t }, function() {\n\t this.props.onSelect(child.props.value, child);\n\t this.hideList();\n\t this.clearSelectedState(); // added\n\t if (options.focus !== false)\n\t this.selectInput();\n\t }.bind(this));\n\t this.refs.input.getDOMNode().value = '' // added\n\t },\n\n\t selectText: function() {\n\t var value = this.refs.input.getDOMNode().value;\n\t if(!value) return;\n\t this.props.onSelect(value);\n\t this.clearSelectedState();\n\t this.refs.input.getDOMNode().value = '' // added\n\t },\n\n\t focusNext: function(event) {\n\t if(event.preventDefault) event.preventDefault();\n\t if (this.state.menu.isEmpty) return;\n\t var index = this.state.focusedIndex == null ?\n\t 0 : this.state.focusedIndex + 1;\n\t this.focusOptionAtIndex(index);\n\t },\n\n\t removeLastToken: function() {\n\t if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) {\n\t this.props.onRemoveLast()\n\t }\n\t return true\n\t },\n\n\t focusPrevious: function(event) {\n\t if(event.preventDefault) event.preventDefault();\n\t if (this.state.menu.isEmpty) return;\n\t var last = this.props.children.length - 1;\n\t var index = this.state.focusedIndex == null ?\n\t last : this.state.focusedIndex - 1;\n\t this.focusOptionAtIndex(index);\n\t },\n\n\t focusSelectedOption: function() {\n\t var selectedIndex;\n\t React.Children.forEach(this.props.children, function(child, index) {\n\t if (child.props.value === this.state.value)\n\t selectedIndex = index;\n\t }.bind(this));\n\t this.showList();\n\t this.setState({\n\t focusedIndex: selectedIndex\n\t }, this.focusOption);\n\t },\n\n\t findInitialInputValue: function() {\n\t // TODO: might not need this, we should know this in `makeMenu`\n\t var inputValue;\n\t React.Children.forEach(this.props.children, function(child) {\n\t if (child.props.value === this.props.value)\n\t inputValue = getLabel(child);\n\t }.bind(this));\n\t return inputValue;\n\t },\n\n\t focusOptionAtIndex: function(index) {\n\t if (!this.state.isOpen && this.state.value)\n\t return this.focusSelectedOption();\n\t this.showList();\n\t var length = this.props.children.length;\n\t if (index === -1)\n\t index = length - 1;\n\t else if (index === length)\n\t index = 0;\n\t this.setState({\n\t focusedIndex: index\n\t }, this.focusOption);\n\t },\n\n\t focusOption: function() {\n\t var index = this.state.focusedIndex;\n\t this.refs.list.getDOMNode().childNodes[index].focus();\n\t },\n\n\t render: function() {\n\t var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' +\n\t 'Press the down arrow to navigate results. If you don\\'t find an ' +\n\t 'acceptable option, you can enter an alternative.'\n\n\t return div({className: this.getClassName()},\n\t this.props.value,\n\t this.state.inputValue,\n\t input({\n\t ref: 'input',\n\t autoComplete: 'off',\n\t spellCheck: 'false',\n\t 'aria-label': ariaLabel,\n\t 'aria-expanded': this.state.isOpen+'',\n\t 'aria-haspopup': 'true',\n\t 'aria-activedescendant': this.state.menu.activedescendant,\n\t 'aria-autocomplete': 'list',\n\t 'aria-owns': this.state.listId,\n\t id: this.props.id,\n\t className: 'ic-tokeninput-input',\n\t onChange: this.handleInputChange,\n\t onBlur: this.handleInputBlur,\n\t onKeyDown: this.handleKeydown,\n\t onKeyUp: this.handleInputKeyUp,\n\t role: 'combobox'\n\t }),\n\t span({\n\t 'aria-hidden': 'true',\n\t className: 'ic-tokeninput-button',\n\t onClick: this.handleButtonClick\n\t }, '▾'),\n\t div({\n\t id: this.state.listId,\n\t ref: 'list',\n\t className: 'ic-tokeninput-list',\n\t role: 'listbox'\n\t }, this.state.menu.children)\n\t );\n\t }\n\t});\n\n\tfunction getLabel(component) {\n\t return component.props.label || component.props.children;\n\t}\n\n\tfunction matchFragment(userInput, firstChildLabel) {\n\t userInput = userInput.toLowerCase();\n\t firstChildLabel = firstChildLabel.toLowerCase();\n\t if (userInput === '' || userInput === firstChildLabel)\n\t return false;\n\t if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1)\n\t return false;\n\t return true;\n\t}\n\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar span = React.DOM.span;\n\tvar li = React.createFactory('li');\n\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\t handleClick: function() {\n\t this.props.onRemove(this.props.value)\n\t },\n\n\t handleKeyDown: function(key) {\n\t var enterKey = 13;\n\t if(key.keyCode === enterKey) this.props.onRemove(this.props.value)\n\t },\n\n\t render: function() {\n\t return (\n\t li({\n\t className: \"ic-token inline-flex\"\n\t },\n\t span({\n\t role: 'button',\n\t onClick: this.handleClick,\n\t onKeyDown: this.handleKeyDown,\n\t 'aria-label': 'Remove \\'' + this.props.name + '\\'',\n\t className: \"ic-token-delete-button\",\n\t tabIndex: 0\n\t }, \"✕\"),\n\t span({className: \"ic-token-label\"}, this.props.name)\n\t )\n\t )\n\t }\n\t})\n\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = addClass;\n\n\tfunction addClass(existing, added) {\n\t if (!existing) return added;\n\t if (existing.indexOf(added) > -1) return existing;\n\t return existing + ' ' + added;\n\t}\n\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** react-tokeninput.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap d565fa7672eea8600b30\n **/","var TokenInput = require('./lib/main')\nTokenInput.Option = require('./lib/option')\n\nmodule.exports = TokenInput\n\n\n\n/** WEBPACK FOOTER **\n ** ./index.js\n **/","var React = require('react');\nvar Combobox = React.createFactory(require('./combobox'));\nvar Token = React.createFactory(require('./token'));\n\nvar ul = React.createFactory('ul');\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n propTypes: {\n onInput: React.PropTypes.func,\n onSelect: React.PropTypes.func.isRequired,\n onRemove: React.PropTypes.func.isRequired,\n selected: React.PropTypes.array.isRequired,\n menuContent: React.PropTypes.any\n },\n\n getInitialState: function() {\n return {\n selectedToken: null\n };\n },\n\n handleClick: function() {\n // TODO: Expand combobox API for focus\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleInput: function(event) {\n this.props.onInput(event);\n },\n\n handleSelect: function(event) {\n this.props.onSelect(event)\n this.setState({\n selectedToken: null\n })\n },\n\n handleRemove: function(value) {\n this.props.onRemove(value);\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleRemoveLast: function() {\n this.props.onRemove(this.props.selected[this.props.selected.length - 1]);\n },\n\n render: function() {\n var tokens = this.props.selected.map(function(token) {\n return (\n Token({\n onRemove: this.handleRemove,\n value: token,\n name: token.name,\n key: token.id})\n )\n }.bind(this))\n\n return ul({className: 'ic-tokens flex', onClick: this.handleClick},\n tokens,\n li({className: 'inline-flex', ref: 'combo-li'},\n Combobox({\n id: this.props.id,\n ariaLabel: this.props['combobox-aria-label'],\n onInput: this.handleInput,\n onSelect: this.handleSelect,\n onRemoveLast: this.handleRemoveLast,\n value: this.state.selectedToken\n },\n this.props.menuContent\n )\n )\n );\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/main.js\n **/","var React = require('react');\nvar addClass = require('./add-class');\nvar div = React.createFactory('div');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n\n /**\n * The value that will be sent to the `onSelect` handler of the\n * parent Combobox.\n */\n value: React.PropTypes.any.isRequired,\n\n /**\n * What value to put into the input element when this option is\n * selected, defaults to its children coerced to a string.\n */\n label: React.PropTypes.string\n },\n\n getDefaultProps: function() {\n return {\n role: 'option',\n tabIndex: '-1',\n className: 'ic-tokeninput-option',\n isSelected: false\n };\n },\n\n render: function() {\n var props = this.props;\n if (props.isSelected) {\n props.className = addClass(props.className, 'ic-tokeninput-selected');\n props.ariaSelected = true;\n }\n return div(props);\n }\n\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/option.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n ** module id = 3\n ** module chunks = 0\n **/","var React = require('react');\nvar guid = 0;\nvar k = function(){};\nvar addClass = require('./add-class');\nvar ComboboxOption = React.createFactory(require('./option'));\n\nvar div = React.createFactory('div');\nvar span = React.createFactory('span');\nvar input = React.createFactory('input');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n /**\n * Called when the combobox receives user input, this is your chance to\n * filter the data and rerender the options.\n *\n * Signature:\n *\n * ```js\n * function(userInput){}\n * ```\n */\n onInput: React.PropTypes.func,\n\n /**\n * Called when the combobox receives a selection. You probably want to reset\n * the options to the full list at this point.\n *\n * Signature:\n *\n * ```js\n * function(selectedValue){}\n * ```\n */\n onSelect: React.PropTypes.func\n },\n\n getDefaultProps: function() {\n return {\n autocomplete: 'both',\n onInput: k,\n onSelect: k,\n value: null\n };\n },\n\n getInitialState: function() {\n return {\n value: this.props.value,\n // the value displayed in the input\n inputValue: this.findInitialInputValue(),\n isOpen: false,\n focusedIndex: null,\n matchedAutocompleteOption: null,\n // this prevents crazy jumpiness since we focus options on mouseenter\n usingKeyboard: false,\n activedescendant: null,\n listId: 'ic-tokeninput-list-'+(++guid),\n menu: {\n children: [],\n activedescendant: null,\n isEmpty: true\n }\n };\n },\n\n componentWillMount: function() {\n this.setState({menu: this.makeMenu()});\n },\n\n componentWillReceiveProps: function(newProps) {\n this.setState({menu: this.makeMenu(newProps.children)}, function() {\n if(newProps.children.length && (this.isOpen || document.activeElement === this.refs.input.getDOMNode())) {\n this.showList();\n } else {\n this.hideList();\n }\n\n }.bind(this));\n },\n\n /**\n * We don't create the components, the user supplies them,\n * so before rendering we attach handlers to facilitate communication from\n * the ComboboxOption to the Combobox.\n */\n makeMenu: function(children) {\n var activedescendant;\n var isEmpty = true;\n children = children || this.props.children;\n\n // Should this instead use React.addons.cloneWithProps or React.cloneElement?\n React.Children.forEach(children, function(child, index) {\n if (child.type !== ComboboxOption.type)\n // allow random elements to live in this list\n return;\n isEmpty = false;\n // TODO: cloneWithProps and map instead of altering the children in-place\n var props = child.props;\n if (this.state.value === props.value) {\n // need an ID for WAI-ARIA\n props.id = props.id || 'ic-tokeninput-selected-'+(++guid);\n props.isSelected = true\n activedescendant = props.id;\n }\n props.onBlur = this.handleOptionBlur;\n props.onClick = this.selectOption.bind(this, child);\n props.onFocus = this.handleOptionFocus;\n props.onKeyDown = this.handleOptionKeyDown.bind(this, child);\n props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index);\n }.bind(this));\n\n return {\n children: children,\n activedescendant: activedescendant,\n isEmpty: isEmpty\n };\n },\n\n getClassName: function() {\n var className = addClass(this.props.className, 'ic-tokeninput');\n if (this.state.isOpen)\n className = addClass(className, 'ic-tokeninput-is-open');\n return className;\n },\n\n /**\n * When the user begins typing again we need to clear out any state that has\n * to do with an existing or potential selection.\n */\n clearSelectedState: function(cb) {\n this.setState({\n focusedIndex: null,\n inputValue: null,\n value: null,\n matchedAutocompleteOption: null,\n activedescendant: null\n }, cb);\n },\n\n handleInputChange: function(event) {\n var value = this.refs.input.getDOMNode().value;\n this.clearSelectedState(function() {\n this.props.onInput(value);\n }.bind(this));\n },\n\n handleInputBlur: function() {\n var focusedAnOption = this.state.focusedIndex != null;\n if (focusedAnOption)\n return;\n this.maybeSelectAutocompletedOption();\n this.hideList();\n },\n\n handleOptionBlur: function() {\n // don't want to hide the list if we focused another option\n this.blurTimer = setTimeout(this.hideList, 0);\n },\n\n handleOptionFocus: function() {\n // see `handleOptionBlur`\n clearTimeout(this.blurTimer);\n },\n\n handleInputKeyUp: function(event) {\n if (\n this.state.menu.isEmpty ||\n // autocompleting while backspacing feels super weird, so let's not\n event.keyCode === 8 /*backspace*/ ||\n !this.props.autocomplete.match(/both|inline/)\n ) return;\n },\n\n handleButtonClick: function() {\n this.state.isOpen ? this.hideList() : this.showList();\n this.focusInput();\n },\n\n showList: function() {\n if(!this.state.menu.children.length) {\n return\n }\n this.setState({isOpen: true})\n },\n\n hideList: function() {\n this.setState({isOpen: false});\n },\n\n hideOnEscape: function(event) {\n this.hideList();\n this.focusInput();\n event.preventDefault();\n },\n\n focusInput: function() {\n this.refs.input.getDOMNode().focus();\n },\n\n selectInput: function() {\n this.refs.input.getDOMNode().select();\n },\n\n inputKeydownMap: {\n 8: 'removeLastToken',\n 13: 'selectOnEnter',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n optionKeydownMap: {\n 13: 'selectOption',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n handleKeydown: function(event) {\n var handlerName = this.inputKeydownMap[event.keyCode];\n if (!handlerName)\n return\n this.setState({usingKeyboard: true});\n return this[handlerName].call(this,event);\n },\n\n handleOptionKeyDown: function(child, event) {\n var handlerName = this.optionKeydownMap[event.keyCode];\n if (!handlerName) {\n // if the user starts typing again while focused on an option, move focus\n // to the inpute, select so it wipes out any existing value\n this.selectInput();\n return;\n }\n event.preventDefault();\n this.setState({usingKeyboard: true});\n this[handlerName].call(this, child);\n },\n\n handleOptionMouseEnter: function(index) {\n if (this.state.usingKeyboard)\n this.setState({usingKeyboard: false});\n else\n this.focusOptionAtIndex(index);\n },\n\n selectOnEnter: function(event) {\n event.preventDefault();\n this.maybeSelectAutocompletedOption()\n },\n\n maybeSelectAutocompletedOption: function() {\n if (!this.state.matchedAutocompleteOption) {\n this.selectText()\n } else {\n this.selectOption(this.state.matchedAutocompleteOption, {focus: false});\n }\n },\n\n selectOption: function(child, options) {\n options = options || {};\n this.setState({\n // value: child.props.value,\n // inputValue: getLabel(child),\n matchedAutocompleteOption: null\n }, function() {\n this.props.onSelect(child.props.value, child);\n this.hideList();\n this.clearSelectedState(); // added\n if (options.focus !== false)\n this.selectInput();\n }.bind(this));\n this.refs.input.getDOMNode().value = '' // added\n },\n\n selectText: function() {\n var value = this.refs.input.getDOMNode().value;\n if(!value) return;\n this.props.onSelect(value);\n this.clearSelectedState();\n this.refs.input.getDOMNode().value = '' // added\n },\n\n focusNext: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var index = this.state.focusedIndex == null ?\n 0 : this.state.focusedIndex + 1;\n this.focusOptionAtIndex(index);\n },\n\n removeLastToken: function() {\n if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) {\n this.props.onRemoveLast()\n }\n return true\n },\n\n focusPrevious: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var last = this.props.children.length - 1;\n var index = this.state.focusedIndex == null ?\n last : this.state.focusedIndex - 1;\n this.focusOptionAtIndex(index);\n },\n\n focusSelectedOption: function() {\n var selectedIndex;\n React.Children.forEach(this.props.children, function(child, index) {\n if (child.props.value === this.state.value)\n selectedIndex = index;\n }.bind(this));\n this.showList();\n this.setState({\n focusedIndex: selectedIndex\n }, this.focusOption);\n },\n\n findInitialInputValue: function() {\n // TODO: might not need this, we should know this in `makeMenu`\n var inputValue;\n React.Children.forEach(this.props.children, function(child) {\n if (child.props.value === this.props.value)\n inputValue = getLabel(child);\n }.bind(this));\n return inputValue;\n },\n\n focusOptionAtIndex: function(index) {\n if (!this.state.isOpen && this.state.value)\n return this.focusSelectedOption();\n this.showList();\n var length = this.props.children.length;\n if (index === -1)\n index = length - 1;\n else if (index === length)\n index = 0;\n this.setState({\n focusedIndex: index\n }, this.focusOption);\n },\n\n focusOption: function() {\n var index = this.state.focusedIndex;\n this.refs.list.getDOMNode().childNodes[index].focus();\n },\n\n render: function() {\n var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' +\n 'Press the down arrow to navigate results. If you don\\'t find an ' +\n 'acceptable option, you can enter an alternative.'\n\n return div({className: this.getClassName()},\n this.props.value,\n this.state.inputValue,\n input({\n ref: 'input',\n autoComplete: 'off',\n spellCheck: 'false',\n 'aria-label': ariaLabel,\n 'aria-expanded': this.state.isOpen+'',\n 'aria-haspopup': 'true',\n 'aria-activedescendant': this.state.menu.activedescendant,\n 'aria-autocomplete': 'list',\n 'aria-owns': this.state.listId,\n id: this.props.id,\n className: 'ic-tokeninput-input',\n onChange: this.handleInputChange,\n onBlur: this.handleInputBlur,\n onKeyDown: this.handleKeydown,\n onKeyUp: this.handleInputKeyUp,\n role: 'combobox'\n }),\n span({\n 'aria-hidden': 'true',\n className: 'ic-tokeninput-button',\n onClick: this.handleButtonClick\n }, '▾'),\n div({\n id: this.state.listId,\n ref: 'list',\n className: 'ic-tokeninput-list',\n role: 'listbox'\n }, this.state.menu.children)\n );\n }\n});\n\nfunction getLabel(component) {\n return component.props.label || component.props.children;\n}\n\nfunction matchFragment(userInput, firstChildLabel) {\n userInput = userInput.toLowerCase();\n firstChildLabel = firstChildLabel.toLowerCase();\n if (userInput === '' || userInput === firstChildLabel)\n return false;\n if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1)\n return false;\n return true;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/combobox.js\n **/","var React = require('react');\nvar span = React.DOM.span;\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n handleClick: function() {\n this.props.onRemove(this.props.value)\n },\n\n handleKeyDown: function(key) {\n var enterKey = 13;\n if(key.keyCode === enterKey) this.props.onRemove(this.props.value)\n },\n\n render: function() {\n return (\n li({\n className: \"ic-token inline-flex\"\n },\n span({\n role: 'button',\n onClick: this.handleClick,\n onKeyDown: this.handleKeyDown,\n 'aria-label': 'Remove \\'' + this.props.name + '\\'',\n className: \"ic-token-delete-button\",\n tabIndex: 0\n }, \"✕\"),\n span({className: \"ic-token-label\"}, this.props.name)\n )\n )\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/token.js\n **/","module.exports = addClass;\n\nfunction addClass(existing, added) {\n if (!existing) return added;\n if (existing.indexOf(added) > -1) return existing;\n return existing + ' ' + added;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/add-class.js\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///react-tokeninput.min.js","webpack:///webpack/bootstrap f661a0ab5788059634ef","webpack:///./index.js","webpack:///./lib/main.js","webpack:///./lib/option.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///./lib/combobox.js","webpack:///./lib/token.js","webpack:///./lib/add-class.js"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_3__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","TokenInput","Option","React","Combobox","createFactory","Token","ul","li","createClass","displayName","propTypes","onInput","PropTypes","func","onSelect","isRequired","onRemove","selected","array","menuContent","any","showListOnFocus","bool","getInitialState","selectedToken","handleClick","refs","getDOMNode","querySelector","focus","handleInput","event","props","handleSelect","setState","handleRemove","value","handleRemoveLast","length","render","tokens","map","token","name","key","bind","className","onClick","ref","ariaLabel","onRemoveLast","state","addClass","div","label","string","getDefaultProps","role","tabIndex","isSelected","ariaSelected","getLabel","component","children","guid","k","ComboboxOption","span","input","autocomplete","inputValue","findInitialInputValue","isOpen","focusedIndex","matchedAutocompleteOption","usingKeyboard","activedescendant","listId","menu","isEmpty","componentWillMount","makeMenu","componentWillReceiveProps","newProps","document","activeElement","showList","hideList","Children","forEach","child","index","type","onBlur","handleOptionBlur","selectOption","onFocus","handleOptionFocus","onKeyDown","handleOptionKeyDown","onMouseEnter","handleOptionMouseEnter","getClassName","clearSelectedState","cb","handleInputChange","handleInputFocus","handleInputBlur","focusedAnOption","maybeSelectAutocompletedOption","blurTimer","setTimeout","clearTimeout","handleInputKeyUp","keyCode","match","handleButtonClick","focusInput","hideOnEscape","preventDefault","selectInput","select","inputKeydownMap",8,13,27,38,40,"optionKeydownMap","handleKeydown","handlerName","focusOptionAtIndex","selectOnEnter","selectText","options","focusNext","removeLastToken","focusPrevious","last","focusSelectedOption","selectedIndex","focusOption","list","childNodes","autoComplete","spellCheck","aria-label","aria-expanded","aria-haspopup","aria-activedescendant","aria-autocomplete","aria-owns","onChange","onKeyUp","aria-hidden","DOM","handleKeyDown","enterKey","existing","added","indexOf"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,UACA,kBAAAC,gBAAAC,IACAD,QAAA,SAAAJ,GACA,gBAAAC,SACAA,QAAA,WAAAD,EAAAG,QAAA,UAEAJ,EAAA,WAAAC,EAAAD,EAAA,QACCO,KAAA,SAAAC,GACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAT,OAGA,IAAAC,GAAAS,EAAAD,IACAT,WACAW,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAZ,EAAAD,QAAAC,IAAAD,QAAAQ,GAGAP,EAAAW,QAAA,EAGAX,EAAAD,QAvBA,GAAAU,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,GAGAR,EAAA,KDgBM,SAASP,EAAQD,EAASQ,GEtDhC,GAAIS,GAAaT,EAAQ,EACzBS,GAAWC,OAAS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XqB,GACEV,KAAM,SACNV,QAAS3D,KAAKqC,YACdyE,UAAW9G,KAAKwK,cAChBV,aAAc,WAAc9J,KAAK4C,MAAMW,KAAO,IAC9CG,UAAW,yBACXY,SAAU,GACT,KACHS,GAAMrB,UAAW,kBAAmB1D,KAAK4C,MAAMW,WPqnBjD,SAAS3D,EAAQD,EAASQ,GQ9oBhC,QAAS6D,GAAS0G,EAAUC,GAC1B,MAAKD,GACDA,EAASE,QAAQD,GAAS,GAAWD,EAClCA,EAAW,IAAMC,EAFFA,EAHxB/K,EAAOD,QAAUqE","file":"react-tokeninput.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TokenInput\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"TokenInput\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TokenInput\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"TokenInput\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar TokenInput = __webpack_require__(1)\n\tTokenInput.Option = __webpack_require__(2)\n\t\n\tmodule.exports = TokenInput\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar Combobox = React.createFactory(__webpack_require__(4));\n\tvar Token = React.createFactory(__webpack_require__(5));\n\t\n\tvar ul = React.createFactory('ul');\n\tvar li = React.createFactory('li');\n\t\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\t propTypes: {\n\t onInput: React.PropTypes.func,\n\t onSelect: React.PropTypes.func.isRequired,\n\t onRemove: React.PropTypes.func.isRequired,\n\t selected: React.PropTypes.array.isRequired,\n\t menuContent: React.PropTypes.any,\n\t showListOnFocus: React.PropTypes.bool\n\t },\n\t\n\t getInitialState: function() {\n\t return {\n\t selectedToken: null\n\t };\n\t },\n\t\n\t handleClick: function() {\n\t // TODO: Expand combobox API for focus\n\t this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n\t },\n\t\n\t handleInput: function(event) {\n\t this.props.onInput(event);\n\t },\n\t\n\t handleSelect: function(event) {\n\t this.props.onSelect(event)\n\t this.setState({\n\t selectedToken: null\n\t })\n\t },\n\t\n\t handleRemove: function(value) {\n\t this.props.onRemove(value);\n\t this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n\t },\n\t\n\t handleRemoveLast: function() {\n\t this.props.onRemove(this.props.selected[this.props.selected.length - 1]);\n\t },\n\t\n\t render: function() {\n\t var tokens = this.props.selected.map(function(token) {\n\t return (\n\t Token({\n\t onRemove: this.handleRemove,\n\t value: token,\n\t name: token.name,\n\t key: token.id})\n\t )\n\t }.bind(this))\n\t\n\t return ul({className: 'ic-tokens flex', onClick: this.handleClick},\n\t tokens,\n\t li({className: 'inline-flex', ref: 'combo-li'},\n\t Combobox({\n\t id: this.props.id,\n\t ariaLabel: this.props['combobox-aria-label'],\n\t onInput: this.handleInput,\n\t showListOnFocus: this.props.showListOnFocus,\n\t onSelect: this.handleSelect,\n\t onRemoveLast: this.handleRemoveLast,\n\t value: this.state.selectedToken\n\t },\n\t this.props.menuContent\n\t )\n\t )\n\t );\n\t }\n\t})\n\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar addClass = __webpack_require__(6);\n\tvar div = React.createFactory('div');\n\t\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\t\n\t propTypes: {\n\t\n\t /**\n\t * The value that will be sent to the `onSelect` handler of the\n\t * parent Combobox.\n\t */\n\t value: React.PropTypes.any.isRequired,\n\t\n\t /**\n\t * What value to put into the input element when this option is\n\t * selected, defaults to its children coerced to a string.\n\t */\n\t label: React.PropTypes.string\n\t },\n\t\n\t getDefaultProps: function() {\n\t return {\n\t role: 'option',\n\t tabIndex: '-1',\n\t className: 'ic-tokeninput-option',\n\t isSelected: false\n\t };\n\t },\n\t\n\t render: function() {\n\t var props = this.props;\n\t if (props.isSelected) {\n\t props.className = addClass(props.className, 'ic-tokeninput-selected');\n\t props.ariaSelected = true;\n\t }\n\t return div(props);\n\t }\n\t\n\t});\n\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar guid = 0;\n\tvar k = function(){};\n\tvar addClass = __webpack_require__(6);\n\tvar ComboboxOption = React.createFactory(__webpack_require__(2));\n\t\n\tvar div = React.createFactory('div');\n\tvar span = React.createFactory('span');\n\tvar input = React.createFactory('input');\n\t\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\t\n\t propTypes: {\n\t /**\n\t * Called when the combobox receives user input, this is your chance to\n\t * filter the data and rerender the options.\n\t *\n\t * Signature:\n\t *\n\t * ```js\n\t * function(userInput){}\n\t * ```\n\t */\n\t onInput: React.PropTypes.func,\n\t\n\t /**\n\t * Called when the combobox receives a selection. You probably want to reset\n\t * the options to the full list at this point.\n\t *\n\t * Signature:\n\t *\n\t * ```js\n\t * function(selectedValue){}\n\t * ```\n\t */\n\t onSelect: React.PropTypes.func\n\t },\n\t\n\t getDefaultProps: function() {\n\t return {\n\t autocomplete: 'both',\n\t onInput: k,\n\t onSelect: k,\n\t value: null,\n\t showListOnFocus: false\n\t };\n\t },\n\t\n\t getInitialState: function() {\n\t return {\n\t value: this.props.value,\n\t // the value displayed in the input\n\t inputValue: this.findInitialInputValue(),\n\t isOpen: false,\n\t focusedIndex: null,\n\t matchedAutocompleteOption: null,\n\t // this prevents crazy jumpiness since we focus options on mouseenter\n\t usingKeyboard: false,\n\t activedescendant: null,\n\t listId: 'ic-tokeninput-list-'+(++guid),\n\t menu: {\n\t children: [],\n\t activedescendant: null,\n\t isEmpty: true\n\t }\n\t };\n\t },\n\t\n\t componentWillMount: function() {\n\t this.setState({menu: this.makeMenu()});\n\t },\n\t\n\t componentWillReceiveProps: function(newProps) {\n\t this.setState({menu: this.makeMenu(newProps.children)}, function() {\n\t if(newProps.children.length && (this.isOpen || document.activeElement === this.refs.input.getDOMNode())) {\n\t this.showList();\n\t } else {\n\t this.hideList();\n\t }\n\t\n\t }.bind(this));\n\t },\n\t\n\t /**\n\t * We don't create the components, the user supplies them,\n\t * so before rendering we attach handlers to facilitate communication from\n\t * the ComboboxOption to the Combobox.\n\t */\n\t makeMenu: function(children) {\n\t var activedescendant;\n\t var isEmpty = true;\n\t children = children || this.props.children;\n\t\n\t // Should this instead use React.addons.cloneWithProps or React.cloneElement?\n\t React.Children.forEach(children, function(child, index) {\n\t if (child.type !== ComboboxOption.type)\n\t // allow random elements to live in this list\n\t return;\n\t isEmpty = false;\n\t // TODO: cloneWithProps and map instead of altering the children in-place\n\t var props = child.props;\n\t if (this.state.value === props.value) {\n\t // need an ID for WAI-ARIA\n\t props.id = props.id || 'ic-tokeninput-selected-'+(++guid);\n\t props.isSelected = true\n\t activedescendant = props.id;\n\t }\n\t props.onBlur = this.handleOptionBlur;\n\t props.onClick = this.selectOption.bind(this, child);\n\t props.onFocus = this.handleOptionFocus;\n\t props.onKeyDown = this.handleOptionKeyDown.bind(this, child);\n\t props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index);\n\t }.bind(this));\n\t\n\t return {\n\t children: children,\n\t activedescendant: activedescendant,\n\t isEmpty: isEmpty\n\t };\n\t },\n\t\n\t getClassName: function() {\n\t var className = addClass(this.props.className, 'ic-tokeninput');\n\t if (this.state.isOpen)\n\t className = addClass(className, 'ic-tokeninput-is-open');\n\t return className;\n\t },\n\t\n\t /**\n\t * When the user begins typing again we need to clear out any state that has\n\t * to do with an existing or potential selection.\n\t */\n\t clearSelectedState: function(cb) {\n\t this.setState({\n\t focusedIndex: null,\n\t inputValue: null,\n\t value: null,\n\t matchedAutocompleteOption: null,\n\t activedescendant: null\n\t }, cb);\n\t },\n\t\n\t handleInputChange: function(event) {\n\t var value = this.refs.input.getDOMNode().value;\n\t this.clearSelectedState(function() {\n\t this.props.onInput(value);\n\t }.bind(this));\n\t },\n\t\n\t handleInputFocus: function() {\n\t if (this.props.showListOnFocus){\n\t this.showList()\n\t }\n\t },\n\t\n\t handleInputBlur: function() {\n\t var focusedAnOption = this.state.focusedIndex != null;\n\t if (focusedAnOption)\n\t return;\n\t this.maybeSelectAutocompletedOption();\n\t this.hideList();\n\t },\n\t\n\t handleOptionBlur: function() {\n\t // don't want to hide the list if we focused another option\n\t this.blurTimer = setTimeout(this.hideList, 0);\n\t },\n\t\n\t\n\t handleOptionFocus: function() {\n\t // see `handleOptionBlur`\n\t clearTimeout(this.blurTimer);\n\t },\n\t\n\t handleInputKeyUp: function(event) {\n\t if (\n\t this.state.menu.isEmpty ||\n\t // autocompleting while backspacing feels super weird, so let's not\n\t event.keyCode === 8 /*backspace*/ ||\n\t !this.props.autocomplete.match(/both|inline/)\n\t ) return;\n\t },\n\t\n\t handleButtonClick: function() {\n\t this.state.isOpen ? this.hideList() : this.showList();\n\t this.focusInput();\n\t },\n\t\n\t showList: function() {\n\t if(!this.state.menu.children.length) {\n\t return\n\t }\n\t this.setState({isOpen: true})\n\t },\n\t\n\t hideList: function() {\n\t this.setState({isOpen: false});\n\t },\n\t\n\t hideOnEscape: function(event) {\n\t this.hideList();\n\t this.focusInput();\n\t event.preventDefault();\n\t },\n\t\n\t focusInput: function() {\n\t this.refs.input.getDOMNode().focus();\n\t },\n\t\n\t selectInput: function() {\n\t this.refs.input.getDOMNode().select();\n\t },\n\t\n\t inputKeydownMap: {\n\t 8: 'removeLastToken',\n\t 13: 'selectOnEnter',\n\t 27: 'hideOnEscape',\n\t 38: 'focusPrevious',\n\t 40: 'focusNext'\n\t },\n\t\n\t optionKeydownMap: {\n\t 13: 'selectOption',\n\t 27: 'hideOnEscape',\n\t 38: 'focusPrevious',\n\t 40: 'focusNext'\n\t },\n\t\n\t handleKeydown: function(event) {\n\t var handlerName = this.inputKeydownMap[event.keyCode];\n\t if (!handlerName)\n\t return\n\t this.setState({usingKeyboard: true});\n\t return this[handlerName].call(this,event);\n\t },\n\t\n\t handleOptionKeyDown: function(child, event) {\n\t var handlerName = this.optionKeydownMap[event.keyCode];\n\t if (!handlerName) {\n\t // if the user starts typing again while focused on an option, move focus\n\t // to the inpute, select so it wipes out any existing value\n\t this.selectInput();\n\t return;\n\t }\n\t event.preventDefault();\n\t this.setState({usingKeyboard: true});\n\t this[handlerName].call(this, child);\n\t },\n\t\n\t handleOptionMouseEnter: function(index) {\n\t if (this.state.usingKeyboard)\n\t this.setState({usingKeyboard: false});\n\t else\n\t this.focusOptionAtIndex(index);\n\t },\n\t\n\t selectOnEnter: function(event) {\n\t event.preventDefault();\n\t this.maybeSelectAutocompletedOption()\n\t },\n\t\n\t maybeSelectAutocompletedOption: function() {\n\t if (!this.state.matchedAutocompleteOption) {\n\t this.selectText()\n\t } else {\n\t this.selectOption(this.state.matchedAutocompleteOption, {focus: false});\n\t }\n\t },\n\t\n\t selectOption: function(child, options) {\n\t options = options || {};\n\t this.setState({\n\t // value: child.props.value,\n\t // inputValue: getLabel(child),\n\t matchedAutocompleteOption: null\n\t }, function() {\n\t this.props.onSelect(child.props.value, child);\n\t this.hideList();\n\t this.clearSelectedState(); // added\n\t if (options.focus !== false)\n\t this.selectInput();\n\t }.bind(this));\n\t this.refs.input.getDOMNode().value = '' // added\n\t },\n\t\n\t selectText: function() {\n\t var value = this.refs.input.getDOMNode().value;\n\t if(!value) return;\n\t this.props.onSelect(value);\n\t this.clearSelectedState();\n\t this.refs.input.getDOMNode().value = '' // added\n\t },\n\t\n\t focusNext: function(event) {\n\t if(event.preventDefault) event.preventDefault();\n\t if (this.state.menu.isEmpty) return;\n\t var index = this.state.focusedIndex == null ?\n\t 0 : this.state.focusedIndex + 1;\n\t this.focusOptionAtIndex(index);\n\t },\n\t\n\t removeLastToken: function() {\n\t if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) {\n\t this.props.onRemoveLast()\n\t }\n\t return true\n\t },\n\t\n\t focusPrevious: function(event) {\n\t if(event.preventDefault) event.preventDefault();\n\t if (this.state.menu.isEmpty) return;\n\t var last = this.props.children.length - 1;\n\t var index = this.state.focusedIndex == null ?\n\t last : this.state.focusedIndex - 1;\n\t this.focusOptionAtIndex(index);\n\t },\n\t\n\t focusSelectedOption: function() {\n\t var selectedIndex;\n\t React.Children.forEach(this.props.children, function(child, index) {\n\t if (child.props.value === this.state.value)\n\t selectedIndex = index;\n\t }.bind(this));\n\t this.showList();\n\t this.setState({\n\t focusedIndex: selectedIndex\n\t }, this.focusOption);\n\t },\n\t\n\t findInitialInputValue: function() {\n\t // TODO: might not need this, we should know this in `makeMenu`\n\t var inputValue;\n\t React.Children.forEach(this.props.children, function(child) {\n\t if (child.props.value === this.props.value)\n\t inputValue = getLabel(child);\n\t }.bind(this));\n\t return inputValue;\n\t },\n\t\n\t focusOptionAtIndex: function(index) {\n\t if (!this.state.isOpen && this.state.value)\n\t return this.focusSelectedOption();\n\t this.showList();\n\t var length = this.props.children.length;\n\t if (index === -1)\n\t index = length - 1;\n\t else if (index === length)\n\t index = 0;\n\t this.setState({\n\t focusedIndex: index\n\t }, this.focusOption);\n\t },\n\t\n\t focusOption: function() {\n\t var index = this.state.focusedIndex;\n\t this.refs.list.getDOMNode().childNodes[index].focus();\n\t },\n\t\n\t render: function() {\n\t var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' +\n\t 'Press the down arrow to navigate results. If you don\\'t find an ' +\n\t 'acceptable option, you can enter an alternative.'\n\t\n\t return div({className: this.getClassName()},\n\t this.props.value,\n\t this.state.inputValue,\n\t input({\n\t ref: 'input',\n\t autoComplete: 'off',\n\t spellCheck: 'false',\n\t 'aria-label': ariaLabel,\n\t 'aria-expanded': this.state.isOpen+'',\n\t 'aria-haspopup': 'true',\n\t 'aria-activedescendant': this.state.menu.activedescendant,\n\t 'aria-autocomplete': 'list',\n\t 'aria-owns': this.state.listId,\n\t id: this.props.id,\n\t className: 'ic-tokeninput-input',\n\t onFocus: this.handleInputFocus,\n\t onChange: this.handleInputChange,\n\t onBlur: this.handleInputBlur,\n\t onKeyDown: this.handleKeydown,\n\t onKeyUp: this.handleInputKeyUp,\n\t role: 'combobox'\n\t }),\n\t span({\n\t 'aria-hidden': 'true',\n\t className: 'ic-tokeninput-button',\n\t onClick: this.handleButtonClick\n\t }, '▾'),\n\t div({\n\t id: this.state.listId,\n\t ref: 'list',\n\t className: 'ic-tokeninput-list',\n\t role: 'listbox'\n\t }, this.state.menu.children)\n\t );\n\t }\n\t});\n\t\n\tfunction getLabel(component) {\n\t return component.props.label || component.props.children;\n\t}\n\t\n\tfunction matchFragment(userInput, firstChildLabel) {\n\t userInput = userInput.toLowerCase();\n\t firstChildLabel = firstChildLabel.toLowerCase();\n\t if (userInput === '' || userInput === firstChildLabel)\n\t return false;\n\t if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1)\n\t return false;\n\t return true;\n\t}\n\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar span = React.DOM.span;\n\tvar li = React.createFactory('li');\n\t\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\t handleClick: function() {\n\t this.props.onRemove(this.props.value)\n\t },\n\t\n\t handleKeyDown: function(key) {\n\t var enterKey = 13;\n\t if(key.keyCode === enterKey) this.props.onRemove(this.props.value)\n\t },\n\t\n\t render: function() {\n\t return (\n\t li({\n\t className: \"ic-token inline-flex\"\n\t },\n\t span({\n\t role: 'button',\n\t onClick: this.handleClick,\n\t onKeyDown: this.handleKeyDown,\n\t 'aria-label': 'Remove \\'' + this.props.name + '\\'',\n\t className: \"ic-token-delete-button\",\n\t tabIndex: 0\n\t }, \"✕\"),\n\t span({className: \"ic-token-label\"}, this.props.name)\n\t )\n\t )\n\t }\n\t})\n\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = addClass;\n\t\n\tfunction addClass(existing, added) {\n\t if (!existing) return added;\n\t if (existing.indexOf(added) > -1) return existing;\n\t return existing + ' ' + added;\n\t}\n\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** react-tokeninput.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap f661a0ab5788059634ef\n **/","var TokenInput = require('./lib/main')\nTokenInput.Option = require('./lib/option')\n\nmodule.exports = TokenInput\n\n\n\n/** WEBPACK FOOTER **\n ** ./index.js\n **/","var React = require('react');\nvar Combobox = React.createFactory(require('./combobox'));\nvar Token = React.createFactory(require('./token'));\n\nvar ul = React.createFactory('ul');\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n propTypes: {\n onInput: React.PropTypes.func,\n onSelect: React.PropTypes.func.isRequired,\n onRemove: React.PropTypes.func.isRequired,\n selected: React.PropTypes.array.isRequired,\n menuContent: React.PropTypes.any,\n showListOnFocus: React.PropTypes.bool\n },\n\n getInitialState: function() {\n return {\n selectedToken: null\n };\n },\n\n handleClick: function() {\n // TODO: Expand combobox API for focus\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleInput: function(event) {\n this.props.onInput(event);\n },\n\n handleSelect: function(event) {\n this.props.onSelect(event)\n this.setState({\n selectedToken: null\n })\n },\n\n handleRemove: function(value) {\n this.props.onRemove(value);\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleRemoveLast: function() {\n this.props.onRemove(this.props.selected[this.props.selected.length - 1]);\n },\n\n render: function() {\n var tokens = this.props.selected.map(function(token) {\n return (\n Token({\n onRemove: this.handleRemove,\n value: token,\n name: token.name,\n key: token.id})\n )\n }.bind(this))\n\n return ul({className: 'ic-tokens flex', onClick: this.handleClick},\n tokens,\n li({className: 'inline-flex', ref: 'combo-li'},\n Combobox({\n id: this.props.id,\n ariaLabel: this.props['combobox-aria-label'],\n onInput: this.handleInput,\n showListOnFocus: this.props.showListOnFocus,\n onSelect: this.handleSelect,\n onRemoveLast: this.handleRemoveLast,\n value: this.state.selectedToken\n },\n this.props.menuContent\n )\n )\n );\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/main.js\n **/","var React = require('react');\nvar addClass = require('./add-class');\nvar div = React.createFactory('div');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n\n /**\n * The value that will be sent to the `onSelect` handler of the\n * parent Combobox.\n */\n value: React.PropTypes.any.isRequired,\n\n /**\n * What value to put into the input element when this option is\n * selected, defaults to its children coerced to a string.\n */\n label: React.PropTypes.string\n },\n\n getDefaultProps: function() {\n return {\n role: 'option',\n tabIndex: '-1',\n className: 'ic-tokeninput-option',\n isSelected: false\n };\n },\n\n render: function() {\n var props = this.props;\n if (props.isSelected) {\n props.className = addClass(props.className, 'ic-tokeninput-selected');\n props.ariaSelected = true;\n }\n return div(props);\n }\n\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/option.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n ** module id = 3\n ** module chunks = 0\n **/","var React = require('react');\nvar guid = 0;\nvar k = function(){};\nvar addClass = require('./add-class');\nvar ComboboxOption = React.createFactory(require('./option'));\n\nvar div = React.createFactory('div');\nvar span = React.createFactory('span');\nvar input = React.createFactory('input');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n /**\n * Called when the combobox receives user input, this is your chance to\n * filter the data and rerender the options.\n *\n * Signature:\n *\n * ```js\n * function(userInput){}\n * ```\n */\n onInput: React.PropTypes.func,\n\n /**\n * Called when the combobox receives a selection. You probably want to reset\n * the options to the full list at this point.\n *\n * Signature:\n *\n * ```js\n * function(selectedValue){}\n * ```\n */\n onSelect: React.PropTypes.func\n },\n\n getDefaultProps: function() {\n return {\n autocomplete: 'both',\n onInput: k,\n onSelect: k,\n value: null,\n showListOnFocus: false\n };\n },\n\n getInitialState: function() {\n return {\n value: this.props.value,\n // the value displayed in the input\n inputValue: this.findInitialInputValue(),\n isOpen: false,\n focusedIndex: null,\n matchedAutocompleteOption: null,\n // this prevents crazy jumpiness since we focus options on mouseenter\n usingKeyboard: false,\n activedescendant: null,\n listId: 'ic-tokeninput-list-'+(++guid),\n menu: {\n children: [],\n activedescendant: null,\n isEmpty: true\n }\n };\n },\n\n componentWillMount: function() {\n this.setState({menu: this.makeMenu()});\n },\n\n componentWillReceiveProps: function(newProps) {\n this.setState({menu: this.makeMenu(newProps.children)}, function() {\n if(newProps.children.length && (this.isOpen || document.activeElement === this.refs.input.getDOMNode())) {\n this.showList();\n } else {\n this.hideList();\n }\n\n }.bind(this));\n },\n\n /**\n * We don't create the components, the user supplies them,\n * so before rendering we attach handlers to facilitate communication from\n * the ComboboxOption to the Combobox.\n */\n makeMenu: function(children) {\n var activedescendant;\n var isEmpty = true;\n children = children || this.props.children;\n\n // Should this instead use React.addons.cloneWithProps or React.cloneElement?\n React.Children.forEach(children, function(child, index) {\n if (child.type !== ComboboxOption.type)\n // allow random elements to live in this list\n return;\n isEmpty = false;\n // TODO: cloneWithProps and map instead of altering the children in-place\n var props = child.props;\n if (this.state.value === props.value) {\n // need an ID for WAI-ARIA\n props.id = props.id || 'ic-tokeninput-selected-'+(++guid);\n props.isSelected = true\n activedescendant = props.id;\n }\n props.onBlur = this.handleOptionBlur;\n props.onClick = this.selectOption.bind(this, child);\n props.onFocus = this.handleOptionFocus;\n props.onKeyDown = this.handleOptionKeyDown.bind(this, child);\n props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index);\n }.bind(this));\n\n return {\n children: children,\n activedescendant: activedescendant,\n isEmpty: isEmpty\n };\n },\n\n getClassName: function() {\n var className = addClass(this.props.className, 'ic-tokeninput');\n if (this.state.isOpen)\n className = addClass(className, 'ic-tokeninput-is-open');\n return className;\n },\n\n /**\n * When the user begins typing again we need to clear out any state that has\n * to do with an existing or potential selection.\n */\n clearSelectedState: function(cb) {\n this.setState({\n focusedIndex: null,\n inputValue: null,\n value: null,\n matchedAutocompleteOption: null,\n activedescendant: null\n }, cb);\n },\n\n handleInputChange: function(event) {\n var value = this.refs.input.getDOMNode().value;\n this.clearSelectedState(function() {\n this.props.onInput(value);\n }.bind(this));\n },\n\n handleInputFocus: function() {\n if (this.props.showListOnFocus){\n this.showList()\n }\n },\n\n handleInputBlur: function() {\n var focusedAnOption = this.state.focusedIndex != null;\n if (focusedAnOption)\n return;\n this.maybeSelectAutocompletedOption();\n this.hideList();\n },\n\n handleOptionBlur: function() {\n // don't want to hide the list if we focused another option\n this.blurTimer = setTimeout(this.hideList, 0);\n },\n\n\n handleOptionFocus: function() {\n // see `handleOptionBlur`\n clearTimeout(this.blurTimer);\n },\n\n handleInputKeyUp: function(event) {\n if (\n this.state.menu.isEmpty ||\n // autocompleting while backspacing feels super weird, so let's not\n event.keyCode === 8 /*backspace*/ ||\n !this.props.autocomplete.match(/both|inline/)\n ) return;\n },\n\n handleButtonClick: function() {\n this.state.isOpen ? this.hideList() : this.showList();\n this.focusInput();\n },\n\n showList: function() {\n if(!this.state.menu.children.length) {\n return\n }\n this.setState({isOpen: true})\n },\n\n hideList: function() {\n this.setState({isOpen: false});\n },\n\n hideOnEscape: function(event) {\n this.hideList();\n this.focusInput();\n event.preventDefault();\n },\n\n focusInput: function() {\n this.refs.input.getDOMNode().focus();\n },\n\n selectInput: function() {\n this.refs.input.getDOMNode().select();\n },\n\n inputKeydownMap: {\n 8: 'removeLastToken',\n 13: 'selectOnEnter',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n optionKeydownMap: {\n 13: 'selectOption',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n handleKeydown: function(event) {\n var handlerName = this.inputKeydownMap[event.keyCode];\n if (!handlerName)\n return\n this.setState({usingKeyboard: true});\n return this[handlerName].call(this,event);\n },\n\n handleOptionKeyDown: function(child, event) {\n var handlerName = this.optionKeydownMap[event.keyCode];\n if (!handlerName) {\n // if the user starts typing again while focused on an option, move focus\n // to the inpute, select so it wipes out any existing value\n this.selectInput();\n return;\n }\n event.preventDefault();\n this.setState({usingKeyboard: true});\n this[handlerName].call(this, child);\n },\n\n handleOptionMouseEnter: function(index) {\n if (this.state.usingKeyboard)\n this.setState({usingKeyboard: false});\n else\n this.focusOptionAtIndex(index);\n },\n\n selectOnEnter: function(event) {\n event.preventDefault();\n this.maybeSelectAutocompletedOption()\n },\n\n maybeSelectAutocompletedOption: function() {\n if (!this.state.matchedAutocompleteOption) {\n this.selectText()\n } else {\n this.selectOption(this.state.matchedAutocompleteOption, {focus: false});\n }\n },\n\n selectOption: function(child, options) {\n options = options || {};\n this.setState({\n // value: child.props.value,\n // inputValue: getLabel(child),\n matchedAutocompleteOption: null\n }, function() {\n this.props.onSelect(child.props.value, child);\n this.hideList();\n this.clearSelectedState(); // added\n if (options.focus !== false)\n this.selectInput();\n }.bind(this));\n this.refs.input.getDOMNode().value = '' // added\n },\n\n selectText: function() {\n var value = this.refs.input.getDOMNode().value;\n if(!value) return;\n this.props.onSelect(value);\n this.clearSelectedState();\n this.refs.input.getDOMNode().value = '' // added\n },\n\n focusNext: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var index = this.state.focusedIndex == null ?\n 0 : this.state.focusedIndex + 1;\n this.focusOptionAtIndex(index);\n },\n\n removeLastToken: function() {\n if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) {\n this.props.onRemoveLast()\n }\n return true\n },\n\n focusPrevious: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var last = this.props.children.length - 1;\n var index = this.state.focusedIndex == null ?\n last : this.state.focusedIndex - 1;\n this.focusOptionAtIndex(index);\n },\n\n focusSelectedOption: function() {\n var selectedIndex;\n React.Children.forEach(this.props.children, function(child, index) {\n if (child.props.value === this.state.value)\n selectedIndex = index;\n }.bind(this));\n this.showList();\n this.setState({\n focusedIndex: selectedIndex\n }, this.focusOption);\n },\n\n findInitialInputValue: function() {\n // TODO: might not need this, we should know this in `makeMenu`\n var inputValue;\n React.Children.forEach(this.props.children, function(child) {\n if (child.props.value === this.props.value)\n inputValue = getLabel(child);\n }.bind(this));\n return inputValue;\n },\n\n focusOptionAtIndex: function(index) {\n if (!this.state.isOpen && this.state.value)\n return this.focusSelectedOption();\n this.showList();\n var length = this.props.children.length;\n if (index === -1)\n index = length - 1;\n else if (index === length)\n index = 0;\n this.setState({\n focusedIndex: index\n }, this.focusOption);\n },\n\n focusOption: function() {\n var index = this.state.focusedIndex;\n this.refs.list.getDOMNode().childNodes[index].focus();\n },\n\n render: function() {\n var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' +\n 'Press the down arrow to navigate results. If you don\\'t find an ' +\n 'acceptable option, you can enter an alternative.'\n\n return div({className: this.getClassName()},\n this.props.value,\n this.state.inputValue,\n input({\n ref: 'input',\n autoComplete: 'off',\n spellCheck: 'false',\n 'aria-label': ariaLabel,\n 'aria-expanded': this.state.isOpen+'',\n 'aria-haspopup': 'true',\n 'aria-activedescendant': this.state.menu.activedescendant,\n 'aria-autocomplete': 'list',\n 'aria-owns': this.state.listId,\n id: this.props.id,\n className: 'ic-tokeninput-input',\n onFocus: this.handleInputFocus,\n onChange: this.handleInputChange,\n onBlur: this.handleInputBlur,\n onKeyDown: this.handleKeydown,\n onKeyUp: this.handleInputKeyUp,\n role: 'combobox'\n }),\n span({\n 'aria-hidden': 'true',\n className: 'ic-tokeninput-button',\n onClick: this.handleButtonClick\n }, '▾'),\n div({\n id: this.state.listId,\n ref: 'list',\n className: 'ic-tokeninput-list',\n role: 'listbox'\n }, this.state.menu.children)\n );\n }\n});\n\nfunction getLabel(component) {\n return component.props.label || component.props.children;\n}\n\nfunction matchFragment(userInput, firstChildLabel) {\n userInput = userInput.toLowerCase();\n firstChildLabel = firstChildLabel.toLowerCase();\n if (userInput === '' || userInput === firstChildLabel)\n return false;\n if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1)\n return false;\n return true;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/combobox.js\n **/","var React = require('react');\nvar span = React.DOM.span;\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n handleClick: function() {\n this.props.onRemove(this.props.value)\n },\n\n handleKeyDown: function(key) {\n var enterKey = 13;\n if(key.keyCode === enterKey) this.props.onRemove(this.props.value)\n },\n\n render: function() {\n return (\n li({\n className: \"ic-token inline-flex\"\n },\n span({\n role: 'button',\n onClick: this.handleClick,\n onKeyDown: this.handleKeyDown,\n 'aria-label': 'Remove \\'' + this.props.name + '\\'',\n className: \"ic-token-delete-button\",\n tabIndex: 0\n }, \"✕\"),\n span({className: \"ic-token-label\"}, this.props.name)\n )\n )\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/token.js\n **/","module.exports = addClass;\n\nfunction addClass(existing, added) {\n if (!existing) return added;\n if (existing.indexOf(added) > -1) return existing;\n return existing + ' ' + added;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/add-class.js\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/lib/combobox.js b/lib/combobox.js index 45a3fc4..9508d54 100644 --- a/lib/combobox.js +++ b/lib/combobox.js @@ -41,7 +41,8 @@ module.exports = React.createClass({ autocomplete: 'both', onInput: k, onSelect: k, - value: null + value: null, + showListOnFocus: false }; }, @@ -146,6 +147,12 @@ module.exports = React.createClass({ }.bind(this)); }, + handleInputFocus: function() { + if (this.props.showListOnFocus){ + this.showList() + } + }, + handleInputBlur: function() { var focusedAnOption = this.state.focusedIndex != null; if (focusedAnOption) @@ -159,6 +166,7 @@ module.exports = React.createClass({ this.blurTimer = setTimeout(this.hideList, 0); }, + handleOptionFocus: function() { // see `handleOptionBlur` clearTimeout(this.blurTimer); @@ -368,6 +376,7 @@ module.exports = React.createClass({ 'aria-owns': this.state.listId, id: this.props.id, className: 'ic-tokeninput-input', + onFocus: this.handleInputFocus, onChange: this.handleInputChange, onBlur: this.handleInputBlur, onKeyDown: this.handleKeydown, diff --git a/lib/main.js b/lib/main.js index d40e9b5..dc796df 100644 --- a/lib/main.js +++ b/lib/main.js @@ -11,7 +11,8 @@ module.exports = React.createClass({ onSelect: React.PropTypes.func.isRequired, onRemove: React.PropTypes.func.isRequired, selected: React.PropTypes.array.isRequired, - menuContent: React.PropTypes.any + menuContent: React.PropTypes.any, + showListOnFocus: React.PropTypes.bool }, getInitialState: function() { @@ -63,6 +64,7 @@ module.exports = React.createClass({ id: this.props.id, ariaLabel: this.props['combobox-aria-label'], onInput: this.handleInput, + showListOnFocus: this.props.showListOnFocus, onSelect: this.handleSelect, onRemoveLast: this.handleRemoveLast, value: this.state.selectedToken From 916809b9e6ba45a496cdabda2a94f976f6ada1b2 Mon Sep 17 00:00:00 2001 From: Michael Nomitch Date: Mon, 27 Apr 2015 14:37:00 -0500 Subject: [PATCH 12/62] version bump to 0.3.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1530533..7660d50 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-tokeninput", - "version": "0.3.4", + "version": "0.3.5", "description": "Tokeninput component for React", "main": "index.js", "scripts": { From 9ffa8dd4948ee7fe7d4a0283d1ec7f72c1392209 Mon Sep 17 00:00:00 2001 From: Michael Nomitch Date: Fri, 15 May 2015 10:41:59 -0500 Subject: [PATCH 13/62] 0.3.6 - fix click and blur bugs --- dist/react-tokeninput.js | 158 +++---- dist/react-tokeninput.js.map | 2 +- dist/react-tokeninput.min.js | 684 ++++++++++++++++++++++++++++++- dist/react-tokeninput.min.js.map | 2 +- lib/combobox.js | 14 +- package.json | 2 +- 6 files changed, 784 insertions(+), 78 deletions(-) diff --git a/dist/react-tokeninput.js b/dist/react-tokeninput.js index 4cd86be..e60158e 100644 --- a/dist/react-tokeninput.js +++ b/dist/react-tokeninput.js @@ -7,7 +7,7 @@ exports["TokenInput"] = factory(require("react")); else root["TokenInput"] = factory(root["React"]); -})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) { +})(this, function(__WEBPACK_EXTERNAL_MODULE_2__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -55,7 +55,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ function(module, exports, __webpack_require__) { var TokenInput = __webpack_require__(1) - TokenInput.Option = __webpack_require__(2) + TokenInput.Option = __webpack_require__(5) module.exports = TokenInput @@ -64,14 +64,14 @@ return /******/ (function(modules) { // webpackBootstrap /* 1 */ /***/ function(module, exports, __webpack_require__) { - var React = __webpack_require__(3); - var Combobox = React.createFactory(__webpack_require__(4)); - var Token = React.createFactory(__webpack_require__(5)); + var React = __webpack_require__(2); + var Combobox = React.createFactory(__webpack_require__(3)); + var Token = React.createFactory(__webpack_require__(6)); var ul = React.createFactory('ul'); var li = React.createFactory('li'); - module.exports = React.createClass({displayName: "exports", + module.exports = React.createClass({displayName: "module.exports", propTypes: { onInput: React.PropTypes.func, onSelect: React.PropTypes.func.isRequired, @@ -147,69 +147,23 @@ return /******/ (function(modules) { // webpackBootstrap /* 2 */ /***/ function(module, exports, __webpack_require__) { - var React = __webpack_require__(3); - var addClass = __webpack_require__(6); - var div = React.createFactory('div'); - - module.exports = React.createClass({displayName: "exports", - - propTypes: { - - /** - * The value that will be sent to the `onSelect` handler of the - * parent Combobox. - */ - value: React.PropTypes.any.isRequired, - - /** - * What value to put into the input element when this option is - * selected, defaults to its children coerced to a string. - */ - label: React.PropTypes.string - }, - - getDefaultProps: function() { - return { - role: 'option', - tabIndex: '-1', - className: 'ic-tokeninput-option', - isSelected: false - }; - }, - - render: function() { - var props = this.props; - if (props.isSelected) { - props.className = addClass(props.className, 'ic-tokeninput-selected'); - props.ariaSelected = true; - } - return div(props); - } - - }); - + module.exports = __WEBPACK_EXTERNAL_MODULE_2__; /***/ }, /* 3 */ /***/ function(module, exports, __webpack_require__) { - module.exports = __WEBPACK_EXTERNAL_MODULE_3__; - -/***/ }, -/* 4 */ -/***/ function(module, exports, __webpack_require__) { - - var React = __webpack_require__(3); + var React = __webpack_require__(2); var guid = 0; var k = function(){}; - var addClass = __webpack_require__(6); - var ComboboxOption = React.createFactory(__webpack_require__(2)); + var addClass = __webpack_require__(4); + var ComboboxOption = React.createFactory(__webpack_require__(5)); var div = React.createFactory('div'); var span = React.createFactory('span'); var input = React.createFactory('input'); - module.exports = React.createClass({displayName: "exports", + module.exports = React.createClass({displayName: "module.exports", propTypes: { /** @@ -349,6 +303,14 @@ return /******/ (function(modules) { // webpackBootstrap }, handleInputFocus: function() { + this.maybeShowList(); + }, + + handleInputClick: function() { + this.maybeShowList(); + }, + + maybeShowList: function(){ if (this.props.showListOnFocus){ this.showList() } @@ -395,7 +357,10 @@ return /******/ (function(modules) { // webpackBootstrap }, hideList: function() { - this.setState({isOpen: false}); + this.setState({ + isOpen: false, + focusedIndex: null + }); }, hideOnEscape: function(event) { @@ -578,6 +543,7 @@ return /******/ (function(modules) { // webpackBootstrap id: this.props.id, className: 'ic-tokeninput-input', onFocus: this.handleInputFocus, + onClick: this.handleInputClick, onChange: this.handleInputChange, onBlur: this.handleInputBlur, onKeyDown: this.handleKeydown, @@ -614,15 +580,74 @@ return /******/ (function(modules) { // webpackBootstrap } +/***/ }, +/* 4 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = addClass; + + function addClass(existing, added) { + if (!existing) return added; + if (existing.indexOf(added) > -1) return existing; + return existing + ' ' + added; + } + + /***/ }, /* 5 */ /***/ function(module, exports, __webpack_require__) { - var React = __webpack_require__(3); + var React = __webpack_require__(2); + var addClass = __webpack_require__(4); + var div = React.createFactory('div'); + + module.exports = React.createClass({displayName: "module.exports", + + propTypes: { + + /** + * The value that will be sent to the `onSelect` handler of the + * parent Combobox. + */ + value: React.PropTypes.any.isRequired, + + /** + * What value to put into the input element when this option is + * selected, defaults to its children coerced to a string. + */ + label: React.PropTypes.string + }, + + getDefaultProps: function() { + return { + role: 'option', + tabIndex: '-1', + className: 'ic-tokeninput-option', + isSelected: false + }; + }, + + render: function() { + var props = this.props; + if (props.isSelected) { + props.className = addClass(props.className, 'ic-tokeninput-selected'); + props.ariaSelected = true; + } + return div(props); + } + + }); + + +/***/ }, +/* 6 */ +/***/ function(module, exports, __webpack_require__) { + + var React = __webpack_require__(2); var span = React.DOM.span; var li = React.createFactory('li'); - module.exports = React.createClass({displayName: "exports", + module.exports = React.createClass({displayName: "module.exports", handleClick: function() { this.props.onRemove(this.props.value) }, @@ -652,19 +677,6 @@ return /******/ (function(modules) { // webpackBootstrap }) -/***/ }, -/* 6 */ -/***/ function(module, exports, __webpack_require__) { - - module.exports = addClass; - - function addClass(existing, added) { - if (!existing) return added; - if (existing.indexOf(added) > -1) return existing; - return existing + ' ' + added; - } - - /***/ } /******/ ]) }); diff --git a/dist/react-tokeninput.js.map b/dist/react-tokeninput.js.map index 95ef766..99217bb 100644 --- a/dist/react-tokeninput.js.map +++ b/dist/react-tokeninput.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 174075feb8b4dabd9215","webpack:///./index.js","webpack:///./lib/main.js","webpack:///./lib/option.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///./lib/combobox.js","webpack:///./lib/token.js","webpack:///./lib/add-class.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACtCA,KAAI,UAAU,GAAG,mBAAO,CAAC,CAAY,CAAC;AACtC,WAAU,CAAC,MAAM,GAAG,mBAAO,CAAC,CAAc,CAAC;;AAE3C,OAAM,CAAC,OAAO,GAAG,UAAU;;;;;;;ACH3B,KAAI,KAAK,GAAG,mBAAO,CAAC,CAAO,CAAC,CAAC;AAC7B,KAAI,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,mBAAO,CAAC,CAAY,CAAC,CAAC,CAAC;AAC1D,KAAI,KAAK,GAAG,KAAK,CAAC,aAAa,CAAC,mBAAO,CAAC,CAAS,CAAC,CAAC,CAAC;;AAEpD,KAAI,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;AACnC,KAAI,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;;AAEnC,qCAAoC;GAClC,SAAS,EAAE;KACT,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI;KAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU;KACzC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU;KACzC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU;KAC1C,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG;KAChC,eAAe,EAA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AAC,KAAK,CAAC,KAAK,CAAC;AACtE,IAAG;;GAED,MAAM,EAAE,WAAW;KACjB;OACE,EAAE,CAAC;SACD,SAAS,EAAE,sBAAsB;QAClC;SACC,IAAI,CAAC;WACH,IAAI,EAAE,QAAQ;WACd,OAAO,EAAE,IAAI,CAAC,WAAW;WACzB,SAAS,EAAE,IAAI,CAAC,aAAa;WAC7B,YAAY,EAAE,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI;WAClD,SAAS,EAAE,wBAAwB;WACnC,QAAQ,EAAE,CAAC;UACZ,EAAE,GAAG,CAAC;SACP,IAAI,CAAC,CAAC,SAAS,EAAE,gBAAgB,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;QACrD;MACF;IACF;EACF,CAAC;;;;;;;AC/BF,OAAM,CAAC,OAAO,GAAG,QAAQ,CAAC;;AAE1B,UAAS,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAE;GACjC,IAAI,CAAC,QAAQ,EAAE,OAAO,KAAK,CAAC;GAC5B,IAAI,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,QAAQ,CAAC;GAClD,OAAO,QAAQ,GAAG,GAAG,GAAG,KAAK,CAAC;EAC/B","file":"react-tokeninput.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TokenInput\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"TokenInput\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 174075feb8b4dabd9215\n **/","var TokenInput = require('./lib/main')\nTokenInput.Option = require('./lib/option')\n\nmodule.exports = TokenInput\n\n\n\n/** WEBPACK FOOTER **\n ** ./index.js\n **/","var React = require('react');\nvar Combobox = React.createFactory(require('./combobox'));\nvar Token = React.createFactory(require('./token'));\n\nvar ul = React.createFactory('ul');\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n propTypes: {\n onInput: React.PropTypes.func,\n onSelect: React.PropTypes.func.isRequired,\n onRemove: React.PropTypes.func.isRequired,\n selected: React.PropTypes.array.isRequired,\n menuContent: React.PropTypes.any,\n showListOnFocus: React.PropTypes.bool\n },\n\n getInitialState: function() {\n return {\n selectedToken: null\n };\n },\n\n handleClick: function() {\n // TODO: Expand combobox API for focus\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleInput: function(event) {\n this.props.onInput(event);\n },\n\n handleSelect: function(event) {\n this.props.onSelect(event)\n this.setState({\n selectedToken: null\n })\n },\n\n handleRemove: function(value) {\n this.props.onRemove(value);\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleRemoveLast: function() {\n this.props.onRemove(this.props.selected[this.props.selected.length - 1]);\n },\n\n render: function() {\n var tokens = this.props.selected.map(function(token) {\n return (\n Token({\n onRemove: this.handleRemove,\n value: token,\n name: token.name,\n key: token.id})\n )\n }.bind(this))\n\n return ul({className: 'ic-tokens flex', onClick: this.handleClick},\n tokens,\n li({className: 'inline-flex', ref: 'combo-li'},\n Combobox({\n id: this.props.id,\n ariaLabel: this.props['combobox-aria-label'],\n onInput: this.handleInput,\n showListOnFocus: this.props.showListOnFocus,\n onSelect: this.handleSelect,\n onRemoveLast: this.handleRemoveLast,\n value: this.state.selectedToken\n },\n this.props.menuContent\n )\n )\n );\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/main.js\n **/","var React = require('react');\nvar addClass = require('./add-class');\nvar div = React.createFactory('div');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n\n /**\n * The value that will be sent to the `onSelect` handler of the\n * parent Combobox.\n */\n value: React.PropTypes.any.isRequired,\n\n /**\n * What value to put into the input element when this option is\n * selected, defaults to its children coerced to a string.\n */\n label: React.PropTypes.string\n },\n\n getDefaultProps: function() {\n return {\n role: 'option',\n tabIndex: '-1',\n className: 'ic-tokeninput-option',\n isSelected: false\n };\n },\n\n render: function() {\n var props = this.props;\n if (props.isSelected) {\n props.className = addClass(props.className, 'ic-tokeninput-selected');\n props.ariaSelected = true;\n }\n return div(props);\n }\n\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/option.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n ** module id = 3\n ** module chunks = 0\n **/","var React = require('react');\nvar guid = 0;\nvar k = function(){};\nvar addClass = require('./add-class');\nvar ComboboxOption = React.createFactory(require('./option'));\n\nvar div = React.createFactory('div');\nvar span = React.createFactory('span');\nvar input = React.createFactory('input');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n /**\n * Called when the combobox receives user input, this is your chance to\n * filter the data and rerender the options.\n *\n * Signature:\n *\n * ```js\n * function(userInput){}\n * ```\n */\n onInput: React.PropTypes.func,\n\n /**\n * Called when the combobox receives a selection. You probably want to reset\n * the options to the full list at this point.\n *\n * Signature:\n *\n * ```js\n * function(selectedValue){}\n * ```\n */\n onSelect: React.PropTypes.func\n },\n\n getDefaultProps: function() {\n return {\n autocomplete: 'both',\n onInput: k,\n onSelect: k,\n value: null,\n showListOnFocus: false\n };\n },\n\n getInitialState: function() {\n return {\n value: this.props.value,\n // the value displayed in the input\n inputValue: this.findInitialInputValue(),\n isOpen: false,\n focusedIndex: null,\n matchedAutocompleteOption: null,\n // this prevents crazy jumpiness since we focus options on mouseenter\n usingKeyboard: false,\n activedescendant: null,\n listId: 'ic-tokeninput-list-'+(++guid),\n menu: {\n children: [],\n activedescendant: null,\n isEmpty: true\n }\n };\n },\n\n componentWillMount: function() {\n this.setState({menu: this.makeMenu()});\n },\n\n componentWillReceiveProps: function(newProps) {\n this.setState({menu: this.makeMenu(newProps.children)}, function() {\n if(newProps.children.length && (this.isOpen || document.activeElement === this.refs.input.getDOMNode())) {\n this.showList();\n } else {\n this.hideList();\n }\n\n }.bind(this));\n },\n\n /**\n * We don't create the components, the user supplies them,\n * so before rendering we attach handlers to facilitate communication from\n * the ComboboxOption to the Combobox.\n */\n makeMenu: function(children) {\n var activedescendant;\n var isEmpty = true;\n children = children || this.props.children;\n\n // Should this instead use React.addons.cloneWithProps or React.cloneElement?\n React.Children.forEach(children, function(child, index) {\n if (child.type !== ComboboxOption.type)\n // allow random elements to live in this list\n return;\n isEmpty = false;\n // TODO: cloneWithProps and map instead of altering the children in-place\n var props = child.props;\n if (this.state.value === props.value) {\n // need an ID for WAI-ARIA\n props.id = props.id || 'ic-tokeninput-selected-'+(++guid);\n props.isSelected = true\n activedescendant = props.id;\n }\n props.onBlur = this.handleOptionBlur;\n props.onClick = this.selectOption.bind(this, child);\n props.onFocus = this.handleOptionFocus;\n props.onKeyDown = this.handleOptionKeyDown.bind(this, child);\n props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index);\n }.bind(this));\n\n return {\n children: children,\n activedescendant: activedescendant,\n isEmpty: isEmpty\n };\n },\n\n getClassName: function() {\n var className = addClass(this.props.className, 'ic-tokeninput');\n if (this.state.isOpen)\n className = addClass(className, 'ic-tokeninput-is-open');\n return className;\n },\n\n /**\n * When the user begins typing again we need to clear out any state that has\n * to do with an existing or potential selection.\n */\n clearSelectedState: function(cb) {\n this.setState({\n focusedIndex: null,\n inputValue: null,\n value: null,\n matchedAutocompleteOption: null,\n activedescendant: null\n }, cb);\n },\n\n handleInputChange: function(event) {\n var value = this.refs.input.getDOMNode().value;\n this.clearSelectedState(function() {\n this.props.onInput(value);\n }.bind(this));\n },\n\n handleInputFocus: function() {\n if (this.props.showListOnFocus){\n this.showList()\n }\n },\n\n handleInputBlur: function() {\n var focusedAnOption = this.state.focusedIndex != null;\n if (focusedAnOption)\n return;\n this.maybeSelectAutocompletedOption();\n this.hideList();\n },\n\n handleOptionBlur: function() {\n // don't want to hide the list if we focused another option\n this.blurTimer = setTimeout(this.hideList, 0);\n },\n\n\n handleOptionFocus: function() {\n // see `handleOptionBlur`\n clearTimeout(this.blurTimer);\n },\n\n handleInputKeyUp: function(event) {\n if (\n this.state.menu.isEmpty ||\n // autocompleting while backspacing feels super weird, so let's not\n event.keyCode === 8 /*backspace*/ ||\n !this.props.autocomplete.match(/both|inline/)\n ) return;\n },\n\n handleButtonClick: function() {\n this.state.isOpen ? this.hideList() : this.showList();\n this.focusInput();\n },\n\n showList: function() {\n if(!this.state.menu.children.length) {\n return\n }\n this.setState({isOpen: true})\n },\n\n hideList: function() {\n this.setState({isOpen: false});\n },\n\n hideOnEscape: function(event) {\n this.hideList();\n this.focusInput();\n event.preventDefault();\n },\n\n focusInput: function() {\n this.refs.input.getDOMNode().focus();\n },\n\n selectInput: function() {\n this.refs.input.getDOMNode().select();\n },\n\n inputKeydownMap: {\n 8: 'removeLastToken',\n 13: 'selectOnEnter',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n optionKeydownMap: {\n 13: 'selectOption',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n handleKeydown: function(event) {\n var handlerName = this.inputKeydownMap[event.keyCode];\n if (!handlerName)\n return\n this.setState({usingKeyboard: true});\n return this[handlerName].call(this,event);\n },\n\n handleOptionKeyDown: function(child, event) {\n var handlerName = this.optionKeydownMap[event.keyCode];\n if (!handlerName) {\n // if the user starts typing again while focused on an option, move focus\n // to the inpute, select so it wipes out any existing value\n this.selectInput();\n return;\n }\n event.preventDefault();\n this.setState({usingKeyboard: true});\n this[handlerName].call(this, child);\n },\n\n handleOptionMouseEnter: function(index) {\n if (this.state.usingKeyboard)\n this.setState({usingKeyboard: false});\n else\n this.focusOptionAtIndex(index);\n },\n\n selectOnEnter: function(event) {\n event.preventDefault();\n this.maybeSelectAutocompletedOption()\n },\n\n maybeSelectAutocompletedOption: function() {\n if (!this.state.matchedAutocompleteOption) {\n this.selectText()\n } else {\n this.selectOption(this.state.matchedAutocompleteOption, {focus: false});\n }\n },\n\n selectOption: function(child, options) {\n options = options || {};\n this.setState({\n // value: child.props.value,\n // inputValue: getLabel(child),\n matchedAutocompleteOption: null\n }, function() {\n this.props.onSelect(child.props.value, child);\n this.hideList();\n this.clearSelectedState(); // added\n if (options.focus !== false)\n this.selectInput();\n }.bind(this));\n this.refs.input.getDOMNode().value = '' // added\n },\n\n selectText: function() {\n var value = this.refs.input.getDOMNode().value;\n if(!value) return;\n this.props.onSelect(value);\n this.clearSelectedState();\n this.refs.input.getDOMNode().value = '' // added\n },\n\n focusNext: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var index = this.state.focusedIndex == null ?\n 0 : this.state.focusedIndex + 1;\n this.focusOptionAtIndex(index);\n },\n\n removeLastToken: function() {\n if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) {\n this.props.onRemoveLast()\n }\n return true\n },\n\n focusPrevious: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var last = this.props.children.length - 1;\n var index = this.state.focusedIndex == null ?\n last : this.state.focusedIndex - 1;\n this.focusOptionAtIndex(index);\n },\n\n focusSelectedOption: function() {\n var selectedIndex;\n React.Children.forEach(this.props.children, function(child, index) {\n if (child.props.value === this.state.value)\n selectedIndex = index;\n }.bind(this));\n this.showList();\n this.setState({\n focusedIndex: selectedIndex\n }, this.focusOption);\n },\n\n findInitialInputValue: function() {\n // TODO: might not need this, we should know this in `makeMenu`\n var inputValue;\n React.Children.forEach(this.props.children, function(child) {\n if (child.props.value === this.props.value)\n inputValue = getLabel(child);\n }.bind(this));\n return inputValue;\n },\n\n focusOptionAtIndex: function(index) {\n if (!this.state.isOpen && this.state.value)\n return this.focusSelectedOption();\n this.showList();\n var length = this.props.children.length;\n if (index === -1)\n index = length - 1;\n else if (index === length)\n index = 0;\n this.setState({\n focusedIndex: index\n }, this.focusOption);\n },\n\n focusOption: function() {\n var index = this.state.focusedIndex;\n this.refs.list.getDOMNode().childNodes[index].focus();\n },\n\n render: function() {\n var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' +\n 'Press the down arrow to navigate results. If you don\\'t find an ' +\n 'acceptable option, you can enter an alternative.'\n\n return div({className: this.getClassName()},\n this.props.value,\n this.state.inputValue,\n input({\n ref: 'input',\n autoComplete: 'off',\n spellCheck: 'false',\n 'aria-label': ariaLabel,\n 'aria-expanded': this.state.isOpen+'',\n 'aria-haspopup': 'true',\n 'aria-activedescendant': this.state.menu.activedescendant,\n 'aria-autocomplete': 'list',\n 'aria-owns': this.state.listId,\n id: this.props.id,\n className: 'ic-tokeninput-input',\n onFocus: this.handleInputFocus,\n onChange: this.handleInputChange,\n onBlur: this.handleInputBlur,\n onKeyDown: this.handleKeydown,\n onKeyUp: this.handleInputKeyUp,\n role: 'combobox'\n }),\n span({\n 'aria-hidden': 'true',\n className: 'ic-tokeninput-button',\n onClick: this.handleButtonClick\n }, '▾'),\n div({\n id: this.state.listId,\n ref: 'list',\n className: 'ic-tokeninput-list',\n role: 'listbox'\n }, this.state.menu.children)\n );\n }\n});\n\nfunction getLabel(component) {\n return component.props.label || component.props.children;\n}\n\nfunction matchFragment(userInput, firstChildLabel) {\n userInput = userInput.toLowerCase();\n firstChildLabel = firstChildLabel.toLowerCase();\n if (userInput === '' || userInput === firstChildLabel)\n return false;\n if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1)\n return false;\n return true;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/combobox.js\n **/","var React = require('react');\nvar span = React.DOM.span;\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n handleClick: function() {\n this.props.onRemove(this.props.value)\n },\n\n handleKeyDown: function(key) {\n var enterKey = 13;\n if(key.keyCode === enterKey) this.props.onRemove(this.props.value)\n },\n\n render: function() {\n return (\n li({\n className: \"ic-token inline-flex\"\n },\n span({\n role: 'button',\n onClick: this.handleClick,\n onKeyDown: this.handleKeyDown,\n 'aria-label': 'Remove \\'' + this.props.name + '\\'',\n className: \"ic-token-delete-button\",\n tabIndex: 0\n }, \"✕\"),\n span({className: \"ic-token-label\"}, this.props.name)\n )\n )\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/token.js\n **/","module.exports = addClass;\n\nfunction addClass(existing, added) {\n if (!existing) return added;\n if (existing.indexOf(added) > -1) return existing;\n return existing + ' ' + added;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/add-class.js\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 6bbe8d343f8f84db3e12","webpack:///./index.js","webpack:///./lib/main.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///./lib/combobox.js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;AAC7B,KAAI,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;AAC1B,KAAI,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;;AAEnC,qCAAoC;GAClC,WAAW,EAAE,WAAW;KACtB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;AACzC,IAAG;;GAED,aAAa,EAAE,SAAS,GAAG,EAAE;KAC3B,IAAI,QAAQ,GAAG,EAAE,CAAC;KAClB,GAAG,GAAG,CAAC,OAAO,KAAK,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;AACtE,IAAG;;GAED,MAAM,EAAE,WAAW;KACjB;OACE,EAAE,CAAC;SACD,SAAS,EAAE,sBAAsB;QAClC;SACC,IAAI,CAAC;WACH,IAAI,EAAE,QAAQ;WACd,OAAO,EAAE,IAAI,CAAC,WAAW;WACzB,SAAS,EAAE,IAAI,CAAC,aAAa;WAC7B,YAAY,EAAE,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI;WAClD,SAAS,EAAE,wBAAwB;WACnC,QAAQ,EAAE,CAAC;UACZ,EAAE,GAAG,CAAC;SACP,IAAI,CAAC,CAAC,SAAS,EAAE,gBAAgB,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;QACrD;MACF;IACF;EACF,CAAC","file":"react-tokeninput.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TokenInput\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"TokenInput\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 6bbe8d343f8f84db3e12\n **/","var TokenInput = require('./lib/main')\nTokenInput.Option = require('./lib/option')\n\nmodule.exports = TokenInput\n\n\n\n/** WEBPACK FOOTER **\n ** ./index.js\n **/","var React = require('react');\nvar Combobox = React.createFactory(require('./combobox'));\nvar Token = React.createFactory(require('./token'));\n\nvar ul = React.createFactory('ul');\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n propTypes: {\n onInput: React.PropTypes.func,\n onSelect: React.PropTypes.func.isRequired,\n onRemove: React.PropTypes.func.isRequired,\n selected: React.PropTypes.array.isRequired,\n menuContent: React.PropTypes.any,\n showListOnFocus: React.PropTypes.bool\n },\n\n getInitialState: function() {\n return {\n selectedToken: null\n };\n },\n\n handleClick: function() {\n // TODO: Expand combobox API for focus\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleInput: function(event) {\n this.props.onInput(event);\n },\n\n handleSelect: function(event) {\n this.props.onSelect(event)\n this.setState({\n selectedToken: null\n })\n },\n\n handleRemove: function(value) {\n this.props.onRemove(value);\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleRemoveLast: function() {\n this.props.onRemove(this.props.selected[this.props.selected.length - 1]);\n },\n\n render: function() {\n var tokens = this.props.selected.map(function(token) {\n return (\n Token({\n onRemove: this.handleRemove,\n value: token,\n name: token.name,\n key: token.id})\n )\n }.bind(this))\n\n return ul({className: 'ic-tokens flex', onClick: this.handleClick},\n tokens,\n li({className: 'inline-flex', ref: 'combo-li'},\n Combobox({\n id: this.props.id,\n ariaLabel: this.props['combobox-aria-label'],\n onInput: this.handleInput,\n showListOnFocus: this.props.showListOnFocus,\n onSelect: this.handleSelect,\n onRemoveLast: this.handleRemoveLast,\n value: this.state.selectedToken\n },\n this.props.menuContent\n )\n )\n );\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/main.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n ** module id = 2\n ** module chunks = 0\n **/","var React = require('react');\nvar guid = 0;\nvar k = function(){};\nvar addClass = require('./add-class');\nvar ComboboxOption = React.createFactory(require('./option'));\n\nvar div = React.createFactory('div');\nvar span = React.createFactory('span');\nvar input = React.createFactory('input');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n /**\n * Called when the combobox receives user input, this is your chance to\n * filter the data and rerender the options.\n *\n * Signature:\n *\n * ```js\n * function(userInput){}\n * ```\n */\n onInput: React.PropTypes.func,\n\n /**\n * Called when the combobox receives a selection. You probably want to reset\n * the options to the full list at this point.\n *\n * Signature:\n *\n * ```js\n * function(selectedValue){}\n * ```\n */\n onSelect: React.PropTypes.func\n },\n\n getDefaultProps: function() {\n return {\n autocomplete: 'both',\n onInput: k,\n onSelect: k,\n value: null,\n showListOnFocus: false\n };\n },\n\n getInitialState: function() {\n return {\n value: this.props.value,\n // the value displayed in the input\n inputValue: this.findInitialInputValue(),\n isOpen: false,\n focusedIndex: null,\n matchedAutocompleteOption: null,\n // this prevents crazy jumpiness since we focus options on mouseenter\n usingKeyboard: false,\n activedescendant: null,\n listId: 'ic-tokeninput-list-'+(++guid),\n menu: {\n children: [],\n activedescendant: null,\n isEmpty: true\n }\n };\n },\n\n componentWillMount: function() {\n this.setState({menu: this.makeMenu()});\n },\n\n componentWillReceiveProps: function(newProps) {\n this.setState({menu: this.makeMenu(newProps.children)}, function() {\n if(newProps.children.length && (this.isOpen || document.activeElement === this.refs.input.getDOMNode())) {\n this.showList();\n } else {\n this.hideList();\n }\n\n }.bind(this));\n },\n\n /**\n * We don't create the components, the user supplies them,\n * so before rendering we attach handlers to facilitate communication from\n * the ComboboxOption to the Combobox.\n */\n makeMenu: function(children) {\n var activedescendant;\n var isEmpty = true;\n children = children || this.props.children;\n\n // Should this instead use React.addons.cloneWithProps or React.cloneElement?\n React.Children.forEach(children, function(child, index) {\n if (child.type !== ComboboxOption.type)\n // allow random elements to live in this list\n return;\n isEmpty = false;\n // TODO: cloneWithProps and map instead of altering the children in-place\n var props = child.props;\n if (this.state.value === props.value) {\n // need an ID for WAI-ARIA\n props.id = props.id || 'ic-tokeninput-selected-'+(++guid);\n props.isSelected = true\n activedescendant = props.id;\n }\n props.onBlur = this.handleOptionBlur;\n props.onClick = this.selectOption.bind(this, child);\n props.onFocus = this.handleOptionFocus;\n props.onKeyDown = this.handleOptionKeyDown.bind(this, child);\n props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index);\n }.bind(this));\n\n return {\n children: children,\n activedescendant: activedescendant,\n isEmpty: isEmpty\n };\n },\n\n getClassName: function() {\n var className = addClass(this.props.className, 'ic-tokeninput');\n if (this.state.isOpen)\n className = addClass(className, 'ic-tokeninput-is-open');\n return className;\n },\n\n /**\n * When the user begins typing again we need to clear out any state that has\n * to do with an existing or potential selection.\n */\n clearSelectedState: function(cb) {\n this.setState({\n focusedIndex: null,\n inputValue: null,\n value: null,\n matchedAutocompleteOption: null,\n activedescendant: null\n }, cb);\n },\n\n handleInputChange: function(event) {\n var value = this.refs.input.getDOMNode().value;\n this.clearSelectedState(function() {\n this.props.onInput(value);\n }.bind(this));\n },\n\n handleInputFocus: function() {\n this.maybeShowList();\n },\n\n handleInputClick: function() {\n this.maybeShowList();\n },\n\n maybeShowList: function(){\n if (this.props.showListOnFocus){\n this.showList()\n }\n },\n\n handleInputBlur: function() {\n var focusedAnOption = this.state.focusedIndex != null;\n if (focusedAnOption)\n return;\n this.maybeSelectAutocompletedOption();\n this.hideList();\n },\n\n handleOptionBlur: function() {\n // don't want to hide the list if we focused another option\n this.blurTimer = setTimeout(this.hideList, 0);\n },\n\n\n handleOptionFocus: function() {\n // see `handleOptionBlur`\n clearTimeout(this.blurTimer);\n },\n\n handleInputKeyUp: function(event) {\n if (\n this.state.menu.isEmpty ||\n // autocompleting while backspacing feels super weird, so let's not\n event.keyCode === 8 /*backspace*/ ||\n !this.props.autocomplete.match(/both|inline/)\n ) return;\n },\n\n handleButtonClick: function() {\n this.state.isOpen ? this.hideList() : this.showList();\n this.focusInput();\n },\n\n showList: function() {\n if(!this.state.menu.children.length) {\n return\n }\n this.setState({isOpen: true})\n },\n\n hideList: function() {\n this.setState({\n isOpen: false,\n focusedIndex: null\n });\n },\n\n hideOnEscape: function(event) {\n this.hideList();\n this.focusInput();\n event.preventDefault();\n },\n\n focusInput: function() {\n this.refs.input.getDOMNode().focus();\n },\n\n selectInput: function() {\n this.refs.input.getDOMNode().select();\n },\n\n inputKeydownMap: {\n 8: 'removeLastToken',\n 13: 'selectOnEnter',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n optionKeydownMap: {\n 13: 'selectOption',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n handleKeydown: function(event) {\n var handlerName = this.inputKeydownMap[event.keyCode];\n if (!handlerName)\n return\n this.setState({usingKeyboard: true});\n return this[handlerName].call(this,event);\n },\n\n handleOptionKeyDown: function(child, event) {\n var handlerName = this.optionKeydownMap[event.keyCode];\n if (!handlerName) {\n // if the user starts typing again while focused on an option, move focus\n // to the inpute, select so it wipes out any existing value\n this.selectInput();\n return;\n }\n event.preventDefault();\n this.setState({usingKeyboard: true});\n this[handlerName].call(this, child);\n },\n\n handleOptionMouseEnter: function(index) {\n if (this.state.usingKeyboard)\n this.setState({usingKeyboard: false});\n else\n this.focusOptionAtIndex(index);\n },\n\n selectOnEnter: function(event) {\n event.preventDefault();\n this.maybeSelectAutocompletedOption()\n },\n\n maybeSelectAutocompletedOption: function() {\n if (!this.state.matchedAutocompleteOption) {\n this.selectText()\n } else {\n this.selectOption(this.state.matchedAutocompleteOption, {focus: false});\n }\n },\n\n selectOption: function(child, options) {\n options = options || {};\n this.setState({\n // value: child.props.value,\n // inputValue: getLabel(child),\n matchedAutocompleteOption: null\n }, function() {\n this.props.onSelect(child.props.value, child);\n this.hideList();\n this.clearSelectedState(); // added\n if (options.focus !== false)\n this.selectInput();\n }.bind(this));\n this.refs.input.getDOMNode().value = '' // added\n },\n\n selectText: function() {\n var value = this.refs.input.getDOMNode().value;\n if(!value) return;\n this.props.onSelect(value);\n this.clearSelectedState();\n this.refs.input.getDOMNode().value = '' // added\n },\n\n focusNext: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var index = this.state.focusedIndex == null ?\n 0 : this.state.focusedIndex + 1;\n this.focusOptionAtIndex(index);\n },\n\n removeLastToken: function() {\n if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) {\n this.props.onRemoveLast()\n }\n return true\n },\n\n focusPrevious: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var last = this.props.children.length - 1;\n var index = this.state.focusedIndex == null ?\n last : this.state.focusedIndex - 1;\n this.focusOptionAtIndex(index);\n },\n\n focusSelectedOption: function() {\n var selectedIndex;\n React.Children.forEach(this.props.children, function(child, index) {\n if (child.props.value === this.state.value)\n selectedIndex = index;\n }.bind(this));\n this.showList();\n this.setState({\n focusedIndex: selectedIndex\n }, this.focusOption);\n },\n\n findInitialInputValue: function() {\n // TODO: might not need this, we should know this in `makeMenu`\n var inputValue;\n React.Children.forEach(this.props.children, function(child) {\n if (child.props.value === this.props.value)\n inputValue = getLabel(child);\n }.bind(this));\n return inputValue;\n },\n\n focusOptionAtIndex: function(index) {\n if (!this.state.isOpen && this.state.value)\n return this.focusSelectedOption();\n this.showList();\n var length = this.props.children.length;\n if (index === -1)\n index = length - 1;\n else if (index === length)\n index = 0;\n this.setState({\n focusedIndex: index\n }, this.focusOption);\n },\n\n focusOption: function() {\n var index = this.state.focusedIndex;\n this.refs.list.getDOMNode().childNodes[index].focus();\n },\n\n render: function() {\n var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' +\n 'Press the down arrow to navigate results. If you don\\'t find an ' +\n 'acceptable option, you can enter an alternative.'\n\n return div({className: this.getClassName()},\n this.props.value,\n this.state.inputValue,\n input({\n ref: 'input',\n autoComplete: 'off',\n spellCheck: 'false',\n 'aria-label': ariaLabel,\n 'aria-expanded': this.state.isOpen+'',\n 'aria-haspopup': 'true',\n 'aria-activedescendant': this.state.menu.activedescendant,\n 'aria-autocomplete': 'list',\n 'aria-owns': this.state.listId,\n id: this.props.id,\n className: 'ic-tokeninput-input',\n onFocus: this.handleInputFocus,\n onClick: this.handleInputClick,\n onChange: this.handleInputChange,\n onBlur: this.handleInputBlur,\n onKeyDown: this.handleKeydown,\n onKeyUp: this.handleInputKeyUp,\n role: 'combobox'\n }),\n span({\n 'aria-hidden': 'true',\n className: 'ic-tokeninput-button',\n onClick: this.handleButtonClick\n }, '▾'),\n div({\n id: this.state.listId,\n ref: 'list',\n className: 'ic-tokeninput-list',\n role: 'listbox'\n }, this.state.menu.children)\n );\n }\n});\n\nfunction getLabel(component) {\n return component.props.label || component.props.children;\n}\n\nfunction matchFragment(userInput, firstChildLabel) {\n userInput = userInput.toLowerCase();\n firstChildLabel = firstChildLabel.toLowerCase();\n if (userInput === '' || userInput === firstChildLabel)\n return false;\n if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1)\n return false;\n return true;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/combobox.js\n **/","module.exports = addClass;\n\nfunction addClass(existing, added) {\n if (!existing) return added;\n if (existing.indexOf(added) > -1) return existing;\n return existing + ' ' + added;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/add-class.js\n **/","var React = require('react');\nvar addClass = require('./add-class');\nvar div = React.createFactory('div');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n\n /**\n * The value that will be sent to the `onSelect` handler of the\n * parent Combobox.\n */\n value: React.PropTypes.any.isRequired,\n\n /**\n * What value to put into the input element when this option is\n * selected, defaults to its children coerced to a string.\n */\n label: React.PropTypes.string\n },\n\n getDefaultProps: function() {\n return {\n role: 'option',\n tabIndex: '-1',\n className: 'ic-tokeninput-option',\n isSelected: false\n };\n },\n\n render: function() {\n var props = this.props;\n if (props.isSelected) {\n props.className = addClass(props.className, 'ic-tokeninput-selected');\n props.ariaSelected = true;\n }\n return div(props);\n }\n\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/option.js\n **/","var React = require('react');\nvar span = React.DOM.span;\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n handleClick: function() {\n this.props.onRemove(this.props.value)\n },\n\n handleKeyDown: function(key) {\n var enterKey = 13;\n if(key.keyCode === enterKey) this.props.onRemove(this.props.value)\n },\n\n render: function() {\n return (\n li({\n className: \"ic-token inline-flex\"\n },\n span({\n role: 'button',\n onClick: this.handleClick,\n onKeyDown: this.handleKeyDown,\n 'aria-label': 'Remove \\'' + this.props.name + '\\'',\n className: \"ic-token-delete-button\",\n tabIndex: 0\n }, \"✕\"),\n span({className: \"ic-token-label\"}, this.props.name)\n )\n )\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/token.js\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/react-tokeninput.min.js b/dist/react-tokeninput.min.js index 1022b3e..974fb52 100644 --- a/dist/react-tokeninput.min.js +++ b/dist/react-tokeninput.min.js @@ -1,2 +1,684 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.TokenInput=t(require("react")):e.TokenInput=t(e.React)}(this,function(e){return function(e){function t(s){if(n[s])return n[s].exports;var i=n[s]={exports:{},id:s,loaded:!1};return e[s].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var s=n(1);s.Option=n(2),e.exports=s},function(e,t,n){var s=n(3),i=s.createFactory(n(4)),o=s.createFactory(n(5)),a=s.createFactory("ul"),u=s.createFactory("li");e.exports=s.createClass({displayName:"exports",propTypes:{onInput:s.PropTypes.func,onSelect:s.PropTypes.func.isRequired,onRemove:s.PropTypes.func.isRequired,selected:s.PropTypes.array.isRequired,menuContent:s.PropTypes.any,showListOnFocus:s.PropTypes.bool},getInitialState:function(){return{selectedToken:null}},handleClick:function(){this.refs["combo-li"].getDOMNode().querySelector("input").focus()},handleInput:function(e){this.props.onInput(e)},handleSelect:function(e){this.props.onSelect(e),this.setState({selectedToken:null})},handleRemove:function(e){this.props.onRemove(e),this.refs["combo-li"].getDOMNode().querySelector("input").focus()},handleRemoveLast:function(){this.props.onRemove(this.props.selected[this.props.selected.length-1])},render:function(){var e=this.props.selected.map(function(e){return o({onRemove:this.handleRemove,value:e,name:e.name,key:e.id})}.bind(this));return a({className:"ic-tokens flex",onClick:this.handleClick},e,u({className:"inline-flex",ref:"combo-li"},i({id:this.props.id,ariaLabel:this.props["combobox-aria-label"],onInput:this.handleInput,showListOnFocus:this.props.showListOnFocus,onSelect:this.handleSelect,onRemoveLast:this.handleRemoveLast,value:this.state.selectedToken},this.props.menuContent)))}})},function(e,t,n){var s=n(3),i=n(6),o=s.createFactory("div");e.exports=s.createClass({displayName:"exports",propTypes:{value:s.PropTypes.any.isRequired,label:s.PropTypes.string},getDefaultProps:function(){return{role:"option",tabIndex:"-1",className:"ic-tokeninput-option",isSelected:!1}},render:function(){var e=this.props;return e.isSelected&&(e.className=i(e.className,"ic-tokeninput-selected"),e.ariaSelected=!0),o(e)}})},function(t,n,s){t.exports=e},function(e,t,n){function s(e){return e.props.label||e.props.children}var i=n(3),o=0,a=function(){},u=n(6),c=i.createFactory(n(2)),l=i.createFactory("div"),r=i.createFactory("span"),p=i.createFactory("input");e.exports=i.createClass({displayName:"exports",propTypes:{onInput:i.PropTypes.func,onSelect:i.PropTypes.func},getDefaultProps:function(){return{autocomplete:"both",onInput:a,onSelect:a,value:null,showListOnFocus:!1}},getInitialState:function(){return{value:this.props.value,inputValue:this.findInitialInputValue(),isOpen:!1,focusedIndex:null,matchedAutocompleteOption:null,usingKeyboard:!1,activedescendant:null,listId:"ic-tokeninput-list-"+ ++o,menu:{children:[],activedescendant:null,isEmpty:!0}}},componentWillMount:function(){this.setState({menu:this.makeMenu()})},componentWillReceiveProps:function(e){this.setState({menu:this.makeMenu(e.children)},function(){e.children.length&&(this.isOpen||document.activeElement===this.refs.input.getDOMNode())?this.showList():this.hideList()}.bind(this))},makeMenu:function(e){var t,n=!0;return e=e||this.props.children,i.Children.forEach(e,function(e,s){if(e.type===c.type){n=!1;var i=e.props;this.state.value===i.value&&(i.id=i.id||"ic-tokeninput-selected-"+ ++o,i.isSelected=!0,t=i.id),i.onBlur=this.handleOptionBlur,i.onClick=this.selectOption.bind(this,e),i.onFocus=this.handleOptionFocus,i.onKeyDown=this.handleOptionKeyDown.bind(this,e),i.onMouseEnter=this.handleOptionMouseEnter.bind(this,s)}}.bind(this)),{children:e,activedescendant:t,isEmpty:n}},getClassName:function(){var e=u(this.props.className,"ic-tokeninput");return this.state.isOpen&&(e=u(e,"ic-tokeninput-is-open")),e},clearSelectedState:function(e){this.setState({focusedIndex:null,inputValue:null,value:null,matchedAutocompleteOption:null,activedescendant:null},e)},handleInputChange:function(e){var t=this.refs.input.getDOMNode().value;this.clearSelectedState(function(){this.props.onInput(t)}.bind(this))},handleInputFocus:function(){this.props.showListOnFocus&&this.showList()},handleInputBlur:function(){var e=null!=this.state.focusedIndex;e||(this.maybeSelectAutocompletedOption(),this.hideList())},handleOptionBlur:function(){this.blurTimer=setTimeout(this.hideList,0)},handleOptionFocus:function(){clearTimeout(this.blurTimer)},handleInputKeyUp:function(e){this.state.menu.isEmpty||8===e.keyCode||!this.props.autocomplete.match(/both|inline/)},handleButtonClick:function(){this.state.isOpen?this.hideList():this.showList(),this.focusInput()},showList:function(){this.state.menu.children.length&&this.setState({isOpen:!0})},hideList:function(){this.setState({isOpen:!1})},hideOnEscape:function(e){this.hideList(),this.focusInput(),e.preventDefault()},focusInput:function(){this.refs.input.getDOMNode().focus()},selectInput:function(){this.refs.input.getDOMNode().select()},inputKeydownMap:{8:"removeLastToken",13:"selectOnEnter",27:"hideOnEscape",38:"focusPrevious",40:"focusNext"},optionKeydownMap:{13:"selectOption",27:"hideOnEscape",38:"focusPrevious",40:"focusNext"},handleKeydown:function(e){var t=this.inputKeydownMap[e.keyCode];if(t)return this.setState({usingKeyboard:!0}),this[t].call(this,e)},handleOptionKeyDown:function(e,t){var n=this.optionKeydownMap[t.keyCode];return n?(t.preventDefault(),this.setState({usingKeyboard:!0}),void this[n].call(this,e)):void this.selectInput()},handleOptionMouseEnter:function(e){this.state.usingKeyboard?this.setState({usingKeyboard:!1}):this.focusOptionAtIndex(e)},selectOnEnter:function(e){e.preventDefault(),this.maybeSelectAutocompletedOption()},maybeSelectAutocompletedOption:function(){this.state.matchedAutocompleteOption?this.selectOption(this.state.matchedAutocompleteOption,{focus:!1}):this.selectText()},selectOption:function(e,t){t=t||{},this.setState({matchedAutocompleteOption:null},function(){this.props.onSelect(e.props.value,e),this.hideList(),this.clearSelectedState(),t.focus!==!1&&this.selectInput()}.bind(this)),this.refs.input.getDOMNode().value=""},selectText:function(){var e=this.refs.input.getDOMNode().value;e&&(this.props.onSelect(e),this.clearSelectedState(),this.refs.input.getDOMNode().value="")},focusNext:function(e){if(e.preventDefault&&e.preventDefault(),!this.state.menu.isEmpty){var t=null==this.state.focusedIndex?0:this.state.focusedIndex+1;this.focusOptionAtIndex(t)}},removeLastToken:function(){return this.props.onRemoveLast&&!this.refs.input.getDOMNode().value&&this.props.onRemoveLast(),!0},focusPrevious:function(e){if(e.preventDefault&&e.preventDefault(),!this.state.menu.isEmpty){var t=this.props.children.length-1,n=null==this.state.focusedIndex?t:this.state.focusedIndex-1;this.focusOptionAtIndex(n)}},focusSelectedOption:function(){var e;i.Children.forEach(this.props.children,function(t,n){t.props.value===this.state.value&&(e=n)}.bind(this)),this.showList(),this.setState({focusedIndex:e},this.focusOption)},findInitialInputValue:function(){var e;return i.Children.forEach(this.props.children,function(t){t.props.value===this.props.value&&(e=s(t))}.bind(this)),e},focusOptionAtIndex:function(e){if(!this.state.isOpen&&this.state.value)return this.focusSelectedOption();this.showList();var t=this.props.children.length;-1===e?e=t-1:e===t&&(e=0),this.setState({focusedIndex:e},this.focusOption)},focusOption:function(){var e=this.state.focusedIndex;this.refs.list.getDOMNode().childNodes[e].focus()},render:function(){var e=this.props["aria-label"]||"Start typing to search. Press the down arrow to navigate results. If you don't find an acceptable option, you can enter an alternative.";return l({className:this.getClassName()},this.props.value,this.state.inputValue,p({ref:"input",autoComplete:"off",spellCheck:"false","aria-label":e,"aria-expanded":this.state.isOpen+"","aria-haspopup":"true","aria-activedescendant":this.state.menu.activedescendant,"aria-autocomplete":"list","aria-owns":this.state.listId,id:this.props.id,className:"ic-tokeninput-input",onFocus:this.handleInputFocus,onChange:this.handleInputChange,onBlur:this.handleInputBlur,onKeyDown:this.handleKeydown,onKeyUp:this.handleInputKeyUp,role:"combobox"}),r({"aria-hidden":"true",className:"ic-tokeninput-button",onClick:this.handleButtonClick},"▾"),l({id:this.state.listId,ref:"list",className:"ic-tokeninput-list",role:"listbox"},this.state.menu.children))}})},function(e,t,n){var s=n(3),i=s.DOM.span,o=s.createFactory("li");e.exports=s.createClass({displayName:"exports",handleClick:function(){this.props.onRemove(this.props.value)},handleKeyDown:function(e){var t=13;e.keyCode===t&&this.props.onRemove(this.props.value)},render:function(){return o({className:"ic-token inline-flex"},i({role:"button",onClick:this.handleClick,onKeyDown:this.handleKeyDown,"aria-label":"Remove '"+this.props.name+"'",className:"ic-token-delete-button",tabIndex:0},"✕"),i({className:"ic-token-label"},this.props.name))}})},function(e,t,n){function s(e,t){return e?e.indexOf(t)>-1?e:e+" "+t:t}e.exports=s}])}); +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("react")); + else if(typeof define === 'function' && define.amd) + define(["react"], factory); + else if(typeof exports === 'object') + exports["TokenInput"] = factory(require("react")); + else + root["TokenInput"] = factory(root["React"]); +})(this, function(__WEBPACK_EXTERNAL_MODULE_2__) { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; +/******/ +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.loaded = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + var TokenInput = __webpack_require__(1) + TokenInput.Option = __webpack_require__(5) + + module.exports = TokenInput + + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + var React = __webpack_require__(2); + var Combobox = React.createFactory(__webpack_require__(3)); + var Token = React.createFactory(__webpack_require__(6)); + + var ul = React.createFactory('ul'); + var li = React.createFactory('li'); + + module.exports = React.createClass({displayName: "module.exports", + propTypes: { + onInput: React.PropTypes.func, + onSelect: React.PropTypes.func.isRequired, + onRemove: React.PropTypes.func.isRequired, + selected: React.PropTypes.array.isRequired, + menuContent: React.PropTypes.any, + showListOnFocus: React.PropTypes.bool + }, + + getInitialState: function() { + return { + selectedToken: null + }; + }, + + handleClick: function() { + // TODO: Expand combobox API for focus + this.refs['combo-li'].getDOMNode().querySelector('input').focus(); + }, + + handleInput: function(event) { + this.props.onInput(event); + }, + + handleSelect: function(event) { + this.props.onSelect(event) + this.setState({ + selectedToken: null + }) + }, + + handleRemove: function(value) { + this.props.onRemove(value); + this.refs['combo-li'].getDOMNode().querySelector('input').focus(); + }, + + handleRemoveLast: function() { + this.props.onRemove(this.props.selected[this.props.selected.length - 1]); + }, + + render: function() { + var tokens = this.props.selected.map(function(token) { + return ( + Token({ + onRemove: this.handleRemove, + value: token, + name: token.name, + key: token.id}) + ) + }.bind(this)) + + return ul({className: 'ic-tokens flex', onClick: this.handleClick}, + tokens, + li({className: 'inline-flex', ref: 'combo-li'}, + Combobox({ + id: this.props.id, + ariaLabel: this.props['combobox-aria-label'], + onInput: this.handleInput, + showListOnFocus: this.props.showListOnFocus, + onSelect: this.handleSelect, + onRemoveLast: this.handleRemoveLast, + value: this.state.selectedToken + }, + this.props.menuContent + ) + ) + ); + } + }) + + +/***/ }, +/* 2 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = __WEBPACK_EXTERNAL_MODULE_2__; + +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { + + var React = __webpack_require__(2); + var guid = 0; + var k = function(){}; + var addClass = __webpack_require__(4); + var ComboboxOption = React.createFactory(__webpack_require__(5)); + + var div = React.createFactory('div'); + var span = React.createFactory('span'); + var input = React.createFactory('input'); + + module.exports = React.createClass({displayName: "module.exports", + + propTypes: { + /** + * Called when the combobox receives user input, this is your chance to + * filter the data and rerender the options. + * + * Signature: + * + * ```js + * function(userInput){} + * ``` + */ + onInput: React.PropTypes.func, + + /** + * Called when the combobox receives a selection. You probably want to reset + * the options to the full list at this point. + * + * Signature: + * + * ```js + * function(selectedValue){} + * ``` + */ + onSelect: React.PropTypes.func + }, + + getDefaultProps: function() { + return { + autocomplete: 'both', + onInput: k, + onSelect: k, + value: null, + showListOnFocus: false + }; + }, + + getInitialState: function() { + return { + value: this.props.value, + // the value displayed in the input + inputValue: this.findInitialInputValue(), + isOpen: false, + focusedIndex: null, + matchedAutocompleteOption: null, + // this prevents crazy jumpiness since we focus options on mouseenter + usingKeyboard: false, + activedescendant: null, + listId: 'ic-tokeninput-list-'+(++guid), + menu: { + children: [], + activedescendant: null, + isEmpty: true + } + }; + }, + + componentWillMount: function() { + this.setState({menu: this.makeMenu()}); + }, + + componentWillReceiveProps: function(newProps) { + this.setState({menu: this.makeMenu(newProps.children)}, function() { + if(newProps.children.length && (this.isOpen || document.activeElement === this.refs.input.getDOMNode())) { + this.showList(); + } else { + this.hideList(); + } + + }.bind(this)); + }, + + /** + * We don't create the components, the user supplies them, + * so before rendering we attach handlers to facilitate communication from + * the ComboboxOption to the Combobox. + */ + makeMenu: function(children) { + var activedescendant; + var isEmpty = true; + children = children || this.props.children; + + // Should this instead use React.addons.cloneWithProps or React.cloneElement? + React.Children.forEach(children, function(child, index) { + if (child.type !== ComboboxOption.type) + // allow random elements to live in this list + return; + isEmpty = false; + // TODO: cloneWithProps and map instead of altering the children in-place + var props = child.props; + if (this.state.value === props.value) { + // need an ID for WAI-ARIA + props.id = props.id || 'ic-tokeninput-selected-'+(++guid); + props.isSelected = true + activedescendant = props.id; + } + props.onBlur = this.handleOptionBlur; + props.onClick = this.selectOption.bind(this, child); + props.onFocus = this.handleOptionFocus; + props.onKeyDown = this.handleOptionKeyDown.bind(this, child); + props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index); + }.bind(this)); + + return { + children: children, + activedescendant: activedescendant, + isEmpty: isEmpty + }; + }, + + getClassName: function() { + var className = addClass(this.props.className, 'ic-tokeninput'); + if (this.state.isOpen) + className = addClass(className, 'ic-tokeninput-is-open'); + return className; + }, + + /** + * When the user begins typing again we need to clear out any state that has + * to do with an existing or potential selection. + */ + clearSelectedState: function(cb) { + this.setState({ + focusedIndex: null, + inputValue: null, + value: null, + matchedAutocompleteOption: null, + activedescendant: null + }, cb); + }, + + handleInputChange: function(event) { + var value = this.refs.input.getDOMNode().value; + this.clearSelectedState(function() { + this.props.onInput(value); + }.bind(this)); + }, + + handleInputFocus: function() { + this.maybeShowList(); + }, + + handleInputClick: function() { + this.maybeShowList(); + }, + + maybeShowList: function(){ + if (this.props.showListOnFocus){ + this.showList() + } + }, + + handleInputBlur: function() { + var focusedAnOption = this.state.focusedIndex != null; + if (focusedAnOption) + return; + this.maybeSelectAutocompletedOption(); + this.hideList(); + }, + + handleOptionBlur: function() { + // don't want to hide the list if we focused another option + this.blurTimer = setTimeout(this.hideList, 0); + }, + + + handleOptionFocus: function() { + // see `handleOptionBlur` + clearTimeout(this.blurTimer); + }, + + handleInputKeyUp: function(event) { + if ( + this.state.menu.isEmpty || + // autocompleting while backspacing feels super weird, so let's not + event.keyCode === 8 /*backspace*/ || + !this.props.autocomplete.match(/both|inline/) + ) return; + }, + + handleButtonClick: function() { + this.state.isOpen ? this.hideList() : this.showList(); + this.focusInput(); + }, + + showList: function() { + if(!this.state.menu.children.length) { + return + } + this.setState({isOpen: true}) + }, + + hideList: function() { + this.setState({ + isOpen: false, + focusedIndex: null + }); + }, + + hideOnEscape: function(event) { + this.hideList(); + this.focusInput(); + event.preventDefault(); + }, + + focusInput: function() { + this.refs.input.getDOMNode().focus(); + }, + + selectInput: function() { + this.refs.input.getDOMNode().select(); + }, + + inputKeydownMap: { + 8: 'removeLastToken', + 13: 'selectOnEnter', + 27: 'hideOnEscape', + 38: 'focusPrevious', + 40: 'focusNext' + }, + + optionKeydownMap: { + 13: 'selectOption', + 27: 'hideOnEscape', + 38: 'focusPrevious', + 40: 'focusNext' + }, + + handleKeydown: function(event) { + var handlerName = this.inputKeydownMap[event.keyCode]; + if (!handlerName) + return + this.setState({usingKeyboard: true}); + return this[handlerName].call(this,event); + }, + + handleOptionKeyDown: function(child, event) { + var handlerName = this.optionKeydownMap[event.keyCode]; + if (!handlerName) { + // if the user starts typing again while focused on an option, move focus + // to the inpute, select so it wipes out any existing value + this.selectInput(); + return; + } + event.preventDefault(); + this.setState({usingKeyboard: true}); + this[handlerName].call(this, child); + }, + + handleOptionMouseEnter: function(index) { + if (this.state.usingKeyboard) + this.setState({usingKeyboard: false}); + else + this.focusOptionAtIndex(index); + }, + + selectOnEnter: function(event) { + event.preventDefault(); + this.maybeSelectAutocompletedOption() + }, + + maybeSelectAutocompletedOption: function() { + if (!this.state.matchedAutocompleteOption) { + this.selectText() + } else { + this.selectOption(this.state.matchedAutocompleteOption, {focus: false}); + } + }, + + selectOption: function(child, options) { + options = options || {}; + this.setState({ + // value: child.props.value, + // inputValue: getLabel(child), + matchedAutocompleteOption: null + }, function() { + this.props.onSelect(child.props.value, child); + this.hideList(); + this.clearSelectedState(); // added + if (options.focus !== false) + this.selectInput(); + }.bind(this)); + this.refs.input.getDOMNode().value = '' // added + }, + + selectText: function() { + var value = this.refs.input.getDOMNode().value; + if(!value) return; + this.props.onSelect(value); + this.clearSelectedState(); + this.refs.input.getDOMNode().value = '' // added + }, + + focusNext: function(event) { + if(event.preventDefault) event.preventDefault(); + if (this.state.menu.isEmpty) return; + var index = this.state.focusedIndex == null ? + 0 : this.state.focusedIndex + 1; + this.focusOptionAtIndex(index); + }, + + removeLastToken: function() { + if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) { + this.props.onRemoveLast() + } + return true + }, + + focusPrevious: function(event) { + if(event.preventDefault) event.preventDefault(); + if (this.state.menu.isEmpty) return; + var last = this.props.children.length - 1; + var index = this.state.focusedIndex == null ? + last : this.state.focusedIndex - 1; + this.focusOptionAtIndex(index); + }, + + focusSelectedOption: function() { + var selectedIndex; + React.Children.forEach(this.props.children, function(child, index) { + if (child.props.value === this.state.value) + selectedIndex = index; + }.bind(this)); + this.showList(); + this.setState({ + focusedIndex: selectedIndex + }, this.focusOption); + }, + + findInitialInputValue: function() { + // TODO: might not need this, we should know this in `makeMenu` + var inputValue; + React.Children.forEach(this.props.children, function(child) { + if (child.props.value === this.props.value) + inputValue = getLabel(child); + }.bind(this)); + return inputValue; + }, + + focusOptionAtIndex: function(index) { + if (!this.state.isOpen && this.state.value) + return this.focusSelectedOption(); + this.showList(); + var length = this.props.children.length; + if (index === -1) + index = length - 1; + else if (index === length) + index = 0; + this.setState({ + focusedIndex: index + }, this.focusOption); + }, + + focusOption: function() { + var index = this.state.focusedIndex; + this.refs.list.getDOMNode().childNodes[index].focus(); + }, + + render: function() { + var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' + + 'Press the down arrow to navigate results. If you don\'t find an ' + + 'acceptable option, you can enter an alternative.' + + return div({className: this.getClassName()}, + this.props.value, + this.state.inputValue, + input({ + ref: 'input', + autoComplete: 'off', + spellCheck: 'false', + 'aria-label': ariaLabel, + 'aria-expanded': this.state.isOpen+'', + 'aria-haspopup': 'true', + 'aria-activedescendant': this.state.menu.activedescendant, + 'aria-autocomplete': 'list', + 'aria-owns': this.state.listId, + id: this.props.id, + className: 'ic-tokeninput-input', + onFocus: this.handleInputFocus, + onClick: this.handleInputClick, + onChange: this.handleInputChange, + onBlur: this.handleInputBlur, + onKeyDown: this.handleKeydown, + onKeyUp: this.handleInputKeyUp, + role: 'combobox' + }), + span({ + 'aria-hidden': 'true', + className: 'ic-tokeninput-button', + onClick: this.handleButtonClick + }, '▾'), + div({ + id: this.state.listId, + ref: 'list', + className: 'ic-tokeninput-list', + role: 'listbox' + }, this.state.menu.children) + ); + } + }); + + function getLabel(component) { + return component.props.label || component.props.children; + } + + function matchFragment(userInput, firstChildLabel) { + userInput = userInput.toLowerCase(); + firstChildLabel = firstChildLabel.toLowerCase(); + if (userInput === '' || userInput === firstChildLabel) + return false; + if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1) + return false; + return true; + } + + +/***/ }, +/* 4 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = addClass; + + function addClass(existing, added) { + if (!existing) return added; + if (existing.indexOf(added) > -1) return existing; + return existing + ' ' + added; + } + + +/***/ }, +/* 5 */ +/***/ function(module, exports, __webpack_require__) { + + var React = __webpack_require__(2); + var addClass = __webpack_require__(4); + var div = React.createFactory('div'); + + module.exports = React.createClass({displayName: "module.exports", + + propTypes: { + + /** + * The value that will be sent to the `onSelect` handler of the + * parent Combobox. + */ + value: React.PropTypes.any.isRequired, + + /** + * What value to put into the input element when this option is + * selected, defaults to its children coerced to a string. + */ + label: React.PropTypes.string + }, + + getDefaultProps: function() { + return { + role: 'option', + tabIndex: '-1', + className: 'ic-tokeninput-option', + isSelected: false + }; + }, + + render: function() { + var props = this.props; + if (props.isSelected) { + props.className = addClass(props.className, 'ic-tokeninput-selected'); + props.ariaSelected = true; + } + return div(props); + } + + }); + + +/***/ }, +/* 6 */ +/***/ function(module, exports, __webpack_require__) { + + var React = __webpack_require__(2); + var span = React.DOM.span; + var li = React.createFactory('li'); + + module.exports = React.createClass({displayName: "module.exports", + handleClick: function() { + this.props.onRemove(this.props.value) + }, + + handleKeyDown: function(key) { + var enterKey = 13; + if(key.keyCode === enterKey) this.props.onRemove(this.props.value) + }, + + render: function() { + return ( + li({ + className: "ic-token inline-flex" + }, + span({ + role: 'button', + onClick: this.handleClick, + onKeyDown: this.handleKeyDown, + 'aria-label': 'Remove \'' + this.props.name + '\'', + className: "ic-token-delete-button", + tabIndex: 0 + }, "✕"), + span({className: "ic-token-label"}, this.props.name) + ) + ) + } + }) + + +/***/ } +/******/ ]) +}); +; //# sourceMappingURL=react-tokeninput.min.js.map \ No newline at end of file diff --git a/dist/react-tokeninput.min.js.map b/dist/react-tokeninput.min.js.map index f3c1e1d..7e8fa3f 100644 --- a/dist/react-tokeninput.min.js.map +++ b/dist/react-tokeninput.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///react-tokeninput.min.js","webpack:///webpack/bootstrap f661a0ab5788059634ef","webpack:///./index.js","webpack:///./lib/main.js","webpack:///./lib/option.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///./lib/combobox.js","webpack:///./lib/token.js","webpack:///./lib/add-class.js"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_3__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","TokenInput","Option","React","Combobox","createFactory","Token","ul","li","createClass","displayName","propTypes","onInput","PropTypes","func","onSelect","isRequired","onRemove","selected","array","menuContent","any","showListOnFocus","bool","getInitialState","selectedToken","handleClick","refs","getDOMNode","querySelector","focus","handleInput","event","props","handleSelect","setState","handleRemove","value","handleRemoveLast","length","render","tokens","map","token","name","key","bind","className","onClick","ref","ariaLabel","onRemoveLast","state","addClass","div","label","string","getDefaultProps","role","tabIndex","isSelected","ariaSelected","getLabel","component","children","guid","k","ComboboxOption","span","input","autocomplete","inputValue","findInitialInputValue","isOpen","focusedIndex","matchedAutocompleteOption","usingKeyboard","activedescendant","listId","menu","isEmpty","componentWillMount","makeMenu","componentWillReceiveProps","newProps","document","activeElement","showList","hideList","Children","forEach","child","index","type","onBlur","handleOptionBlur","selectOption","onFocus","handleOptionFocus","onKeyDown","handleOptionKeyDown","onMouseEnter","handleOptionMouseEnter","getClassName","clearSelectedState","cb","handleInputChange","handleInputFocus","handleInputBlur","focusedAnOption","maybeSelectAutocompletedOption","blurTimer","setTimeout","clearTimeout","handleInputKeyUp","keyCode","match","handleButtonClick","focusInput","hideOnEscape","preventDefault","selectInput","select","inputKeydownMap",8,13,27,38,40,"optionKeydownMap","handleKeydown","handlerName","focusOptionAtIndex","selectOnEnter","selectText","options","focusNext","removeLastToken","focusPrevious","last","focusSelectedOption","selectedIndex","focusOption","list","childNodes","autoComplete","spellCheck","aria-label","aria-expanded","aria-haspopup","aria-activedescendant","aria-autocomplete","aria-owns","onChange","onKeyUp","aria-hidden","DOM","handleKeyDown","enterKey","existing","added","indexOf"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,UACA,kBAAAC,gBAAAC,IACAD,QAAA,SAAAJ,GACA,gBAAAC,SACAA,QAAA,WAAAD,EAAAG,QAAA,UAEAJ,EAAA,WAAAC,EAAAD,EAAA,QACCO,KAAA,SAAAC,GACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAT,OAGA,IAAAC,GAAAS,EAAAD,IACAT,WACAW,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAZ,EAAAD,QAAAC,IAAAD,QAAAQ,GAGAP,EAAAW,QAAA,EAGAX,EAAAD,QAvBA,GAAAU,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,GAGAR,EAAA,KDgBM,SAASP,EAAQD,EAASQ,GEtDhC,GAAIS,GAAaT,EAAQ,EACzBS,GAAWC,OAASV,EAAQ,GAE5BP,EAAOD,QAAUiB,GF6DX,SAAShB,EAAQD,EAASQ,GGhEhC,GAAIW,GAAQX,EAAQ,GAChBY,EAAWD,EAAME,cAAcb,EAAQ,IACvCc,EAAQH,EAAME,cAAcb,EAAQ,IAEpCe,EAAKJ,EAAME,cAAc,MACzBG,EAAKL,EAAME,cA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ASQ,GQ9oBhC,QAAS6D,GAAS0G,EAAUC,GAC1B,MAAKD,GACDA,EAASE,QAAQD,GAAS,GAAWD,EAClCA,EAAW,IAAMC,EAFFA,EAHxB/K,EAAOD,QAAUqE","file":"react-tokeninput.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TokenInput\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"TokenInput\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TokenInput\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"TokenInput\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar TokenInput = __webpack_require__(1)\n\tTokenInput.Option = __webpack_require__(2)\n\t\n\tmodule.exports = TokenInput\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar Combobox = React.createFactory(__webpack_require__(4));\n\tvar Token = React.createFactory(__webpack_require__(5));\n\t\n\tvar ul = React.createFactory('ul');\n\tvar li = React.createFactory('li');\n\t\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\t propTypes: {\n\t onInput: React.PropTypes.func,\n\t onSelect: React.PropTypes.func.isRequired,\n\t onRemove: React.PropTypes.func.isRequired,\n\t selected: React.PropTypes.array.isRequired,\n\t menuContent: React.PropTypes.any,\n\t showListOnFocus: React.PropTypes.bool\n\t },\n\t\n\t getInitialState: function() {\n\t return {\n\t selectedToken: null\n\t };\n\t },\n\t\n\t handleClick: function() {\n\t // TODO: Expand combobox API for focus\n\t this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n\t },\n\t\n\t handleInput: function(event) {\n\t this.props.onInput(event);\n\t },\n\t\n\t handleSelect: function(event) {\n\t this.props.onSelect(event)\n\t this.setState({\n\t selectedToken: null\n\t })\n\t },\n\t\n\t handleRemove: function(value) {\n\t this.props.onRemove(value);\n\t this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n\t },\n\t\n\t handleRemoveLast: function() {\n\t this.props.onRemove(this.props.selected[this.props.selected.length - 1]);\n\t },\n\t\n\t render: function() {\n\t var tokens = this.props.selected.map(function(token) {\n\t return (\n\t Token({\n\t onRemove: this.handleRemove,\n\t value: token,\n\t name: token.name,\n\t key: token.id})\n\t )\n\t }.bind(this))\n\t\n\t return ul({className: 'ic-tokens flex', onClick: this.handleClick},\n\t tokens,\n\t li({className: 'inline-flex', ref: 'combo-li'},\n\t Combobox({\n\t id: this.props.id,\n\t ariaLabel: this.props['combobox-aria-label'],\n\t onInput: this.handleInput,\n\t showListOnFocus: this.props.showListOnFocus,\n\t onSelect: this.handleSelect,\n\t onRemoveLast: this.handleRemoveLast,\n\t value: this.state.selectedToken\n\t },\n\t this.props.menuContent\n\t )\n\t )\n\t );\n\t }\n\t})\n\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar addClass = __webpack_require__(6);\n\tvar div = React.createFactory('div');\n\t\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\t\n\t propTypes: {\n\t\n\t /**\n\t * The value that will be sent to the `onSelect` handler of the\n\t * parent Combobox.\n\t */\n\t value: React.PropTypes.any.isRequired,\n\t\n\t /**\n\t * What value to put into the input element when this option is\n\t * selected, defaults to its children coerced to a string.\n\t */\n\t label: React.PropTypes.string\n\t },\n\t\n\t getDefaultProps: function() {\n\t return {\n\t role: 'option',\n\t tabIndex: '-1',\n\t className: 'ic-tokeninput-option',\n\t isSelected: false\n\t };\n\t },\n\t\n\t render: function() {\n\t var props = this.props;\n\t if (props.isSelected) {\n\t props.className = addClass(props.className, 'ic-tokeninput-selected');\n\t props.ariaSelected = true;\n\t }\n\t return div(props);\n\t }\n\t\n\t});\n\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar guid = 0;\n\tvar k = function(){};\n\tvar addClass = __webpack_require__(6);\n\tvar ComboboxOption = React.createFactory(__webpack_require__(2));\n\t\n\tvar div = React.createFactory('div');\n\tvar span = React.createFactory('span');\n\tvar input = React.createFactory('input');\n\t\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\t\n\t propTypes: {\n\t /**\n\t * Called when the combobox receives user input, this is your chance to\n\t * filter the data and rerender the options.\n\t *\n\t * Signature:\n\t *\n\t * ```js\n\t * function(userInput){}\n\t * ```\n\t */\n\t onInput: React.PropTypes.func,\n\t\n\t /**\n\t * Called when the combobox receives a selection. You probably want to reset\n\t * the options to the full list at this point.\n\t *\n\t * Signature:\n\t *\n\t * ```js\n\t * function(selectedValue){}\n\t * ```\n\t */\n\t onSelect: React.PropTypes.func\n\t },\n\t\n\t getDefaultProps: function() {\n\t return {\n\t autocomplete: 'both',\n\t onInput: k,\n\t onSelect: k,\n\t value: null,\n\t showListOnFocus: false\n\t };\n\t },\n\t\n\t getInitialState: function() {\n\t return {\n\t value: this.props.value,\n\t // the value displayed in the input\n\t inputValue: this.findInitialInputValue(),\n\t isOpen: false,\n\t focusedIndex: null,\n\t matchedAutocompleteOption: null,\n\t // this prevents crazy jumpiness since we focus options on mouseenter\n\t usingKeyboard: false,\n\t activedescendant: null,\n\t listId: 'ic-tokeninput-list-'+(++guid),\n\t menu: {\n\t children: [],\n\t activedescendant: null,\n\t isEmpty: true\n\t }\n\t };\n\t },\n\t\n\t componentWillMount: function() {\n\t this.setState({menu: this.makeMenu()});\n\t },\n\t\n\t componentWillReceiveProps: function(newProps) {\n\t this.setState({menu: this.makeMenu(newProps.children)}, function() {\n\t if(newProps.children.length && (this.isOpen || document.activeElement === this.refs.input.getDOMNode())) {\n\t this.showList();\n\t } else {\n\t this.hideList();\n\t }\n\t\n\t }.bind(this));\n\t },\n\t\n\t /**\n\t * We don't create the components, the user supplies them,\n\t * so before rendering we attach handlers to facilitate communication from\n\t * the ComboboxOption to the Combobox.\n\t */\n\t makeMenu: function(children) {\n\t var activedescendant;\n\t var isEmpty = true;\n\t children = children || this.props.children;\n\t\n\t // Should this instead use React.addons.cloneWithProps or React.cloneElement?\n\t React.Children.forEach(children, function(child, index) {\n\t if (child.type !== ComboboxOption.type)\n\t // allow random elements to live in this list\n\t return;\n\t isEmpty = false;\n\t // TODO: cloneWithProps and map instead of altering the children in-place\n\t var props = child.props;\n\t if (this.state.value === props.value) {\n\t // need an ID for WAI-ARIA\n\t props.id = props.id || 'ic-tokeninput-selected-'+(++guid);\n\t props.isSelected = true\n\t activedescendant = props.id;\n\t }\n\t props.onBlur = this.handleOptionBlur;\n\t props.onClick = this.selectOption.bind(this, child);\n\t props.onFocus = this.handleOptionFocus;\n\t props.onKeyDown = this.handleOptionKeyDown.bind(this, child);\n\t props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index);\n\t }.bind(this));\n\t\n\t return {\n\t children: children,\n\t activedescendant: activedescendant,\n\t isEmpty: isEmpty\n\t };\n\t },\n\t\n\t getClassName: function() {\n\t var className = addClass(this.props.className, 'ic-tokeninput');\n\t if (this.state.isOpen)\n\t className = addClass(className, 'ic-tokeninput-is-open');\n\t return className;\n\t },\n\t\n\t /**\n\t * When the user begins typing again we need to clear out any state that has\n\t * to do with an existing or potential selection.\n\t */\n\t clearSelectedState: function(cb) {\n\t this.setState({\n\t focusedIndex: null,\n\t inputValue: null,\n\t value: null,\n\t matchedAutocompleteOption: null,\n\t activedescendant: null\n\t }, cb);\n\t },\n\t\n\t handleInputChange: function(event) {\n\t var value = this.refs.input.getDOMNode().value;\n\t this.clearSelectedState(function() {\n\t this.props.onInput(value);\n\t }.bind(this));\n\t },\n\t\n\t handleInputFocus: function() {\n\t if (this.props.showListOnFocus){\n\t this.showList()\n\t }\n\t },\n\t\n\t handleInputBlur: function() {\n\t var focusedAnOption = this.state.focusedIndex != null;\n\t if (focusedAnOption)\n\t return;\n\t this.maybeSelectAutocompletedOption();\n\t this.hideList();\n\t },\n\t\n\t handleOptionBlur: function() {\n\t // don't want to hide the list if we focused another option\n\t this.blurTimer = setTimeout(this.hideList, 0);\n\t },\n\t\n\t\n\t handleOptionFocus: function() {\n\t // see `handleOptionBlur`\n\t clearTimeout(this.blurTimer);\n\t },\n\t\n\t handleInputKeyUp: function(event) {\n\t if (\n\t this.state.menu.isEmpty ||\n\t // autocompleting while backspacing feels super weird, so let's not\n\t event.keyCode === 8 /*backspace*/ ||\n\t !this.props.autocomplete.match(/both|inline/)\n\t ) return;\n\t },\n\t\n\t handleButtonClick: function() {\n\t this.state.isOpen ? this.hideList() : this.showList();\n\t this.focusInput();\n\t },\n\t\n\t showList: function() {\n\t if(!this.state.menu.children.length) {\n\t return\n\t }\n\t this.setState({isOpen: true})\n\t },\n\t\n\t hideList: function() {\n\t this.setState({isOpen: false});\n\t },\n\t\n\t hideOnEscape: function(event) {\n\t this.hideList();\n\t this.focusInput();\n\t event.preventDefault();\n\t },\n\t\n\t focusInput: function() {\n\t this.refs.input.getDOMNode().focus();\n\t },\n\t\n\t selectInput: function() {\n\t this.refs.input.getDOMNode().select();\n\t },\n\t\n\t inputKeydownMap: {\n\t 8: 'removeLastToken',\n\t 13: 'selectOnEnter',\n\t 27: 'hideOnEscape',\n\t 38: 'focusPrevious',\n\t 40: 'focusNext'\n\t },\n\t\n\t optionKeydownMap: {\n\t 13: 'selectOption',\n\t 27: 'hideOnEscape',\n\t 38: 'focusPrevious',\n\t 40: 'focusNext'\n\t },\n\t\n\t handleKeydown: function(event) {\n\t var handlerName = this.inputKeydownMap[event.keyCode];\n\t if (!handlerName)\n\t return\n\t this.setState({usingKeyboard: true});\n\t return this[handlerName].call(this,event);\n\t },\n\t\n\t handleOptionKeyDown: function(child, event) {\n\t var handlerName = this.optionKeydownMap[event.keyCode];\n\t if (!handlerName) {\n\t // if the user starts typing again while focused on an option, move focus\n\t // to the inpute, select so it wipes out any existing value\n\t this.selectInput();\n\t return;\n\t }\n\t event.preventDefault();\n\t this.setState({usingKeyboard: true});\n\t this[handlerName].call(this, child);\n\t },\n\t\n\t handleOptionMouseEnter: function(index) {\n\t if (this.state.usingKeyboard)\n\t this.setState({usingKeyboard: false});\n\t else\n\t this.focusOptionAtIndex(index);\n\t },\n\t\n\t selectOnEnter: function(event) {\n\t event.preventDefault();\n\t this.maybeSelectAutocompletedOption()\n\t },\n\t\n\t maybeSelectAutocompletedOption: function() {\n\t if (!this.state.matchedAutocompleteOption) {\n\t this.selectText()\n\t } else {\n\t this.selectOption(this.state.matchedAutocompleteOption, {focus: false});\n\t }\n\t },\n\t\n\t selectOption: function(child, options) {\n\t options = options || {};\n\t this.setState({\n\t // value: child.props.value,\n\t // inputValue: getLabel(child),\n\t matchedAutocompleteOption: null\n\t }, function() {\n\t this.props.onSelect(child.props.value, child);\n\t this.hideList();\n\t this.clearSelectedState(); // added\n\t if (options.focus !== false)\n\t this.selectInput();\n\t }.bind(this));\n\t this.refs.input.getDOMNode().value = '' // added\n\t },\n\t\n\t selectText: function() {\n\t var value = this.refs.input.getDOMNode().value;\n\t if(!value) return;\n\t this.props.onSelect(value);\n\t this.clearSelectedState();\n\t this.refs.input.getDOMNode().value = '' // added\n\t },\n\t\n\t focusNext: function(event) {\n\t if(event.preventDefault) event.preventDefault();\n\t if (this.state.menu.isEmpty) return;\n\t var index = this.state.focusedIndex == null ?\n\t 0 : this.state.focusedIndex + 1;\n\t this.focusOptionAtIndex(index);\n\t },\n\t\n\t removeLastToken: function() {\n\t if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) {\n\t this.props.onRemoveLast()\n\t }\n\t return true\n\t },\n\t\n\t focusPrevious: function(event) {\n\t if(event.preventDefault) event.preventDefault();\n\t if (this.state.menu.isEmpty) return;\n\t var last = this.props.children.length - 1;\n\t var index = this.state.focusedIndex == null ?\n\t last : this.state.focusedIndex - 1;\n\t this.focusOptionAtIndex(index);\n\t },\n\t\n\t focusSelectedOption: function() {\n\t var selectedIndex;\n\t React.Children.forEach(this.props.children, function(child, index) {\n\t if (child.props.value === this.state.value)\n\t selectedIndex = index;\n\t }.bind(this));\n\t this.showList();\n\t this.setState({\n\t focusedIndex: selectedIndex\n\t }, this.focusOption);\n\t },\n\t\n\t findInitialInputValue: function() {\n\t // TODO: might not need this, we should know this in `makeMenu`\n\t var inputValue;\n\t React.Children.forEach(this.props.children, function(child) {\n\t if (child.props.value === this.props.value)\n\t inputValue = getLabel(child);\n\t }.bind(this));\n\t return inputValue;\n\t },\n\t\n\t focusOptionAtIndex: function(index) {\n\t if (!this.state.isOpen && this.state.value)\n\t return this.focusSelectedOption();\n\t this.showList();\n\t var length = this.props.children.length;\n\t if (index === -1)\n\t index = length - 1;\n\t else if (index === length)\n\t index = 0;\n\t this.setState({\n\t focusedIndex: index\n\t }, this.focusOption);\n\t },\n\t\n\t focusOption: function() {\n\t var index = this.state.focusedIndex;\n\t this.refs.list.getDOMNode().childNodes[index].focus();\n\t },\n\t\n\t render: function() {\n\t var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' +\n\t 'Press the down arrow to navigate results. If you don\\'t find an ' +\n\t 'acceptable option, you can enter an alternative.'\n\t\n\t return div({className: this.getClassName()},\n\t this.props.value,\n\t this.state.inputValue,\n\t input({\n\t ref: 'input',\n\t autoComplete: 'off',\n\t spellCheck: 'false',\n\t 'aria-label': ariaLabel,\n\t 'aria-expanded': this.state.isOpen+'',\n\t 'aria-haspopup': 'true',\n\t 'aria-activedescendant': this.state.menu.activedescendant,\n\t 'aria-autocomplete': 'list',\n\t 'aria-owns': this.state.listId,\n\t id: this.props.id,\n\t className: 'ic-tokeninput-input',\n\t onFocus: this.handleInputFocus,\n\t onChange: this.handleInputChange,\n\t onBlur: this.handleInputBlur,\n\t onKeyDown: this.handleKeydown,\n\t onKeyUp: this.handleInputKeyUp,\n\t role: 'combobox'\n\t }),\n\t span({\n\t 'aria-hidden': 'true',\n\t className: 'ic-tokeninput-button',\n\t onClick: this.handleButtonClick\n\t }, '▾'),\n\t div({\n\t id: this.state.listId,\n\t ref: 'list',\n\t className: 'ic-tokeninput-list',\n\t role: 'listbox'\n\t }, this.state.menu.children)\n\t );\n\t }\n\t});\n\t\n\tfunction getLabel(component) {\n\t return component.props.label || component.props.children;\n\t}\n\t\n\tfunction matchFragment(userInput, firstChildLabel) {\n\t userInput = userInput.toLowerCase();\n\t firstChildLabel = firstChildLabel.toLowerCase();\n\t if (userInput === '' || userInput === firstChildLabel)\n\t return false;\n\t if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1)\n\t return false;\n\t return true;\n\t}\n\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar React = __webpack_require__(3);\n\tvar span = React.DOM.span;\n\tvar li = React.createFactory('li');\n\t\n\tmodule.exports = React.createClass({displayName: \"exports\",\n\t handleClick: function() {\n\t this.props.onRemove(this.props.value)\n\t },\n\t\n\t handleKeyDown: function(key) {\n\t var enterKey = 13;\n\t if(key.keyCode === enterKey) this.props.onRemove(this.props.value)\n\t },\n\t\n\t render: function() {\n\t return (\n\t li({\n\t className: \"ic-token inline-flex\"\n\t },\n\t span({\n\t role: 'button',\n\t onClick: this.handleClick,\n\t onKeyDown: this.handleKeyDown,\n\t 'aria-label': 'Remove \\'' + this.props.name + '\\'',\n\t className: \"ic-token-delete-button\",\n\t tabIndex: 0\n\t }, \"✕\"),\n\t span({className: \"ic-token-label\"}, this.props.name)\n\t )\n\t )\n\t }\n\t})\n\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = addClass;\n\t\n\tfunction addClass(existing, added) {\n\t if (!existing) return added;\n\t if (existing.indexOf(added) > -1) return existing;\n\t return existing + ' ' + added;\n\t}\n\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** react-tokeninput.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap f661a0ab5788059634ef\n **/","var TokenInput = require('./lib/main')\nTokenInput.Option = require('./lib/option')\n\nmodule.exports = TokenInput\n\n\n\n/** WEBPACK FOOTER **\n ** ./index.js\n **/","var React = require('react');\nvar Combobox = React.createFactory(require('./combobox'));\nvar Token = React.createFactory(require('./token'));\n\nvar ul = React.createFactory('ul');\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n propTypes: {\n onInput: React.PropTypes.func,\n onSelect: React.PropTypes.func.isRequired,\n onRemove: React.PropTypes.func.isRequired,\n selected: React.PropTypes.array.isRequired,\n menuContent: React.PropTypes.any,\n showListOnFocus: React.PropTypes.bool\n },\n\n getInitialState: function() {\n return {\n selectedToken: null\n };\n },\n\n handleClick: function() {\n // TODO: Expand combobox API for focus\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleInput: function(event) {\n this.props.onInput(event);\n },\n\n handleSelect: function(event) {\n this.props.onSelect(event)\n this.setState({\n selectedToken: null\n })\n },\n\n handleRemove: function(value) {\n this.props.onRemove(value);\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleRemoveLast: function() {\n this.props.onRemove(this.props.selected[this.props.selected.length - 1]);\n },\n\n render: function() {\n var tokens = this.props.selected.map(function(token) {\n return (\n Token({\n onRemove: this.handleRemove,\n value: token,\n name: token.name,\n key: token.id})\n )\n }.bind(this))\n\n return ul({className: 'ic-tokens flex', onClick: this.handleClick},\n tokens,\n li({className: 'inline-flex', ref: 'combo-li'},\n Combobox({\n id: this.props.id,\n ariaLabel: this.props['combobox-aria-label'],\n onInput: this.handleInput,\n showListOnFocus: this.props.showListOnFocus,\n onSelect: this.handleSelect,\n onRemoveLast: this.handleRemoveLast,\n value: this.state.selectedToken\n },\n this.props.menuContent\n )\n )\n );\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/main.js\n **/","var React = require('react');\nvar addClass = require('./add-class');\nvar div = React.createFactory('div');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n\n /**\n * The value that will be sent to the `onSelect` handler of the\n * parent Combobox.\n */\n value: React.PropTypes.any.isRequired,\n\n /**\n * What value to put into the input element when this option is\n * selected, defaults to its children coerced to a string.\n */\n label: React.PropTypes.string\n },\n\n getDefaultProps: function() {\n return {\n role: 'option',\n tabIndex: '-1',\n className: 'ic-tokeninput-option',\n isSelected: false\n };\n },\n\n render: function() {\n var props = this.props;\n if (props.isSelected) {\n props.className = addClass(props.className, 'ic-tokeninput-selected');\n props.ariaSelected = true;\n }\n return div(props);\n }\n\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/option.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n ** module id = 3\n ** module chunks = 0\n **/","var React = require('react');\nvar guid = 0;\nvar k = function(){};\nvar addClass = require('./add-class');\nvar ComboboxOption = React.createFactory(require('./option'));\n\nvar div = React.createFactory('div');\nvar span = React.createFactory('span');\nvar input = React.createFactory('input');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n /**\n * Called when the combobox receives user input, this is your chance to\n * filter the data and rerender the options.\n *\n * Signature:\n *\n * ```js\n * function(userInput){}\n * ```\n */\n onInput: React.PropTypes.func,\n\n /**\n * Called when the combobox receives a selection. You probably want to reset\n * the options to the full list at this point.\n *\n * Signature:\n *\n * ```js\n * function(selectedValue){}\n * ```\n */\n onSelect: React.PropTypes.func\n },\n\n getDefaultProps: function() {\n return {\n autocomplete: 'both',\n onInput: k,\n onSelect: k,\n value: null,\n showListOnFocus: false\n };\n },\n\n getInitialState: function() {\n return {\n value: this.props.value,\n // the value displayed in the input\n inputValue: this.findInitialInputValue(),\n isOpen: false,\n focusedIndex: null,\n matchedAutocompleteOption: null,\n // this prevents crazy jumpiness since we focus options on mouseenter\n usingKeyboard: false,\n activedescendant: null,\n listId: 'ic-tokeninput-list-'+(++guid),\n menu: {\n children: [],\n activedescendant: null,\n isEmpty: true\n }\n };\n },\n\n componentWillMount: function() {\n this.setState({menu: this.makeMenu()});\n },\n\n componentWillReceiveProps: function(newProps) {\n this.setState({menu: this.makeMenu(newProps.children)}, function() {\n if(newProps.children.length && (this.isOpen || document.activeElement === this.refs.input.getDOMNode())) {\n this.showList();\n } else {\n this.hideList();\n }\n\n }.bind(this));\n },\n\n /**\n * We don't create the components, the user supplies them,\n * so before rendering we attach handlers to facilitate communication from\n * the ComboboxOption to the Combobox.\n */\n makeMenu: function(children) {\n var activedescendant;\n var isEmpty = true;\n children = children || this.props.children;\n\n // Should this instead use React.addons.cloneWithProps or React.cloneElement?\n React.Children.forEach(children, function(child, index) {\n if (child.type !== ComboboxOption.type)\n // allow random elements to live in this list\n return;\n isEmpty = false;\n // TODO: cloneWithProps and map instead of altering the children in-place\n var props = child.props;\n if (this.state.value === props.value) {\n // need an ID for WAI-ARIA\n props.id = props.id || 'ic-tokeninput-selected-'+(++guid);\n props.isSelected = true\n activedescendant = props.id;\n }\n props.onBlur = this.handleOptionBlur;\n props.onClick = this.selectOption.bind(this, child);\n props.onFocus = this.handleOptionFocus;\n props.onKeyDown = this.handleOptionKeyDown.bind(this, child);\n props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index);\n }.bind(this));\n\n return {\n children: children,\n activedescendant: activedescendant,\n isEmpty: isEmpty\n };\n },\n\n getClassName: function() {\n var className = addClass(this.props.className, 'ic-tokeninput');\n if (this.state.isOpen)\n className = addClass(className, 'ic-tokeninput-is-open');\n return className;\n },\n\n /**\n * When the user begins typing again we need to clear out any state that has\n * to do with an existing or potential selection.\n */\n clearSelectedState: function(cb) {\n this.setState({\n focusedIndex: null,\n inputValue: null,\n value: null,\n matchedAutocompleteOption: null,\n activedescendant: null\n }, cb);\n },\n\n handleInputChange: function(event) {\n var value = this.refs.input.getDOMNode().value;\n this.clearSelectedState(function() {\n this.props.onInput(value);\n }.bind(this));\n },\n\n handleInputFocus: function() {\n if (this.props.showListOnFocus){\n this.showList()\n }\n },\n\n handleInputBlur: function() {\n var focusedAnOption = this.state.focusedIndex != null;\n if (focusedAnOption)\n return;\n this.maybeSelectAutocompletedOption();\n this.hideList();\n },\n\n handleOptionBlur: function() {\n // don't want to hide the list if we focused another option\n this.blurTimer = setTimeout(this.hideList, 0);\n },\n\n\n handleOptionFocus: function() {\n // see `handleOptionBlur`\n clearTimeout(this.blurTimer);\n },\n\n handleInputKeyUp: function(event) {\n if (\n this.state.menu.isEmpty ||\n // autocompleting while backspacing feels super weird, so let's not\n event.keyCode === 8 /*backspace*/ ||\n !this.props.autocomplete.match(/both|inline/)\n ) return;\n },\n\n handleButtonClick: function() {\n this.state.isOpen ? this.hideList() : this.showList();\n this.focusInput();\n },\n\n showList: function() {\n if(!this.state.menu.children.length) {\n return\n }\n this.setState({isOpen: true})\n },\n\n hideList: function() {\n this.setState({isOpen: false});\n },\n\n hideOnEscape: function(event) {\n this.hideList();\n this.focusInput();\n event.preventDefault();\n },\n\n focusInput: function() {\n this.refs.input.getDOMNode().focus();\n },\n\n selectInput: function() {\n this.refs.input.getDOMNode().select();\n },\n\n inputKeydownMap: {\n 8: 'removeLastToken',\n 13: 'selectOnEnter',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n optionKeydownMap: {\n 13: 'selectOption',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n handleKeydown: function(event) {\n var handlerName = this.inputKeydownMap[event.keyCode];\n if (!handlerName)\n return\n this.setState({usingKeyboard: true});\n return this[handlerName].call(this,event);\n },\n\n handleOptionKeyDown: function(child, event) {\n var handlerName = this.optionKeydownMap[event.keyCode];\n if (!handlerName) {\n // if the user starts typing again while focused on an option, move focus\n // to the inpute, select so it wipes out any existing value\n this.selectInput();\n return;\n }\n event.preventDefault();\n this.setState({usingKeyboard: true});\n this[handlerName].call(this, child);\n },\n\n handleOptionMouseEnter: function(index) {\n if (this.state.usingKeyboard)\n this.setState({usingKeyboard: false});\n else\n this.focusOptionAtIndex(index);\n },\n\n selectOnEnter: function(event) {\n event.preventDefault();\n this.maybeSelectAutocompletedOption()\n },\n\n maybeSelectAutocompletedOption: function() {\n if (!this.state.matchedAutocompleteOption) {\n this.selectText()\n } else {\n this.selectOption(this.state.matchedAutocompleteOption, {focus: false});\n }\n },\n\n selectOption: function(child, options) {\n options = options || {};\n this.setState({\n // value: child.props.value,\n // inputValue: getLabel(child),\n matchedAutocompleteOption: null\n }, function() {\n this.props.onSelect(child.props.value, child);\n this.hideList();\n this.clearSelectedState(); // added\n if (options.focus !== false)\n this.selectInput();\n }.bind(this));\n this.refs.input.getDOMNode().value = '' // added\n },\n\n selectText: function() {\n var value = this.refs.input.getDOMNode().value;\n if(!value) return;\n this.props.onSelect(value);\n this.clearSelectedState();\n this.refs.input.getDOMNode().value = '' // added\n },\n\n focusNext: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var index = this.state.focusedIndex == null ?\n 0 : this.state.focusedIndex + 1;\n this.focusOptionAtIndex(index);\n },\n\n removeLastToken: function() {\n if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) {\n this.props.onRemoveLast()\n }\n return true\n },\n\n focusPrevious: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var last = this.props.children.length - 1;\n var index = this.state.focusedIndex == null ?\n last : this.state.focusedIndex - 1;\n this.focusOptionAtIndex(index);\n },\n\n focusSelectedOption: function() {\n var selectedIndex;\n React.Children.forEach(this.props.children, function(child, index) {\n if (child.props.value === this.state.value)\n selectedIndex = index;\n }.bind(this));\n this.showList();\n this.setState({\n focusedIndex: selectedIndex\n }, this.focusOption);\n },\n\n findInitialInputValue: function() {\n // TODO: might not need this, we should know this in `makeMenu`\n var inputValue;\n React.Children.forEach(this.props.children, function(child) {\n if (child.props.value === this.props.value)\n inputValue = getLabel(child);\n }.bind(this));\n return inputValue;\n },\n\n focusOptionAtIndex: function(index) {\n if (!this.state.isOpen && this.state.value)\n return this.focusSelectedOption();\n this.showList();\n var length = this.props.children.length;\n if (index === -1)\n index = length - 1;\n else if (index === length)\n index = 0;\n this.setState({\n focusedIndex: index\n }, this.focusOption);\n },\n\n focusOption: function() {\n var index = this.state.focusedIndex;\n this.refs.list.getDOMNode().childNodes[index].focus();\n },\n\n render: function() {\n var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' +\n 'Press the down arrow to navigate results. If you don\\'t find an ' +\n 'acceptable option, you can enter an alternative.'\n\n return div({className: this.getClassName()},\n this.props.value,\n this.state.inputValue,\n input({\n ref: 'input',\n autoComplete: 'off',\n spellCheck: 'false',\n 'aria-label': ariaLabel,\n 'aria-expanded': this.state.isOpen+'',\n 'aria-haspopup': 'true',\n 'aria-activedescendant': this.state.menu.activedescendant,\n 'aria-autocomplete': 'list',\n 'aria-owns': this.state.listId,\n id: this.props.id,\n className: 'ic-tokeninput-input',\n onFocus: this.handleInputFocus,\n onChange: this.handleInputChange,\n onBlur: this.handleInputBlur,\n onKeyDown: this.handleKeydown,\n onKeyUp: this.handleInputKeyUp,\n role: 'combobox'\n }),\n span({\n 'aria-hidden': 'true',\n className: 'ic-tokeninput-button',\n onClick: this.handleButtonClick\n }, '▾'),\n div({\n id: this.state.listId,\n ref: 'list',\n className: 'ic-tokeninput-list',\n role: 'listbox'\n }, this.state.menu.children)\n );\n }\n});\n\nfunction getLabel(component) {\n return component.props.label || component.props.children;\n}\n\nfunction matchFragment(userInput, firstChildLabel) {\n userInput = userInput.toLowerCase();\n firstChildLabel = firstChildLabel.toLowerCase();\n if (userInput === '' || userInput === firstChildLabel)\n return false;\n if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1)\n return false;\n return true;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/combobox.js\n **/","var React = require('react');\nvar span = React.DOM.span;\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n handleClick: function() {\n this.props.onRemove(this.props.value)\n },\n\n handleKeyDown: function(key) {\n var enterKey = 13;\n if(key.keyCode === enterKey) this.props.onRemove(this.props.value)\n },\n\n render: function() {\n return (\n li({\n className: \"ic-token inline-flex\"\n },\n span({\n role: 'button',\n onClick: this.handleClick,\n onKeyDown: this.handleKeyDown,\n 'aria-label': 'Remove \\'' + this.props.name + '\\'',\n className: \"ic-token-delete-button\",\n tabIndex: 0\n }, \"✕\"),\n span({className: \"ic-token-label\"}, this.props.name)\n )\n )\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/token.js\n **/","module.exports = addClass;\n\nfunction addClass(existing, added) {\n if (!existing) return added;\n if (existing.indexOf(added) > -1) return existing;\n return existing + ' ' + added;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/add-class.js\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 09aa5cf0d89feea60fad","webpack:///./index.js","webpack:///./lib/main.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///./lib/combobox.js","webpack:///./lib/add-class.js","webpack:///./lib/option.js","webpack:///./lib/token.js"],"names":[],"mapp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;AAC1B,KAAI,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;;AAEnC,qCAAoC;GAClC,WAAW,EAAE,WAAW;KACtB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;AACzC,IAAG;;GAED,aAAa,EAAE,SAAS,GAAG,EAAE;KAC3B,IAAI,QAAQ,GAAG,EAAE,CAAC;KAClB,GAAG,GAAG,CAAC,OAAO,KAAK,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;AACtE,IAAG;;GAED,MAAM,EAAE,WAAW;KACjB;OACE,EAAE,CAAC;SACD,SAAS,EAAE,sBAAsB;QAClC;SACC,IAAI,CAAC;WACH,IAAI,EAAE,QAAQ;WACd,OAAO,EAAE,IAAI,CAAC,WAAW;WACzB,SAAS,EAAE,IAAI,CAAC,aAAa;WAC7B,YAAY,EAAE,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI;WAClD,SAAS,EAAE,wBAAwB;WACnC,QAAQ,EAAE,CAAC;UACZ,EAAE,GAAG,CAAC;SACP,IAAI,CAAC,CAAC,SAAS,EAAE,gBAAgB,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;QACrD;MACF;IACF;EACF,CAAC","file":"react-tokeninput.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TokenInput\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"TokenInput\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 09aa5cf0d89feea60fad\n **/","var TokenInput = require('./lib/main')\nTokenInput.Option = require('./lib/option')\n\nmodule.exports = TokenInput\n\n\n\n/** WEBPACK FOOTER **\n ** ./index.js\n **/","var React = require('react');\nvar Combobox = React.createFactory(require('./combobox'));\nvar Token = React.createFactory(require('./token'));\n\nvar ul = React.createFactory('ul');\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n propTypes: {\n onInput: React.PropTypes.func,\n onSelect: React.PropTypes.func.isRequired,\n onRemove: React.PropTypes.func.isRequired,\n selected: React.PropTypes.array.isRequired,\n menuContent: React.PropTypes.any,\n showListOnFocus: React.PropTypes.bool\n },\n\n getInitialState: function() {\n return {\n selectedToken: null\n };\n },\n\n handleClick: function() {\n // TODO: Expand combobox API for focus\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleInput: function(event) {\n this.props.onInput(event);\n },\n\n handleSelect: function(event) {\n this.props.onSelect(event)\n this.setState({\n selectedToken: null\n })\n },\n\n handleRemove: function(value) {\n this.props.onRemove(value);\n this.refs['combo-li'].getDOMNode().querySelector('input').focus();\n },\n\n handleRemoveLast: function() {\n this.props.onRemove(this.props.selected[this.props.selected.length - 1]);\n },\n\n render: function() {\n var tokens = this.props.selected.map(function(token) {\n return (\n Token({\n onRemove: this.handleRemove,\n value: token,\n name: token.name,\n key: token.id})\n )\n }.bind(this))\n\n return ul({className: 'ic-tokens flex', onClick: this.handleClick},\n tokens,\n li({className: 'inline-flex', ref: 'combo-li'},\n Combobox({\n id: this.props.id,\n ariaLabel: this.props['combobox-aria-label'],\n onInput: this.handleInput,\n showListOnFocus: this.props.showListOnFocus,\n onSelect: this.handleSelect,\n onRemoveLast: this.handleRemoveLast,\n value: this.state.selectedToken\n },\n this.props.menuContent\n )\n )\n );\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/main.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n ** module id = 2\n ** module chunks = 0\n **/","var React = require('react');\nvar guid = 0;\nvar k = function(){};\nvar addClass = require('./add-class');\nvar ComboboxOption = React.createFactory(require('./option'));\n\nvar div = React.createFactory('div');\nvar span = React.createFactory('span');\nvar input = React.createFactory('input');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n /**\n * Called when the combobox receives user input, this is your chance to\n * filter the data and rerender the options.\n *\n * Signature:\n *\n * ```js\n * function(userInput){}\n * ```\n */\n onInput: React.PropTypes.func,\n\n /**\n * Called when the combobox receives a selection. You probably want to reset\n * the options to the full list at this point.\n *\n * Signature:\n *\n * ```js\n * function(selectedValue){}\n * ```\n */\n onSelect: React.PropTypes.func\n },\n\n getDefaultProps: function() {\n return {\n autocomplete: 'both',\n onInput: k,\n onSelect: k,\n value: null,\n showListOnFocus: false\n };\n },\n\n getInitialState: function() {\n return {\n value: this.props.value,\n // the value displayed in the input\n inputValue: this.findInitialInputValue(),\n isOpen: false,\n focusedIndex: null,\n matchedAutocompleteOption: null,\n // this prevents crazy jumpiness since we focus options on mouseenter\n usingKeyboard: false,\n activedescendant: null,\n listId: 'ic-tokeninput-list-'+(++guid),\n menu: {\n children: [],\n activedescendant: null,\n isEmpty: true\n }\n };\n },\n\n componentWillMount: function() {\n this.setState({menu: this.makeMenu()});\n },\n\n componentWillReceiveProps: function(newProps) {\n this.setState({menu: this.makeMenu(newProps.children)}, function() {\n if(newProps.children.length && (this.isOpen || document.activeElement === this.refs.input.getDOMNode())) {\n this.showList();\n } else {\n this.hideList();\n }\n\n }.bind(this));\n },\n\n /**\n * We don't create the components, the user supplies them,\n * so before rendering we attach handlers to facilitate communication from\n * the ComboboxOption to the Combobox.\n */\n makeMenu: function(children) {\n var activedescendant;\n var isEmpty = true;\n children = children || this.props.children;\n\n // Should this instead use React.addons.cloneWithProps or React.cloneElement?\n React.Children.forEach(children, function(child, index) {\n if (child.type !== ComboboxOption.type)\n // allow random elements to live in this list\n return;\n isEmpty = false;\n // TODO: cloneWithProps and map instead of altering the children in-place\n var props = child.props;\n if (this.state.value === props.value) {\n // need an ID for WAI-ARIA\n props.id = props.id || 'ic-tokeninput-selected-'+(++guid);\n props.isSelected = true\n activedescendant = props.id;\n }\n props.onBlur = this.handleOptionBlur;\n props.onClick = this.selectOption.bind(this, child);\n props.onFocus = this.handleOptionFocus;\n props.onKeyDown = this.handleOptionKeyDown.bind(this, child);\n props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index);\n }.bind(this));\n\n return {\n children: children,\n activedescendant: activedescendant,\n isEmpty: isEmpty\n };\n },\n\n getClassName: function() {\n var className = addClass(this.props.className, 'ic-tokeninput');\n if (this.state.isOpen)\n className = addClass(className, 'ic-tokeninput-is-open');\n return className;\n },\n\n /**\n * When the user begins typing again we need to clear out any state that has\n * to do with an existing or potential selection.\n */\n clearSelectedState: function(cb) {\n this.setState({\n focusedIndex: null,\n inputValue: null,\n value: null,\n matchedAutocompleteOption: null,\n activedescendant: null\n }, cb);\n },\n\n handleInputChange: function(event) {\n var value = this.refs.input.getDOMNode().value;\n this.clearSelectedState(function() {\n this.props.onInput(value);\n }.bind(this));\n },\n\n handleInputFocus: function() {\n this.maybeShowList();\n },\n\n handleInputClick: function() {\n this.maybeShowList();\n },\n\n maybeShowList: function(){\n if (this.props.showListOnFocus){\n this.showList()\n }\n },\n\n handleInputBlur: function() {\n var focusedAnOption = this.state.focusedIndex != null;\n if (focusedAnOption)\n return;\n this.maybeSelectAutocompletedOption();\n this.hideList();\n },\n\n handleOptionBlur: function() {\n // don't want to hide the list if we focused another option\n this.blurTimer = setTimeout(this.hideList, 0);\n },\n\n\n handleOptionFocus: function() {\n // see `handleOptionBlur`\n clearTimeout(this.blurTimer);\n },\n\n handleInputKeyUp: function(event) {\n if (\n this.state.menu.isEmpty ||\n // autocompleting while backspacing feels super weird, so let's not\n event.keyCode === 8 /*backspace*/ ||\n !this.props.autocomplete.match(/both|inline/)\n ) return;\n },\n\n handleButtonClick: function() {\n this.state.isOpen ? this.hideList() : this.showList();\n this.focusInput();\n },\n\n showList: function() {\n if(!this.state.menu.children.length) {\n return\n }\n this.setState({isOpen: true})\n },\n\n hideList: function() {\n this.setState({\n isOpen: false,\n focusedIndex: null\n });\n },\n\n hideOnEscape: function(event) {\n this.hideList();\n this.focusInput();\n event.preventDefault();\n },\n\n focusInput: function() {\n this.refs.input.getDOMNode().focus();\n },\n\n selectInput: function() {\n this.refs.input.getDOMNode().select();\n },\n\n inputKeydownMap: {\n 8: 'removeLastToken',\n 13: 'selectOnEnter',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n optionKeydownMap: {\n 13: 'selectOption',\n 27: 'hideOnEscape',\n 38: 'focusPrevious',\n 40: 'focusNext'\n },\n\n handleKeydown: function(event) {\n var handlerName = this.inputKeydownMap[event.keyCode];\n if (!handlerName)\n return\n this.setState({usingKeyboard: true});\n return this[handlerName].call(this,event);\n },\n\n handleOptionKeyDown: function(child, event) {\n var handlerName = this.optionKeydownMap[event.keyCode];\n if (!handlerName) {\n // if the user starts typing again while focused on an option, move focus\n // to the inpute, select so it wipes out any existing value\n this.selectInput();\n return;\n }\n event.preventDefault();\n this.setState({usingKeyboard: true});\n this[handlerName].call(this, child);\n },\n\n handleOptionMouseEnter: function(index) {\n if (this.state.usingKeyboard)\n this.setState({usingKeyboard: false});\n else\n this.focusOptionAtIndex(index);\n },\n\n selectOnEnter: function(event) {\n event.preventDefault();\n this.maybeSelectAutocompletedOption()\n },\n\n maybeSelectAutocompletedOption: function() {\n if (!this.state.matchedAutocompleteOption) {\n this.selectText()\n } else {\n this.selectOption(this.state.matchedAutocompleteOption, {focus: false});\n }\n },\n\n selectOption: function(child, options) {\n options = options || {};\n this.setState({\n // value: child.props.value,\n // inputValue: getLabel(child),\n matchedAutocompleteOption: null\n }, function() {\n this.props.onSelect(child.props.value, child);\n this.hideList();\n this.clearSelectedState(); // added\n if (options.focus !== false)\n this.selectInput();\n }.bind(this));\n this.refs.input.getDOMNode().value = '' // added\n },\n\n selectText: function() {\n var value = this.refs.input.getDOMNode().value;\n if(!value) return;\n this.props.onSelect(value);\n this.clearSelectedState();\n this.refs.input.getDOMNode().value = '' // added\n },\n\n focusNext: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var index = this.state.focusedIndex == null ?\n 0 : this.state.focusedIndex + 1;\n this.focusOptionAtIndex(index);\n },\n\n removeLastToken: function() {\n if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) {\n this.props.onRemoveLast()\n }\n return true\n },\n\n focusPrevious: function(event) {\n if(event.preventDefault) event.preventDefault();\n if (this.state.menu.isEmpty) return;\n var last = this.props.children.length - 1;\n var index = this.state.focusedIndex == null ?\n last : this.state.focusedIndex - 1;\n this.focusOptionAtIndex(index);\n },\n\n focusSelectedOption: function() {\n var selectedIndex;\n React.Children.forEach(this.props.children, function(child, index) {\n if (child.props.value === this.state.value)\n selectedIndex = index;\n }.bind(this));\n this.showList();\n this.setState({\n focusedIndex: selectedIndex\n }, this.focusOption);\n },\n\n findInitialInputValue: function() {\n // TODO: might not need this, we should know this in `makeMenu`\n var inputValue;\n React.Children.forEach(this.props.children, function(child) {\n if (child.props.value === this.props.value)\n inputValue = getLabel(child);\n }.bind(this));\n return inputValue;\n },\n\n focusOptionAtIndex: function(index) {\n if (!this.state.isOpen && this.state.value)\n return this.focusSelectedOption();\n this.showList();\n var length = this.props.children.length;\n if (index === -1)\n index = length - 1;\n else if (index === length)\n index = 0;\n this.setState({\n focusedIndex: index\n }, this.focusOption);\n },\n\n focusOption: function() {\n var index = this.state.focusedIndex;\n this.refs.list.getDOMNode().childNodes[index].focus();\n },\n\n render: function() {\n var ariaLabel = this.props['aria-label'] || 'Start typing to search. ' +\n 'Press the down arrow to navigate results. If you don\\'t find an ' +\n 'acceptable option, you can enter an alternative.'\n\n return div({className: this.getClassName()},\n this.props.value,\n this.state.inputValue,\n input({\n ref: 'input',\n autoComplete: 'off',\n spellCheck: 'false',\n 'aria-label': ariaLabel,\n 'aria-expanded': this.state.isOpen+'',\n 'aria-haspopup': 'true',\n 'aria-activedescendant': this.state.menu.activedescendant,\n 'aria-autocomplete': 'list',\n 'aria-owns': this.state.listId,\n id: this.props.id,\n className: 'ic-tokeninput-input',\n onFocus: this.handleInputFocus,\n onClick: this.handleInputClick,\n onChange: this.handleInputChange,\n onBlur: this.handleInputBlur,\n onKeyDown: this.handleKeydown,\n onKeyUp: this.handleInputKeyUp,\n role: 'combobox'\n }),\n span({\n 'aria-hidden': 'true',\n className: 'ic-tokeninput-button',\n onClick: this.handleButtonClick\n }, '▾'),\n div({\n id: this.state.listId,\n ref: 'list',\n className: 'ic-tokeninput-list',\n role: 'listbox'\n }, this.state.menu.children)\n );\n }\n});\n\nfunction getLabel(component) {\n return component.props.label || component.props.children;\n}\n\nfunction matchFragment(userInput, firstChildLabel) {\n userInput = userInput.toLowerCase();\n firstChildLabel = firstChildLabel.toLowerCase();\n if (userInput === '' || userInput === firstChildLabel)\n return false;\n if (firstChildLabel.toLowerCase().indexOf(userInput.toLowerCase()) === -1)\n return false;\n return true;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/combobox.js\n **/","module.exports = addClass;\n\nfunction addClass(existing, added) {\n if (!existing) return added;\n if (existing.indexOf(added) > -1) return existing;\n return existing + ' ' + added;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/add-class.js\n **/","var React = require('react');\nvar addClass = require('./add-class');\nvar div = React.createFactory('div');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n\n /**\n * The value that will be sent to the `onSelect` handler of the\n * parent Combobox.\n */\n value: React.PropTypes.any.isRequired,\n\n /**\n * What value to put into the input element when this option is\n * selected, defaults to its children coerced to a string.\n */\n label: React.PropTypes.string\n },\n\n getDefaultProps: function() {\n return {\n role: 'option',\n tabIndex: '-1',\n className: 'ic-tokeninput-option',\n isSelected: false\n };\n },\n\n render: function() {\n var props = this.props;\n if (props.isSelected) {\n props.className = addClass(props.className, 'ic-tokeninput-selected');\n props.ariaSelected = true;\n }\n return div(props);\n }\n\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/option.js\n **/","var React = require('react');\nvar span = React.DOM.span;\nvar li = React.createFactory('li');\n\nmodule.exports = React.createClass({\n handleClick: function() {\n this.props.onRemove(this.props.value)\n },\n\n handleKeyDown: function(key) {\n var enterKey = 13;\n if(key.keyCode === enterKey) this.props.onRemove(this.props.value)\n },\n\n render: function() {\n return (\n li({\n className: \"ic-token inline-flex\"\n },\n span({\n role: 'button',\n onClick: this.handleClick,\n onKeyDown: this.handleKeyDown,\n 'aria-label': 'Remove \\'' + this.props.name + '\\'',\n className: \"ic-token-delete-button\",\n tabIndex: 0\n }, \"✕\"),\n span({className: \"ic-token-label\"}, this.props.name)\n )\n )\n }\n})\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/token.js\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/lib/combobox.js b/lib/combobox.js index 9508d54..6b6724c 100644 --- a/lib/combobox.js +++ b/lib/combobox.js @@ -148,6 +148,14 @@ module.exports = React.createClass({ }, handleInputFocus: function() { + this.maybeShowList(); + }, + + handleInputClick: function() { + this.maybeShowList(); + }, + + maybeShowList: function(){ if (this.props.showListOnFocus){ this.showList() } @@ -194,7 +202,10 @@ module.exports = React.createClass({ }, hideList: function() { - this.setState({isOpen: false}); + this.setState({ + isOpen: false, + focusedIndex: null + }); }, hideOnEscape: function(event) { @@ -377,6 +388,7 @@ module.exports = React.createClass({ id: this.props.id, className: 'ic-tokeninput-input', onFocus: this.handleInputFocus, + onClick: this.handleInputClick, onChange: this.handleInputChange, onBlur: this.handleInputBlur, onKeyDown: this.handleKeydown, diff --git a/package.json b/package.json index 7660d50..73ec7e5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-tokeninput", - "version": "0.3.5", + "version": "0.3.6", "description": "Tokeninput component for React", "main": "index.js", "scripts": { From baadd02881339fe1dd87243ac5e93e19f39c5e50 Mon Sep 17 00:00:00 2001 From: Ilian Yotov Date: Mon, 12 Oct 2015 21:14:33 +0300 Subject: [PATCH 14/62] Migrate to React 0.14 --- example/main.js | 3 ++- lib/combobox.js | 46 ++++++++++++++++++++++++---------------------- lib/main.js | 4 ++-- package.json | 3 ++- 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/example/main.js b/example/main.js index c212907..e1da2a0 100644 --- a/example/main.js +++ b/example/main.js @@ -1,4 +1,5 @@ var React = require('react') +var ReactDOM = require('react-dom') var TokenInput = require('../index') var ComboboxOption = require('../index').Option @@ -94,4 +95,4 @@ var App = React.createClass({ } }) -React.render(, document.getElementById('application')) +ReactDOM.render(, document.getElementById('application')) diff --git a/lib/combobox.js b/lib/combobox.js index 6b6724c..23c7db5 100644 --- a/lib/combobox.js +++ b/lib/combobox.js @@ -2,7 +2,7 @@ var React = require('react'); var guid = 0; var k = function(){}; var addClass = require('./add-class'); -var ComboboxOption = React.createFactory(require('./option')); +var ComboboxOption = require('./option'); var div = React.createFactory('div'); var span = React.createFactory('span'); @@ -72,7 +72,7 @@ module.exports = React.createClass({ componentWillReceiveProps: function(newProps) { this.setState({menu: this.makeMenu(newProps.children)}, function() { - if(newProps.children.length && (this.isOpen || document.activeElement === this.refs.input.getDOMNode())) { + if(newProps.children.length && (this.isOpen || document.activeElement === this.refs.input)) { this.showList(); } else { this.hideList(); @@ -92,28 +92,30 @@ module.exports = React.createClass({ children = children || this.props.children; // Should this instead use React.addons.cloneWithProps or React.cloneElement? - React.Children.forEach(children, function(child, index) { - if (child.type !== ComboboxOption.type) + var _children = React.Children.map(children, function(child, index) { + if (child.type !== ComboboxOption) // allow random elements to live in this list return; isEmpty = false; // TODO: cloneWithProps and map instead of altering the children in-place - var props = child.props; - if (this.state.value === props.value) { + var newProps = {}; + if (this.state.value === child.props.value) { // need an ID for WAI-ARIA - props.id = props.id || 'ic-tokeninput-selected-'+(++guid); - props.isSelected = true + newProps.id = props.id || 'ic-tokeninput-selected-'+(++guid); + newProps.isSelected = true activedescendant = props.id; } - props.onBlur = this.handleOptionBlur; - props.onClick = this.selectOption.bind(this, child); - props.onFocus = this.handleOptionFocus; - props.onKeyDown = this.handleOptionKeyDown.bind(this, child); - props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index); + newProps.onBlur = this.handleOptionBlur; + newProps.onClick = this.selectOption.bind(this, child); + newProps.onFocus = this.handleOptionFocus; + newProps.onKeyDown = this.handleOptionKeyDown.bind(this, child); + newProps.onMouseEnter = this.handleOptionMouseEnter.bind(this, index); + + return React.cloneElement(child, newProps); }.bind(this)); return { - children: children, + children: _children, activedescendant: activedescendant, isEmpty: isEmpty }; @@ -141,7 +143,7 @@ module.exports = React.createClass({ }, handleInputChange: function(event) { - var value = this.refs.input.getDOMNode().value; + var value = this.refs.input.value; this.clearSelectedState(function() { this.props.onInput(value); }.bind(this)); @@ -215,11 +217,11 @@ module.exports = React.createClass({ }, focusInput: function() { - this.refs.input.getDOMNode().focus(); + this.refs.input.focus(); }, selectInput: function() { - this.refs.input.getDOMNode().select(); + this.refs.input.select(); }, inputKeydownMap: { @@ -291,15 +293,15 @@ module.exports = React.createClass({ if (options.focus !== false) this.selectInput(); }.bind(this)); - this.refs.input.getDOMNode().value = '' // added + this.refs.input.value = '' // added }, selectText: function() { - var value = this.refs.input.getDOMNode().value; + var value = this.refs.input.value; if(!value) return; this.props.onSelect(value); this.clearSelectedState(); - this.refs.input.getDOMNode().value = '' // added + this.refs.input.value = '' // added }, focusNext: function(event) { @@ -311,7 +313,7 @@ module.exports = React.createClass({ }, removeLastToken: function() { - if(this.props.onRemoveLast && !this.refs.input.getDOMNode().value) { + if(this.props.onRemoveLast && !this.refs.input.value) { this.props.onRemoveLast() } return true @@ -364,7 +366,7 @@ module.exports = React.createClass({ focusOption: function() { var index = this.state.focusedIndex; - this.refs.list.getDOMNode().childNodes[index].focus(); + this.refs.list.childNodes[index].focus(); }, render: function() { diff --git a/lib/main.js b/lib/main.js index dc796df..66a5593 100644 --- a/lib/main.js +++ b/lib/main.js @@ -23,7 +23,7 @@ module.exports = React.createClass({ handleClick: function() { // TODO: Expand combobox API for focus - this.refs['combo-li'].getDOMNode().querySelector('input').focus(); + this.refs['combo-li'].querySelector('input').focus(); }, handleInput: function(event) { @@ -39,7 +39,7 @@ module.exports = React.createClass({ handleRemove: function(value) { this.props.onRemove(value); - this.refs['combo-li'].getDOMNode().querySelector('input').focus(); + this.refs['combo-li'].querySelector('input').focus(); }, handleRemoveLast: function() { diff --git a/package.json b/package.json index 73ec7e5..57ac878 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,8 @@ "karma-webpack": "^1.3.1", "lodash-node": "^2.4.1", "mocha": "^2.0.1", - "react": "^0.12.0", + "react": "^0.14.0", + "react-dom": "^0.14.0", "webpack": "^1.4.13", "webpack-dev-server": "^1.6.5" } From a6960d11b3236aa8539e0d6b386d130577e92f4f Mon Sep 17 00:00:00 2001 From: Aaron Shafovaloff Date: Mon, 12 Oct 2015 14:35:07 -0600 Subject: [PATCH 15/62] fix sanity test --- package.json | 14 ++++++++------ test/sanity.spec.js | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 57ac878..b5ee1f6 100644 --- a/package.json +++ b/package.json @@ -22,19 +22,21 @@ "babel-core": "^4.7.16", "babel-loader": "^4.2.0", "chai": "^1.10.0", - "karma": "^0.12.24", + "jsx-loader": "^0.13.2", + "karma": "^0.13.10", "karma-chai": "^0.1.0", - "karma-chrome-launcher": "^0.1.5", + "karma-chrome-launcher": "^0.2.1", "karma-cli": "0.0.4", - "karma-firefox-launcher": "^0.1.3", + "karma-firefox-launcher": "^0.1.6", "karma-jasmine": "^0.2.3", - "karma-mocha": "^0.1.9", + "karma-mocha": "^0.2.0", "karma-webpack": "^1.3.1", "lodash-node": "^2.4.1", "mocha": "^2.0.1", "react": "^0.14.0", + "react-addons-test-utils": "^0.14.0", "react-dom": "^0.14.0", - "webpack": "^1.4.13", - "webpack-dev-server": "^1.6.5" + "webpack": "^1.12.2", + "webpack-dev-server": "^1.12.0" } } diff --git a/test/sanity.spec.js b/test/sanity.spec.js index a288fd1..8c885de 100644 --- a/test/sanity.spec.js +++ b/test/sanity.spec.js @@ -1,5 +1,5 @@ var React = require('react/addons') -var TestUtils = React.addons.TestUtils +var TestUtils = require('react-addons-test-utils') var Tokeninput = React.createFactory(require('../index')) From 43d85d12b7ac7bb6a9de712c964dd661997f0e70 Mon Sep 17 00:00:00 2001 From: Aaron Shafovaloff Date: Mon, 12 Oct 2015 14:36:15 -0600 Subject: [PATCH 16/62] 1.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b5ee1f6..51feb16 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-tokeninput", - "version": "0.3.6", + "version": "1.0.0", "description": "Tokeninput component for React", "main": "index.js", "scripts": { From a86ebc56c3e030091abcdba2f5a75c26d6c3ad1d Mon Sep 17 00:00:00 2001 From: Aaron Shafovaloff Date: Thu, 5 Nov 2015 14:00:06 -0700 Subject: [PATCH 17/62] better multiline support in example --- example/styles.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/example/styles.css b/example/styles.css index 8277cad..c738f9f 100644 --- a/example/styles.css +++ b/example/styles.css @@ -118,13 +118,14 @@ body { .ic-tokens { z-index: 1; list-style: none; - padding: 6px 6px; + padding: 4px 6px; border: 1px solid #A6A6A6; background-color: white; border-radius: 3px; cursor: text; position: relative; will-change: transform; + flex-wrap: wrap; } .ic-token { @@ -134,6 +135,8 @@ body { border-radius: 3px; padding: 3px 8px; margin-right: 6px; + margin-top: 2px; + margin-bottom: 2px; } .ic-token-delete-button { From db07e7298acf1e2419e2275ec35bde07fa265d41 Mon Sep 17 00:00:00 2001 From: Aaron Shafovaloff Date: Mon, 9 Nov 2015 12:44:53 -0700 Subject: [PATCH 18/62] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d17c631..af53dc0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![](https://travis-ci.org/instructure/react-tokeninput.svg?branch=master) +![](https://travis-ci.org/instructure-react/react-tokeninput.svg?branch=master) ![](http://i.imgur.com/aboKyTx.png) From 383dba380ce6db08ab76d48cfb6963171c0babed Mon Sep 17 00:00:00 2001 From: Aaron Shafovaloff Date: Wed, 11 Nov 2015 10:42:53 -0700 Subject: [PATCH 19/62] build --- dist/react-tokeninput.js | 23438 ++++++++++++++++++++++++++++- dist/react-tokeninput.js.map | 2 +- dist/react-tokeninput.min.js | 704 +- dist/react-tokeninput.min.js.map | 2 +- 4 files changed, 22970 insertions(+), 1176 deletions(-) diff --git a/dist/react-tokeninput.js b/dist/react-tokeninput.js index e60158e..82fb2b4 100644 --- a/dist/react-tokeninput.js +++ b/dist/react-tokeninput.js @@ -54,98 +54,117 @@ return /******/ (function(modules) { // webpackBootstrap /* 0 */ /***/ function(module, exports, __webpack_require__) { - var TokenInput = __webpack_require__(1) - TokenInput.Option = __webpack_require__(5) - - module.exports = TokenInput + __webpack_require__(1); + module.exports = __webpack_require__(149); /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { - var React = __webpack_require__(2); - var Combobox = React.createFactory(__webpack_require__(3)); - var Token = React.createFactory(__webpack_require__(6)); - - var ul = React.createFactory('ul'); - var li = React.createFactory('li'); + var React = __webpack_require__(2) + var ReactDOM = __webpack_require__(3) + var TokenInput = __webpack_require__(149) + var ComboboxOption = __webpack_require__(149).Option - module.exports = React.createClass({displayName: "module.exports", - propTypes: { - onInput: React.PropTypes.func, - onSelect: React.PropTypes.func.isRequired, - onRemove: React.PropTypes.func.isRequired, - selected: React.PropTypes.array.isRequired, - menuContent: React.PropTypes.any, - showListOnFocus: React.PropTypes.bool - }, + var without = __webpack_require__(155) + var uniq = __webpack_require__(168) + var names = __webpack_require__(193) + var App = React.createClass({displayName: "App", getInitialState: function() { return { - selectedToken: null + selected: [], + options: names }; }, - handleClick: function() { - // TODO: Expand combobox API for focus - this.refs['combo-li'].getDOMNode().querySelector('input').focus(); + handleChange: function(value) { + this.setState({ + selected: value + }) }, - handleInput: function(event) { - this.props.onInput(event); + handleRemove: function(value) { + var selectedOptions = uniq(without(this.state.selected,value)) + this.handleChange(selectedOptions) }, - handleSelect: function(event) { - this.props.onSelect(event) + handleSelect: function(value, combobox) { + if(typeof value === 'string') { + value = {id: value, name: value}; + } + + var selected = uniq(this.state.selected.concat([value])) this.setState({ + selected: selected, selectedToken: null }) + + this.handleChange(selected) }, - handleRemove: function(value) { - this.props.onRemove(value); - this.refs['combo-li'].getDOMNode().querySelector('input').focus(); + handleInput: function(userInput) { + // this.setState({selectedStateId: null}); + this.filterTags(userInput); }, - handleRemoveLast: function() { - this.props.onRemove(this.props.selected[this.props.selected.length - 1]); + filterTags: function(userInput) { + if (userInput === '') + return this.setState({options: []}); + var filter = new RegExp('^'+userInput, 'i'); + this.setState({options: names.filter(function(state) { + return filter.test(state.name) || filter.test(state.id); + })}); }, - render: function() { - var tokens = this.props.selected.map(function(token) { + renderComboboxOptions: function() { + return this.state.options.map(function(name) { return ( - Token({ - onRemove: this.handleRemove, - value: token, - name: token.name, - key: token.id}) - ) - }.bind(this)) + React.createElement(ComboboxOption, { + key: name.id, + value: name + }, name.name) + ); + }); + }, - return ul({className: 'ic-tokens flex', onClick: this.handleClick}, - tokens, - li({className: 'inline-flex', ref: 'combo-li'}, - Combobox({ - id: this.props.id, - ariaLabel: this.props['combobox-aria-label'], - onInput: this.handleInput, - showListOnFocus: this.props.showListOnFocus, - onSelect: this.handleSelect, - onRemoveLast: this.handleRemoveLast, - value: this.state.selectedToken - }, - this.props.menuContent + render: function() { + var selectedFlavors = this.state.selected.map(function(tag) { + return React.createElement("li", {key: tag.id}, tag.name) + }) + + + var options = this.state.options.length ? + this.renderComboboxOptions() : []; + + return ( + React.createElement("div", null, + React.createElement("h1", null, "React TokenInput Example"), + + React.createElement(TokenInput, { + onChange: this.handleChange, + onInput: this.handleInput, + onSelect: this.handleSelect, + onRemove: this.handleRemove, + selected: this.state.selected, + menuContent: options}), + + React.createElement("h2", null, "Selected"), + React.createElement("ul", null, + selectedFlavors ) ) ); } }) + + ReactDOM.render(React.createElement(App, null), document.getElementById('application')) /***/ }, /* 2 */ -/***/ function(module, exports, __webpack_require__) { +/***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_2__; @@ -153,528 +172,22965 @@ return /******/ (function(modules) { // webpackBootstrap /* 3 */ /***/ function(module, exports, __webpack_require__) { - var React = __webpack_require__(2); - var guid = 0; - var k = function(){}; - var addClass = __webpack_require__(4); - var ComboboxOption = React.createFactory(__webpack_require__(5)); + 'use strict'; - var div = React.createFactory('div'); - var span = React.createFactory('span'); - var input = React.createFactory('input'); + module.exports = __webpack_require__(4); + + +/***/ }, +/* 4 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDOM + */ - module.exports = React.createClass({displayName: "module.exports", + /* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/ - propTypes: { - /** - * Called when the combobox receives user input, this is your chance to - * filter the data and rerender the options. - * - * Signature: - * - * ```js - * function(userInput){} - * ``` - */ - onInput: React.PropTypes.func, + 'use strict'; - /** - * Called when the combobox receives a selection. You probably want to reset - * the options to the full list at this point. - * - * Signature: - * - * ```js - * function(selectedValue){} - * ``` - */ - onSelect: React.PropTypes.func - }, + var ReactCurrentOwner = __webpack_require__(6); + var ReactDOMTextComponent = __webpack_require__(7); + var ReactDefaultInjection = __webpack_require__(72); + var ReactInstanceHandles = __webpack_require__(46); + var ReactMount = __webpack_require__(29); + var ReactPerf = __webpack_require__(19); + var ReactReconciler = __webpack_require__(51); + var ReactUpdates = __webpack_require__(55); + var ReactVersion = __webpack_require__(147); - getDefaultProps: function() { - return { - autocomplete: 'both', - onInput: k, - onSelect: k, - value: null, - showListOnFocus: false - }; - }, + var findDOMNode = __webpack_require__(92); + var renderSubtreeIntoContainer = __webpack_require__(148); + var warning = __webpack_require__(26); - getInitialState: function() { - return { - value: this.props.value, - // the value displayed in the input - inputValue: this.findInitialInputValue(), - isOpen: false, - focusedIndex: null, - matchedAutocompleteOption: null, - // this prevents crazy jumpiness since we focus options on mouseenter - usingKeyboard: false, - activedescendant: null, - listId: 'ic-tokeninput-list-'+(++guid), - menu: { - children: [], - activedescendant: null, - isEmpty: true - } - }; - }, + ReactDefaultInjection.inject(); - componentWillMount: function() { - this.setState({menu: this.makeMenu()}); - }, + var render = ReactPerf.measure('React', 'render', ReactMount.render); - componentWillReceiveProps: function(newProps) { - this.setState({menu: this.makeMenu(newProps.children)}, function() { - if(newProps.children.length && (this.isOpen || document.activeElement === this.refs.input.getDOMNode())) { - this.showList(); - } else { - this.hideList(); - } + var React = { + findDOMNode: findDOMNode, + render: render, + unmountComponentAtNode: ReactMount.unmountComponentAtNode, + version: ReactVersion, - }.bind(this)); - }, + /* eslint-disable camelcase */ + unstable_batchedUpdates: ReactUpdates.batchedUpdates, + unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer + }; - /** - * We don't create the components, the user supplies them, - * so before rendering we attach handlers to facilitate communication from - * the ComboboxOption to the Combobox. - */ - makeMenu: function(children) { - var activedescendant; - var isEmpty = true; - children = children || this.props.children; + // Inject the runtime into a devtools global hook regardless of browser. + // Allows for debugging when the hook is injected on the page. + /* eslint-enable camelcase */ + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') { + __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ + CurrentOwner: ReactCurrentOwner, + InstanceHandles: ReactInstanceHandles, + Mount: ReactMount, + Reconciler: ReactReconciler, + TextComponent: ReactDOMTextComponent + }); + } - // Should this instead use React.addons.cloneWithProps or React.cloneElement? - React.Children.forEach(children, function(child, index) { - if (child.type !== ComboboxOption.type) - // allow random elements to live in this list - return; - isEmpty = false; - // TODO: cloneWithProps and map instead of altering the children in-place - var props = child.props; - if (this.state.value === props.value) { - // need an ID for WAI-ARIA - props.id = props.id || 'ic-tokeninput-selected-'+(++guid); - props.isSelected = true - activedescendant = props.id; + if (process.env.NODE_ENV !== 'production') { + var ExecutionEnvironment = __webpack_require__(10); + if (ExecutionEnvironment.canUseDOM && window.top === window.self) { + + // First check if devtools is not installed + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') { + // If we're in Chrome or Firefox, provide a download link if not installed. + if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) { + console.debug('Download the React DevTools for a better development experience: ' + 'https://fb.me/react-devtools'); } - props.onBlur = this.handleOptionBlur; - props.onClick = this.selectOption.bind(this, child); - props.onFocus = this.handleOptionFocus; - props.onKeyDown = this.handleOptionKeyDown.bind(this, child); - props.onMouseEnter = this.handleOptionMouseEnter.bind(this, index); - }.bind(this)); + } - return { - children: children, - activedescendant: activedescendant, - isEmpty: isEmpty - }; - }, + // If we're in IE8, check to see if we are in compatibility mode and provide + // information on preventing compatibility mode + var ieCompatibilityMode = document.documentMode && document.documentMode < 8; - getClassName: function() { - var className = addClass(this.props.className, 'ic-tokeninput'); - if (this.state.isOpen) - className = addClass(className, 'ic-tokeninput-is-open'); - return className; - }, + process.env.NODE_ENV !== 'production' ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '') : undefined; - /** - * When the user begins typing again we need to clear out any state that has - * to do with an existing or potential selection. - */ - clearSelectedState: function(cb) { - this.setState({ - focusedIndex: null, - inputValue: null, - value: null, - matchedAutocompleteOption: null, - activedescendant: null - }, cb); - }, + var expectedFeatures = [ + // shims + Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.split, String.prototype.trim, - handleInputChange: function(event) { - var value = this.refs.input.getDOMNode().value; - this.clearSelectedState(function() { - this.props.onInput(value); - }.bind(this)); - }, + // shams + Object.create, Object.freeze]; - handleInputFocus: function() { - this.maybeShowList(); - }, + for (var i = 0; i < expectedFeatures.length; i++) { + if (!expectedFeatures[i]) { + console.error('One or more ES5 shim/shams expected by React are not available: ' + 'https://fb.me/react-warning-polyfills'); + break; + } + } + } + } - handleInputClick: function() { - this.maybeShowList(); - }, + module.exports = React; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) + +/***/ }, +/* 5 */ +/***/ function(module, exports) { + + // shim for using process in browser - maybeShowList: function(){ - if (this.props.showListOnFocus){ - this.showList() + var process = module.exports = {}; + var queue = []; + var draining = false; + var currentQueue; + var queueIndex = -1; + + function cleanUpNextTick() { + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; } - }, + if (queue.length) { + drainQueue(); + } + } - handleInputBlur: function() { - var focusedAnOption = this.state.focusedIndex != null; - if (focusedAnOption) - return; - this.maybeSelectAutocompletedOption(); - this.hideList(); - }, + function drainQueue() { + if (draining) { + return; + } + var timeout = setTimeout(cleanUpNextTick); + draining = true; - handleOptionBlur: function() { - // don't want to hide the list if we focused another option - this.blurTimer = setTimeout(this.hideList, 0); - }, + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + clearTimeout(timeout); + } + process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + setTimeout(drainQueue, 0); + } + }; - handleOptionFocus: function() { - // see `handleOptionBlur` - clearTimeout(this.blurTimer); - }, + // v8 likes predictible objects + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + Item.prototype.run = function () { + this.fun.apply(null, this.array); + }; + process.title = 'browser'; + process.browser = true; + process.env = {}; + process.argv = []; + process.version = ''; // empty string to avoid regexp issues + process.versions = {}; - handleInputKeyUp: function(event) { - if ( - this.state.menu.isEmpty || - // autocompleting while backspacing feels super weird, so let's not - event.keyCode === 8 /*backspace*/ || - !this.props.autocomplete.match(/both|inline/) - ) return; - }, + function noop() {} - handleButtonClick: function() { - this.state.isOpen ? this.hideList() : this.showList(); - this.focusInput(); - }, + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; - showList: function() { - if(!this.state.menu.children.length) { - return - } - this.setState({isOpen: true}) - }, + process.binding = function (name) { + throw new Error('process.binding is not supported'); + }; - hideList: function() { - this.setState({ - isOpen: false, - focusedIndex: null - }); - }, + process.cwd = function () { return '/' }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); + }; + process.umask = function() { return 0; }; + + +/***/ }, +/* 6 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactCurrentOwner + */ - hideOnEscape: function(event) { - this.hideList(); - this.focusInput(); - event.preventDefault(); - }, + 'use strict'; - focusInput: function() { - this.refs.input.getDOMNode().focus(); - }, + /** + * Keeps track of the current owner. + * + * The current owner is the component who should own any components that are + * currently being constructed. + */ + var ReactCurrentOwner = { - selectInput: function() { - this.refs.input.getDOMNode().select(); - }, + /** + * @internal + * @type {ReactComponent} + */ + current: null - inputKeydownMap: { - 8: 'removeLastToken', - 13: 'selectOnEnter', - 27: 'hideOnEscape', - 38: 'focusPrevious', - 40: 'focusNext' + }; + + module.exports = ReactCurrentOwner; + +/***/ }, +/* 7 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDOMTextComponent + * @typechecks static-only + */ + + 'use strict'; + + var DOMChildrenOperations = __webpack_require__(8); + var DOMPropertyOperations = __webpack_require__(23); + var ReactComponentBrowserEnvironment = __webpack_require__(27); + var ReactMount = __webpack_require__(29); + + var assign = __webpack_require__(40); + var escapeTextContentForBrowser = __webpack_require__(22); + var setTextContent = __webpack_require__(21); + var validateDOMNesting = __webpack_require__(71); + + /** + * Text nodes violate a couple assumptions that React makes about components: + * + * - When mounting text into the DOM, adjacent text nodes are merged. + * - Text nodes cannot be assigned a React root ID. + * + * This component is used to wrap strings in elements so that they can undergo + * the same reconciliation that is applied to elements. + * + * TODO: Investigate representing React components in the DOM with text nodes. + * + * @class ReactDOMTextComponent + * @extends ReactComponent + * @internal + */ + var ReactDOMTextComponent = function (props) { + // This constructor and its argument is currently used by mocks. + }; + + assign(ReactDOMTextComponent.prototype, { + + /** + * @param {ReactText} text + * @internal + */ + construct: function (text) { + // TODO: This is really a ReactText (ReactNode), not a ReactElement + this._currentElement = text; + this._stringText = '' + text; + + // Properties + this._rootNodeID = null; + this._mountIndex = 0; }, - optionKeydownMap: { - 13: 'selectOption', - 27: 'hideOnEscape', - 38: 'focusPrevious', - 40: 'focusNext' + /** + * Creates the markup for this text node. This node is not intended to have + * any features besides containing text content. + * + * @param {string} rootID DOM ID of the root node. + * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction + * @return {string} Markup for this text node. + * @internal + */ + mountComponent: function (rootID, transaction, context) { + if (process.env.NODE_ENV !== 'production') { + if (context[validateDOMNesting.ancestorInfoContextKey]) { + validateDOMNesting('span', null, context[validateDOMNesting.ancestorInfoContextKey]); + } + } + + this._rootNodeID = rootID; + if (transaction.useCreateElement) { + var ownerDocument = context[ReactMount.ownerDocumentContextKey]; + var el = ownerDocument.createElement('span'); + DOMPropertyOperations.setAttributeForID(el, rootID); + // Populate node cache + ReactMount.getID(el); + setTextContent(el, this._stringText); + return el; + } else { + var escapedText = escapeTextContentForBrowser(this._stringText); + + if (transaction.renderToStaticMarkup) { + // Normally we'd wrap this in a `span` for the reasons stated above, but + // since this is a situation where React won't take over (static pages), + // we can simply return the text as it is. + return escapedText; + } + + return '' + escapedText + ''; + } }, - handleKeydown: function(event) { - var handlerName = this.inputKeydownMap[event.keyCode]; - if (!handlerName) - return - this.setState({usingKeyboard: true}); - return this[handlerName].call(this,event); + /** + * Updates this component by updating the text content. + * + * @param {ReactText} nextText The next text content + * @param {ReactReconcileTransaction} transaction + * @internal + */ + receiveComponent: function (nextText, transaction) { + if (nextText !== this._currentElement) { + this._currentElement = nextText; + var nextStringText = '' + nextText; + if (nextStringText !== this._stringText) { + // TODO: Save this as pending props and use performUpdateIfNecessary + // and/or updateComponent to do the actual update for consistency with + // other component types? + this._stringText = nextStringText; + var node = ReactMount.getNode(this._rootNodeID); + DOMChildrenOperations.updateTextContent(node, nextStringText); + } + } }, - handleOptionKeyDown: function(child, event) { - var handlerName = this.optionKeydownMap[event.keyCode]; - if (!handlerName) { - // if the user starts typing again while focused on an option, move focus - // to the inpute, select so it wipes out any existing value - this.selectInput(); - return; + unmountComponent: function () { + ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID); + } + + }); + + module.exports = ReactDOMTextComponent; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule DOMChildrenOperations + * @typechecks static-only + */ + + 'use strict'; + + var Danger = __webpack_require__(9); + var ReactMultiChildUpdateTypes = __webpack_require__(17); + var ReactPerf = __webpack_require__(19); + + var setInnerHTML = __webpack_require__(20); + var setTextContent = __webpack_require__(21); + var invariant = __webpack_require__(14); + + /** + * Inserts `childNode` as a child of `parentNode` at the `index`. + * + * @param {DOMElement} parentNode Parent node in which to insert. + * @param {DOMElement} childNode Child node to insert. + * @param {number} index Index at which to insert the child. + * @internal + */ + function insertChildAt(parentNode, childNode, index) { + // By exploiting arrays returning `undefined` for an undefined index, we can + // rely exclusively on `insertBefore(node, null)` instead of also using + // `appendChild(node)`. However, using `undefined` is not allowed by all + // browsers so we must replace it with `null`. + + // fix render order error in safari + // IE8 will throw error when index out of list size. + var beforeChild = index >= parentNode.childNodes.length ? null : parentNode.childNodes.item(index); + + parentNode.insertBefore(childNode, beforeChild); + } + + /** + * Operations for updating with DOM children. + */ + var DOMChildrenOperations = { + + dangerouslyReplaceNodeWithMarkup: Danger.dangerouslyReplaceNodeWithMarkup, + + updateTextContent: setTextContent, + + /** + * Updates a component's children by processing a series of updates. The + * update configurations are each expected to have a `parentNode` property. + * + * @param {array} updates List of update configurations. + * @param {array} markupList List of markup strings. + * @internal + */ + processUpdates: function (updates, markupList) { + var update; + // Mapping from parent IDs to initial child orderings. + var initialChildren = null; + // List of children that will be moved or removed. + var updatedChildren = null; + + for (var i = 0; i < updates.length; i++) { + update = updates[i]; + if (update.type === ReactMultiChildUpdateTypes.MOVE_EXISTING || update.type === ReactMultiChildUpdateTypes.REMOVE_NODE) { + var updatedIndex = update.fromIndex; + var updatedChild = update.parentNode.childNodes[updatedIndex]; + var parentID = update.parentID; + + !updatedChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processUpdates(): Unable to find child %s of element. This ' + 'probably means the DOM was unexpectedly mutated (e.g., by the ' + 'browser), usually due to forgetting a when using tables, ' + 'nesting tags like
,

, or , or using non-SVG elements ' + 'in an parent. Try inspecting the child nodes of the element ' + 'with React ID `%s`.', updatedIndex, parentID) : invariant(false) : undefined; + + initialChildren = initialChildren || {}; + initialChildren[parentID] = initialChildren[parentID] || []; + initialChildren[parentID][updatedIndex] = updatedChild; + + updatedChildren = updatedChildren || []; + updatedChildren.push(updatedChild); + } } - event.preventDefault(); - this.setState({usingKeyboard: true}); - this[handlerName].call(this, child); + + var renderedMarkup; + // markupList is either a list of markup or just a list of elements + if (markupList.length && typeof markupList[0] === 'string') { + renderedMarkup = Danger.dangerouslyRenderMarkup(markupList); + } else { + renderedMarkup = markupList; + } + + // Remove updated children first so that `toIndex` is consistent. + if (updatedChildren) { + for (var j = 0; j < updatedChildren.length; j++) { + updatedChildren[j].parentNode.removeChild(updatedChildren[j]); + } + } + + for (var k = 0; k < updates.length; k++) { + update = updates[k]; + switch (update.type) { + case ReactMultiChildUpdateTypes.INSERT_MARKUP: + insertChildAt(update.parentNode, renderedMarkup[update.markupIndex], update.toIndex); + break; + case ReactMultiChildUpdateTypes.MOVE_EXISTING: + insertChildAt(update.parentNode, initialChildren[update.parentID][update.fromIndex], update.toIndex); + break; + case ReactMultiChildUpdateTypes.SET_MARKUP: + setInnerHTML(update.parentNode, update.content); + break; + case ReactMultiChildUpdateTypes.TEXT_CONTENT: + setTextContent(update.parentNode, update.content); + break; + case ReactMultiChildUpdateTypes.REMOVE_NODE: + // Already removed by the for-loop above. + break; + } + } + } + + }; + + ReactPerf.measureMethods(DOMChildrenOperations, 'DOMChildrenOperations', { + updateTextContent: 'updateTextContent' + }); + + module.exports = DOMChildrenOperations; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) + +/***/ }, +/* 9 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule Danger + * @typechecks static-only + */ + + 'use strict'; + + var ExecutionEnvironment = __webpack_require__(10); + + var createNodesFromMarkup = __webpack_require__(11); + var emptyFunction = __webpack_require__(16); + var getMarkupWrap = __webpack_require__(15); + var invariant = __webpack_require__(14); + + var OPEN_TAG_NAME_EXP = /^(<[^ \/>]+)/; + var RESULT_INDEX_ATTR = 'data-danger-index'; + + /** + * Extracts the `nodeName` from a string of markup. + * + * NOTE: Extracting the `nodeName` does not require a regular expression match + * because we make assumptions about React-generated markup (i.e. there are no + * spaces surrounding the opening tag and there is at least one attribute). + * + * @param {string} markup String of markup. + * @return {string} Node name of the supplied markup. + * @see http://jsperf.com/extract-nodename + */ + function getNodeName(markup) { + return markup.substring(1, markup.indexOf(' ')); + } + + var Danger = { + + /** + * Renders markup into an array of nodes. The markup is expected to render + * into a list of root nodes. Also, the length of `resultList` and + * `markupList` should be the same. + * + * @param {array} markupList List of markup strings to render. + * @return {array} List of rendered nodes. + * @internal + */ + dangerouslyRenderMarkup: function (markupList) { + !ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): Cannot render markup in a worker ' + 'thread. Make sure `window` and `document` are available globally ' + 'before requiring React when unit testing or use ' + 'ReactDOMServer.renderToString for server rendering.') : invariant(false) : undefined; + var nodeName; + var markupByNodeName = {}; + // Group markup by `nodeName` if a wrap is necessary, else by '*'. + for (var i = 0; i < markupList.length; i++) { + !markupList[i] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): Missing markup.') : invariant(false) : undefined; + nodeName = getNodeName(markupList[i]); + nodeName = getMarkupWrap(nodeName) ? nodeName : '*'; + markupByNodeName[nodeName] = markupByNodeName[nodeName] || []; + markupByNodeName[nodeName][i] = markupList[i]; + } + var resultList = []; + var resultListAssignmentCount = 0; + for (nodeName in markupByNodeName) { + if (!markupByNodeName.hasOwnProperty(nodeName)) { + continue; + } + var markupListByNodeName = markupByNodeName[nodeName]; + + // This for-in loop skips the holes of the sparse array. The order of + // iteration should follow the order of assignment, which happens to match + // numerical index order, but we don't rely on that. + var resultIndex; + for (resultIndex in markupListByNodeName) { + if (markupListByNodeName.hasOwnProperty(resultIndex)) { + var markup = markupListByNodeName[resultIndex]; + + // Push the requested markup with an additional RESULT_INDEX_ATTR + // attribute. If the markup does not start with a < character, it + // will be discarded below (with an appropriate console.error). + markupListByNodeName[resultIndex] = markup.replace(OPEN_TAG_NAME_EXP, + // This index will be parsed back out below. + '$1 ' + RESULT_INDEX_ATTR + '="' + resultIndex + '" '); + } + } + + // Render each group of markup with similar wrapping `nodeName`. + var renderNodes = createNodesFromMarkup(markupListByNodeName.join(''), emptyFunction // Do nothing special with ', '
']; + var trWrap = [3, '', '
']; + + var svgWrap = [1, '', '']; + + var markupWrap = { + '*': [1, '?

'], + + 'area': [1, '', ''], + 'col': [2, '', '
'], + 'legend': [1, '
', '
'], + 'param': [1, '', ''], + 'tr': [2, '', '
'], + + 'optgroup': selectWrap, + 'option': selectWrap, + + 'caption': tableWrap, + 'colgroup': tableWrap, + 'tbody': tableWrap, + 'tfoot': tableWrap, + 'thead': tableWrap, + + 'td': trWrap, + 'th': trWrap + }; + + // Initialize the SVG elements since we know they'll always need to be wrapped + // consistently. If they are created inside a
they will be initialized in + // the wrong namespace (and will not display). + var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan']; + svgElements.forEach(function (nodeName) { + markupWrap[nodeName] = svgWrap; + shouldWrap[nodeName] = true; + }); + + /** + * Gets the markup wrap configuration for the supplied `nodeName`. + * + * NOTE: This lazily detects which wraps are necessary for the current browser. + * + * @param {string} nodeName Lowercase `nodeName`. + * @return {?array} Markup wrap configuration, if applicable. + */ + function getMarkupWrap(nodeName) { + !!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : undefined; + if (!markupWrap.hasOwnProperty(nodeName)) { + nodeName = '*'; + } + if (!shouldWrap.hasOwnProperty(nodeName)) { + if (nodeName === '*') { + dummyNode.innerHTML = ''; + } else { + dummyNode.innerHTML = '<' + nodeName + '>'; + } + shouldWrap[nodeName] = !dummyNode.firstChild; + } + return shouldWrap[nodeName] ? markupWrap[nodeName] : null; + } + + module.exports = getMarkupWrap; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) + +/***/ }, +/* 16 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule emptyFunction + */ + + "use strict"; + + function makeEmptyFunction(arg) { + return function () { + return arg; + }; + } + + /** + * This function accepts and discards inputs; it has no side effects. This is + * primarily useful idiomatically for overridable function endpoints which + * always need to be callable, since JS lacks a null-call idiom ala Cocoa. + */ + function emptyFunction() {} + + emptyFunction.thatReturns = makeEmptyFunction; + emptyFunction.thatReturnsFalse = makeEmptyFunction(false); + emptyFunction.thatReturnsTrue = makeEmptyFunction(true); + emptyFunction.thatReturnsNull = makeEmptyFunction(null); + emptyFunction.thatReturnsThis = function () { + return this; + }; + emptyFunction.thatReturnsArgument = function (arg) { + return arg; + }; + + module.exports = emptyFunction; + +/***/ }, +/* 17 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactMultiChildUpdateTypes + */ + + 'use strict'; + + var keyMirror = __webpack_require__(18); + + /** + * When a component's children are updated, a series of update configuration + * objects are created in order to batch and serialize the required changes. + * + * Enumerates all the possible types of update configurations. + * + * @internal + */ + var ReactMultiChildUpdateTypes = keyMirror({ + INSERT_MARKUP: null, + MOVE_EXISTING: null, + REMOVE_NODE: null, + SET_MARKUP: null, + TEXT_CONTENT: null + }); + + module.exports = ReactMultiChildUpdateTypes; + +/***/ }, +/* 18 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule keyMirror + * @typechecks static-only + */ + + 'use strict'; + + var invariant = __webpack_require__(14); + + /** + * Constructs an enumeration with keys equal to their value. + * + * For example: + * + * var COLORS = keyMirror({blue: null, red: null}); + * var myColor = COLORS.blue; + * var isColorValid = !!COLORS[myColor]; + * + * The last line could not be performed if the values of the generated enum were + * not equal to their keys. + * + * Input: {key1: val1, key2: val2} + * Output: {key1: key1, key2: key2} + * + * @param {object} obj + * @return {object} + */ + var keyMirror = function (obj) { + var ret = {}; + var key; + !(obj instanceof Object && !Array.isArray(obj)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : undefined; + for (key in obj) { + if (!obj.hasOwnProperty(key)) { + continue; + } + ret[key] = key; + } + return ret; + }; + + module.exports = keyMirror; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) + +/***/ }, +/* 19 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactPerf + * @typechecks static-only + */ + + 'use strict'; + + /** + * ReactPerf is a general AOP system designed to measure performance. This + * module only has the hooks: see ReactDefaultPerf for the analysis tool. + */ + var ReactPerf = { + /** + * Boolean to enable/disable measurement. Set to false by default to prevent + * accidental logging and perf loss. + */ + enableMeasure: false, + + /** + * Holds onto the measure function in use. By default, don't measure + * anything, but we'll override this if we inject a measure function. + */ + storedMeasure: _noMeasure, + + /** + * @param {object} object + * @param {string} objectName + * @param {object} methodNames + */ + measureMethods: function (object, objectName, methodNames) { + if (process.env.NODE_ENV !== 'production') { + for (var key in methodNames) { + if (!methodNames.hasOwnProperty(key)) { + continue; + } + object[key] = ReactPerf.measure(objectName, methodNames[key], object[key]); + } + } + }, + + /** + * Use this to wrap methods you want to measure. Zero overhead in production. + * + * @param {string} objName + * @param {string} fnName + * @param {function} func + * @return {function} + */ + measure: function (objName, fnName, func) { + if (process.env.NODE_ENV !== 'production') { + var measuredFunc = null; + var wrapper = function () { + if (ReactPerf.enableMeasure) { + if (!measuredFunc) { + measuredFunc = ReactPerf.storedMeasure(objName, fnName, func); + } + return measuredFunc.apply(this, arguments); + } + return func.apply(this, arguments); + }; + wrapper.displayName = objName + '_' + fnName; + return wrapper; + } + return func; + }, + + injection: { + /** + * @param {function} measure + */ + injectMeasure: function (measure) { + ReactPerf.storedMeasure = measure; + } + } + }; + + /** + * Simply passes through the measured function, without measuring it. + * + * @param {string} objName + * @param {string} fnName + * @param {function} func + * @return {function} + */ + function _noMeasure(objName, fnName, func) { + return func; + } + + module.exports = ReactPerf; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) + +/***/ }, +/* 20 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule setInnerHTML + */ + + /* globals MSApp */ + + 'use strict'; + + var ExecutionEnvironment = __webpack_require__(10); + + var WHITESPACE_TEST = /^[ \r\n\t\f]/; + var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/; + + /** + * Set the innerHTML property of a node, ensuring that whitespace is preserved + * even in IE8. + * + * @param {DOMElement} node + * @param {string} html + * @internal + */ + var setInnerHTML = function (node, html) { + node.innerHTML = html; + }; + + // Win8 apps: Allow all html to be inserted + if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) { + setInnerHTML = function (node, html) { + MSApp.execUnsafeLocalFunction(function () { + node.innerHTML = html; + }); + }; + } + + if (ExecutionEnvironment.canUseDOM) { + // IE8: When updating a just created node with innerHTML only leading + // whitespace is removed. When updating an existing node with innerHTML + // whitespace in root TextNodes is also collapsed. + // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html + + // Feature detection; only IE8 is known to behave improperly like this. + var testElement = document.createElement('div'); + testElement.innerHTML = ' '; + if (testElement.innerHTML === '') { + setInnerHTML = function (node, html) { + // Magic theory: IE8 supposedly differentiates between added and updated + // nodes when processing innerHTML, innerHTML on updated nodes suffers + // from worse whitespace behavior. Re-adding a node like this triggers + // the initial and more favorable whitespace behavior. + // TODO: What to do on a detached node? + if (node.parentNode) { + node.parentNode.replaceChild(node, node); + } + + // We also implement a workaround for non-visible tags disappearing into + // thin air on IE8, this only happens if there is no visible text + // in-front of the non-visible tags. Piggyback on the whitespace fix + // and simply check if any non-visible tags appear in the source. + if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) { + // Recover leading whitespace by temporarily prepending any character. + // \uFEFF has the potential advantage of being zero-width/invisible. + // UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode + // in hopes that this is preserved even if "\uFEFF" is transformed to + // the actual Unicode character (by Babel, for example). + // https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216 + node.innerHTML = String.fromCharCode(0xFEFF) + html; + + // deleteData leaves an empty `TextNode` which offsets the index of all + // children. Definitely want to avoid this. + var textNode = node.firstChild; + if (textNode.data.length === 1) { + node.removeChild(textNode); + } else { + textNode.deleteData(0, 1); + } + } else { + node.innerHTML = html; + } + }; + } + } + + module.exports = setInnerHTML; + +/***/ }, +/* 21 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule setTextContent + */ + + 'use strict'; + + var ExecutionEnvironment = __webpack_require__(10); + var escapeTextContentForBrowser = __webpack_require__(22); + var setInnerHTML = __webpack_require__(20); + + /** + * Set the textContent property of a node, ensuring that whitespace is preserved + * even in IE8. innerText is a poor substitute for textContent and, among many + * issues, inserts
instead of the literal newline chars. innerHTML behaves + * as it should. + * + * @param {DOMElement} node + * @param {string} text + * @internal + */ + var setTextContent = function (node, text) { + node.textContent = text; + }; + + if (ExecutionEnvironment.canUseDOM) { + if (!('textContent' in document.documentElement)) { + setTextContent = function (node, text) { + setInnerHTML(node, escapeTextContentForBrowser(text)); + }; + } + } + + module.exports = setTextContent; + +/***/ }, +/* 22 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule escapeTextContentForBrowser + */ + + 'use strict'; + + var ESCAPE_LOOKUP = { + '&': '&', + '>': '>', + '<': '<', + '"': '"', + '\'': ''' + }; + + var ESCAPE_REGEX = /[&><"']/g; + + function escaper(match) { + return ESCAPE_LOOKUP[match]; + } + + /** + * Escapes text to prevent scripting attacks. + * + * @param {*} text Text value to escape. + * @return {string} An escaped string. + */ + function escapeTextContentForBrowser(text) { + return ('' + text).replace(ESCAPE_REGEX, escaper); + } + + module.exports = escapeTextContentForBrowser; + +/***/ }, +/* 23 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule DOMPropertyOperations + * @typechecks static-only + */ + + 'use strict'; + + var DOMProperty = __webpack_require__(24); + var ReactPerf = __webpack_require__(19); + + var quoteAttributeValueForBrowser = __webpack_require__(25); + var warning = __webpack_require__(26); + + // Simplified subset + var VALID_ATTRIBUTE_NAME_REGEX = /^[a-zA-Z_][\w\.\-]*$/; + var illegalAttributeNameCache = {}; + var validatedAttributeNameCache = {}; + + function isAttributeNameSafe(attributeName) { + if (validatedAttributeNameCache.hasOwnProperty(attributeName)) { + return true; + } + if (illegalAttributeNameCache.hasOwnProperty(attributeName)) { + return false; + } + if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { + validatedAttributeNameCache[attributeName] = true; + return true; + } + illegalAttributeNameCache[attributeName] = true; + process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : undefined; + return false; + } + + function shouldIgnoreValue(propertyInfo, value) { + return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false; + } + + if (process.env.NODE_ENV !== 'production') { + var reactProps = { + children: true, + dangerouslySetInnerHTML: true, + key: true, + ref: true + }; + var warnedProperties = {}; + + var warnUnknownProperty = function (name) { + if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) { + return; + } + + warnedProperties[name] = true; + var lowerCasedName = name.toLowerCase(); + + // data-* attributes should be lowercase; suggest the lowercase version + var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null; + + // For now, only warn when we have a suggested correction. This prevents + // logging too much when using transferPropsTo. + process.env.NODE_ENV !== 'production' ? warning(standardName == null, 'Unknown DOM property %s. Did you mean %s?', name, standardName) : undefined; + }; + } + + /** + * Operations for dealing with DOM properties. + */ + var DOMPropertyOperations = { + + /** + * Creates markup for the ID property. + * + * @param {string} id Unescaped ID. + * @return {string} Markup string. + */ + createMarkupForID: function (id) { + return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id); + }, + + setAttributeForID: function (node, id) { + node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id); + }, + + /** + * Creates markup for a property. + * + * @param {string} name + * @param {*} value + * @return {?string} Markup string, or null if the property was invalid. + */ + createMarkupForProperty: function (name, value) { + var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null; + if (propertyInfo) { + if (shouldIgnoreValue(propertyInfo, value)) { + return ''; + } + var attributeName = propertyInfo.attributeName; + if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) { + return attributeName + '=""'; + } + return attributeName + '=' + quoteAttributeValueForBrowser(value); + } else if (DOMProperty.isCustomAttribute(name)) { + if (value == null) { + return ''; + } + return name + '=' + quoteAttributeValueForBrowser(value); + } else if (process.env.NODE_ENV !== 'production') { + warnUnknownProperty(name); + } + return null; + }, + + /** + * Creates markup for a custom property. + * + * @param {string} name + * @param {*} value + * @return {string} Markup string, or empty string if the property was invalid. + */ + createMarkupForCustomAttribute: function (name, value) { + if (!isAttributeNameSafe(name) || value == null) { + return ''; + } + return name + '=' + quoteAttributeValueForBrowser(value); + }, + + /** + * Sets the value for a property on a node. + * + * @param {DOMElement} node + * @param {string} name + * @param {*} value + */ + setValueForProperty: function (node, name, value) { + var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null; + if (propertyInfo) { + var mutationMethod = propertyInfo.mutationMethod; + if (mutationMethod) { + mutationMethod(node, value); + } else if (shouldIgnoreValue(propertyInfo, value)) { + this.deleteValueForProperty(node, name); + } else if (propertyInfo.mustUseAttribute) { + var attributeName = propertyInfo.attributeName; + var namespace = propertyInfo.attributeNamespace; + // `setAttribute` with objects becomes only `[object]` in IE8/9, + // ('' + value) makes it output the correct toString()-value. + if (namespace) { + node.setAttributeNS(namespace, attributeName, '' + value); + } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) { + node.setAttribute(attributeName, ''); + } else { + node.setAttribute(attributeName, '' + value); + } + } else { + var propName = propertyInfo.propertyName; + // Must explicitly cast values for HAS_SIDE_EFFECTS-properties to the + // property type before comparing; only `value` does and is string. + if (!propertyInfo.hasSideEffects || '' + node[propName] !== '' + value) { + // Contrary to `setAttribute`, object properties are properly + // `toString`ed by IE8/9. + node[propName] = value; + } + } + } else if (DOMProperty.isCustomAttribute(name)) { + DOMPropertyOperations.setValueForAttribute(node, name, value); + } else if (process.env.NODE_ENV !== 'production') { + warnUnknownProperty(name); + } + }, + + setValueForAttribute: function (node, name, value) { + if (!isAttributeNameSafe(name)) { + return; + } + if (value == null) { + node.removeAttribute(name); + } else { + node.setAttribute(name, '' + value); + } + }, + + /** + * Deletes the value for a property on a node. + * + * @param {DOMElement} node + * @param {string} name + */ + deleteValueForProperty: function (node, name) { + var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null; + if (propertyInfo) { + var mutationMethod = propertyInfo.mutationMethod; + if (mutationMethod) { + mutationMethod(node, undefined); + } else if (propertyInfo.mustUseAttribute) { + node.removeAttribute(propertyInfo.attributeName); + } else { + var propName = propertyInfo.propertyName; + var defaultValue = DOMProperty.getDefaultValueForProperty(node.nodeName, propName); + if (!propertyInfo.hasSideEffects || '' + node[propName] !== defaultValue) { + node[propName] = defaultValue; + } + } + } else if (DOMProperty.isCustomAttribute(name)) { + node.removeAttribute(name); + } else if (process.env.NODE_ENV !== 'production') { + warnUnknownProperty(name); + } + } + + }; + + ReactPerf.measureMethods(DOMPropertyOperations, 'DOMPropertyOperations', { + setValueForProperty: 'setValueForProperty', + setValueForAttribute: 'setValueForAttribute', + deleteValueForProperty: 'deleteValueForProperty' + }); + + module.exports = DOMPropertyOperations; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) + +/***/ }, +/* 24 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule DOMProperty + * @typechecks static-only + */ + + 'use strict'; + + var invariant = __webpack_require__(14); + + function checkMask(value, bitmask) { + return (value & bitmask) === bitmask; + } + + var DOMPropertyInjection = { + /** + * Mapping from normalized, camelcased property names to a configuration that + * specifies how the associated DOM property should be accessed or rendered. + */ + MUST_USE_ATTRIBUTE: 0x1, + MUST_USE_PROPERTY: 0x2, + HAS_SIDE_EFFECTS: 0x4, + HAS_BOOLEAN_VALUE: 0x8, + HAS_NUMERIC_VALUE: 0x10, + HAS_POSITIVE_NUMERIC_VALUE: 0x20 | 0x10, + HAS_OVERLOADED_BOOLEAN_VALUE: 0x40, + + /** + * Inject some specialized knowledge about the DOM. This takes a config object + * with the following properties: + * + * isCustomAttribute: function that given an attribute name will return true + * if it can be inserted into the DOM verbatim. Useful for data-* or aria-* + * attributes where it's impossible to enumerate all of the possible + * attribute names, + * + * Properties: object mapping DOM property name to one of the + * DOMPropertyInjection constants or null. If your attribute isn't in here, + * it won't get written to the DOM. + * + * DOMAttributeNames: object mapping React attribute name to the DOM + * attribute name. Attribute names not specified use the **lowercase** + * normalized name. + * + * DOMAttributeNamespaces: object mapping React attribute name to the DOM + * attribute namespace URL. (Attribute names not specified use no namespace.) + * + * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties. + * Property names not specified use the normalized name. + * + * DOMMutationMethods: Properties that require special mutation methods. If + * `value` is undefined, the mutation method should unset the property. + * + * @param {object} domPropertyConfig the config as described above. + */ + injectDOMPropertyConfig: function (domPropertyConfig) { + var Injection = DOMPropertyInjection; + var Properties = domPropertyConfig.Properties || {}; + var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {}; + var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {}; + var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {}; + var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {}; + + if (domPropertyConfig.isCustomAttribute) { + DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute); + } + + for (var propName in Properties) { + !!DOMProperty.properties.hasOwnProperty(propName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property ' + '\'%s\' which has already been injected. You may be accidentally ' + 'injecting the same DOM property config twice, or you may be ' + 'injecting two configs that have conflicting property names.', propName) : invariant(false) : undefined; + + var lowerCased = propName.toLowerCase(); + var propConfig = Properties[propName]; + + var propertyInfo = { + attributeName: lowerCased, + attributeNamespace: null, + propertyName: propName, + mutationMethod: null, + + mustUseAttribute: checkMask(propConfig, Injection.MUST_USE_ATTRIBUTE), + mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY), + hasSideEffects: checkMask(propConfig, Injection.HAS_SIDE_EFFECTS), + hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE), + hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE), + hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE), + hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE) + }; + + !(!propertyInfo.mustUseAttribute || !propertyInfo.mustUseProperty) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Cannot require using both attribute and property: %s', propName) : invariant(false) : undefined; + !(propertyInfo.mustUseProperty || !propertyInfo.hasSideEffects) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Properties that have side effects must use property: %s', propName) : invariant(false) : undefined; + !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or ' + 'numeric value, but not a combination: %s', propName) : invariant(false) : undefined; + + if (process.env.NODE_ENV !== 'production') { + DOMProperty.getPossibleStandardName[lowerCased] = propName; + } + + if (DOMAttributeNames.hasOwnProperty(propName)) { + var attributeName = DOMAttributeNames[propName]; + propertyInfo.attributeName = attributeName; + if (process.env.NODE_ENV !== 'production') { + DOMProperty.getPossibleStandardName[attributeName] = propName; + } + } + + if (DOMAttributeNamespaces.hasOwnProperty(propName)) { + propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName]; + } + + if (DOMPropertyNames.hasOwnProperty(propName)) { + propertyInfo.propertyName = DOMPropertyNames[propName]; + } + + if (DOMMutationMethods.hasOwnProperty(propName)) { + propertyInfo.mutationMethod = DOMMutationMethods[propName]; + } + + DOMProperty.properties[propName] = propertyInfo; + } + } + }; + var defaultValueCache = {}; + + /** + * DOMProperty exports lookup objects that can be used like functions: + * + * > DOMProperty.isValid['id'] + * true + * > DOMProperty.isValid['foobar'] + * undefined + * + * Although this may be confusing, it performs better in general. + * + * @see http://jsperf.com/key-exists + * @see http://jsperf.com/key-missing + */ + var DOMProperty = { + + ID_ATTRIBUTE_NAME: 'data-reactid', + + /** + * Map from property "standard name" to an object with info about how to set + * the property in the DOM. Each object contains: + * + * attributeName: + * Used when rendering markup or with `*Attribute()`. + * attributeNamespace + * propertyName: + * Used on DOM node instances. (This includes properties that mutate due to + * external factors.) + * mutationMethod: + * If non-null, used instead of the property or `setAttribute()` after + * initial render. + * mustUseAttribute: + * Whether the property must be accessed and mutated using `*Attribute()`. + * (This includes anything that fails ` in `.) + * mustUseProperty: + * Whether the property must be accessed and mutated as an object property. + * hasSideEffects: + * Whether or not setting a value causes side effects such as triggering + * resources to be loaded or text selection changes. If true, we read from + * the DOM before updating to ensure that the value is only set if it has + * changed. + * hasBooleanValue: + * Whether the property should be removed when set to a falsey value. + * hasNumericValue: + * Whether the property must be numeric or parse as a numeric and should be + * removed when set to a falsey value. + * hasPositiveNumericValue: + * Whether the property must be positive numeric or parse as a positive + * numeric and should be removed when set to a falsey value. + * hasOverloadedBooleanValue: + * Whether the property can be used as a flag as well as with a value. + * Removed when strictly equal to false; present without a value when + * strictly equal to true; present with a value otherwise. + */ + properties: {}, + + /** + * Mapping from lowercase property names to the properly cased version, used + * to warn in the case of missing properties. Available only in __DEV__. + * @type {Object} + */ + getPossibleStandardName: process.env.NODE_ENV !== 'production' ? {} : null, + + /** + * All of the isCustomAttribute() functions that have been injected. + */ + _isCustomAttributeFunctions: [], + + /** + * Checks whether a property name is a custom attribute. + * @method + */ + isCustomAttribute: function (attributeName) { + for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) { + var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i]; + if (isCustomAttributeFn(attributeName)) { + return true; + } + } + return false; + }, + + /** + * Returns the default property value for a DOM property (i.e., not an + * attribute). Most default values are '' or false, but not all. Worse yet, + * some (in particular, `type`) vary depending on the type of element. + * + * TODO: Is it better to grab all the possible properties when creating an + * element to avoid having to create the same element twice? + */ + getDefaultValueForProperty: function (nodeName, prop) { + var nodeDefaults = defaultValueCache[nodeName]; + var testElement; + if (!nodeDefaults) { + defaultValueCache[nodeName] = nodeDefaults = {}; + } + if (!(prop in nodeDefaults)) { + testElement = document.createElement(nodeName); + nodeDefaults[prop] = testElement[prop]; + } + return nodeDefaults[prop]; + }, + + injection: DOMPropertyInjection + }; + + module.exports = DOMProperty; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) + +/***/ }, +/* 25 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule quoteAttributeValueForBrowser + */ + + 'use strict'; + + var escapeTextContentForBrowser = __webpack_require__(22); + + /** + * Escapes attribute value to prevent scripting attacks. + * + * @param {*} value Value to escape. + * @return {string} An escaped string. + */ + function quoteAttributeValueForBrowser(value) { + return '"' + escapeTextContentForBrowser(value) + '"'; + } + + module.exports = quoteAttributeValueForBrowser; + +/***/ }, +/* 26 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule warning + */ + + 'use strict'; + + var emptyFunction = __webpack_require__(16); + + /** + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + + var warning = emptyFunction; + + if (process.env.NODE_ENV !== 'production') { + warning = function (condition, format) { + for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } + + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + + if (format.indexOf('Failed Composite propType: ') === 0) { + return; // Ignore CompositeComponent proptype check. + } + + if (!condition) { + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + } + }; + } + + module.exports = warning; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) + +/***/ }, +/* 27 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactComponentBrowserEnvironment + */ + + 'use strict'; + + var ReactDOMIDOperations = __webpack_require__(28); + var ReactMount = __webpack_require__(29); + + /** + * Abstracts away all functionality of the reconciler that requires knowledge of + * the browser context. TODO: These callers should be refactored to avoid the + * need for this injection. + */ + var ReactComponentBrowserEnvironment = { + + processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates, + + replaceNodeWithMarkupByID: ReactDOMIDOperations.dangerouslyReplaceNodeWithMarkupByID, + + /** + * If a particular environment requires that some resources be cleaned up, + * specify this in the injected Mixin. In the DOM, we would likely want to + * purge any cached node ID lookups. + * + * @private + */ + unmountIDFromEnvironment: function (rootNodeID) { + ReactMount.purgeID(rootNodeID); + } + + }; + + module.exports = ReactComponentBrowserEnvironment; + +/***/ }, +/* 28 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDOMIDOperations + * @typechecks static-only + */ + + 'use strict'; + + var DOMChildrenOperations = __webpack_require__(8); + var DOMPropertyOperations = __webpack_require__(23); + var ReactMount = __webpack_require__(29); + var ReactPerf = __webpack_require__(19); + + var invariant = __webpack_require__(14); + + /** + * Errors for properties that should not be updated with `updatePropertyByID()`. + * + * @type {object} + * @private + */ + var INVALID_PROPERTY_ERRORS = { + dangerouslySetInnerHTML: '`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.', + style: '`style` must be set using `updateStylesByID()`.' + }; + + /** + * Operations used to process updates to DOM nodes. + */ + var ReactDOMIDOperations = { + + /** + * Updates a DOM node with new property values. This should only be used to + * update DOM properties in `DOMProperty`. + * + * @param {string} id ID of the node to update. + * @param {string} name A valid property name, see `DOMProperty`. + * @param {*} value New value of the property. + * @internal + */ + updatePropertyByID: function (id, name, value) { + var node = ReactMount.getNode(id); + !!INVALID_PROPERTY_ERRORS.hasOwnProperty(name) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updatePropertyByID(...): %s', INVALID_PROPERTY_ERRORS[name]) : invariant(false) : undefined; + + // If we're updating to null or undefined, we should remove the property + // from the DOM node instead of inadvertantly setting to a string. This + // brings us in line with the same behavior we have on initial render. + if (value != null) { + DOMPropertyOperations.setValueForProperty(node, name, value); + } else { + DOMPropertyOperations.deleteValueForProperty(node, name); + } + }, + + /** + * Replaces a DOM node that exists in the document with markup. + * + * @param {string} id ID of child to be replaced. + * @param {string} markup Dangerous markup to inject in place of child. + * @internal + * @see {Danger.dangerouslyReplaceNodeWithMarkup} + */ + dangerouslyReplaceNodeWithMarkupByID: function (id, markup) { + var node = ReactMount.getNode(id); + DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup(node, markup); + }, + + /** + * Updates a component's children by processing a series of updates. + * + * @param {array} updates List of update configurations. + * @param {array} markup List of markup strings. + * @internal + */ + dangerouslyProcessChildrenUpdates: function (updates, markup) { + for (var i = 0; i < updates.length; i++) { + updates[i].parentNode = ReactMount.getNode(updates[i].parentID); + } + DOMChildrenOperations.processUpdates(updates, markup); + } + }; + + ReactPerf.measureMethods(ReactDOMIDOperations, 'ReactDOMIDOperations', { + dangerouslyReplaceNodeWithMarkupByID: 'dangerouslyReplaceNodeWithMarkupByID', + dangerouslyProcessChildrenUpdates: 'dangerouslyProcessChildrenUpdates' + }); + + module.exports = ReactDOMIDOperations; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) + +/***/ }, +/* 29 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactMount + */ + + 'use strict'; + + var DOMProperty = __webpack_require__(24); + var ReactBrowserEventEmitter = __webpack_require__(30); + var ReactCurrentOwner = __webpack_require__(6); + var ReactDOMFeatureFlags = __webpack_require__(42); + var ReactElement = __webpack_require__(43); + var ReactEmptyComponentRegistry = __webpack_require__(45); + var ReactInstanceHandles = __webpack_require__(46); + var ReactInstanceMap = __webpack_require__(48); + var ReactMarkupChecksum = __webpack_require__(49); + var ReactPerf = __webpack_require__(19); + var ReactReconciler = __webpack_require__(51); + var ReactUpdateQueue = __webpack_require__(54); + var ReactUpdates = __webpack_require__(55); + + var assign = __webpack_require__(40); + var emptyObject = __webpack_require__(59); + var containsNode = __webpack_require__(60); + var instantiateReactComponent = __webpack_require__(63); + var invariant = __webpack_require__(14); + var setInnerHTML = __webpack_require__(20); + var shouldUpdateReactComponent = __webpack_require__(68); + var validateDOMNesting = __webpack_require__(71); + var warning = __webpack_require__(26); + + var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME; + var nodeCache = {}; + + var ELEMENT_NODE_TYPE = 1; + var DOC_NODE_TYPE = 9; + var DOCUMENT_FRAGMENT_NODE_TYPE = 11; + + var ownerDocumentContextKey = '__ReactMount_ownerDocument$' + Math.random().toString(36).slice(2); + + /** Mapping from reactRootID to React component instance. */ + var instancesByReactRootID = {}; + + /** Mapping from reactRootID to `container` nodes. */ + var containersByReactRootID = {}; + + if (process.env.NODE_ENV !== 'production') { + /** __DEV__-only mapping from reactRootID to root elements. */ + var rootElementsByReactRootID = {}; + } + + // Used to store breadth-first search state in findComponentRoot. + var findComponentRootReusableArray = []; + + /** + * Finds the index of the first character + * that's not common between the two given strings. + * + * @return {number} the index of the character where the strings diverge + */ + function firstDifferenceIndex(string1, string2) { + var minLen = Math.min(string1.length, string2.length); + for (var i = 0; i < minLen; i++) { + if (string1.charAt(i) !== string2.charAt(i)) { + return i; + } + } + return string1.length === string2.length ? -1 : minLen; + } + + /** + * @param {DOMElement|DOMDocument} container DOM element that may contain + * a React component + * @return {?*} DOM element that may have the reactRoot ID, or null. + */ + function getReactRootElementInContainer(container) { + if (!container) { + return null; + } + + if (container.nodeType === DOC_NODE_TYPE) { + return container.documentElement; + } else { + return container.firstChild; + } + } + + /** + * @param {DOMElement} container DOM element that may contain a React component. + * @return {?string} A "reactRoot" ID, if a React component is rendered. + */ + function getReactRootID(container) { + var rootElement = getReactRootElementInContainer(container); + return rootElement && ReactMount.getID(rootElement); + } + + /** + * Accessing node[ATTR_NAME] or calling getAttribute(ATTR_NAME) on a form + * element can return its control whose name or ID equals ATTR_NAME. All + * DOM nodes support `getAttributeNode` but this can also get called on + * other objects so just return '' if we're given something other than a + * DOM node (such as window). + * + * @param {?DOMElement|DOMWindow|DOMDocument|DOMTextNode} node DOM node. + * @return {string} ID of the supplied `domNode`. + */ + function getID(node) { + var id = internalGetID(node); + if (id) { + if (nodeCache.hasOwnProperty(id)) { + var cached = nodeCache[id]; + if (cached !== node) { + !!isValid(cached, id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactMount: Two valid but unequal nodes with the same `%s`: %s', ATTR_NAME, id) : invariant(false) : undefined; + + nodeCache[id] = node; + } + } else { + nodeCache[id] = node; + } + } + + return id; + } + + function internalGetID(node) { + // If node is something like a window, document, or text node, none of + // which support attributes or a .getAttribute method, gracefully return + // the empty string, as if the attribute were missing. + return node && node.getAttribute && node.getAttribute(ATTR_NAME) || ''; + } + + /** + * Sets the React-specific ID of the given node. + * + * @param {DOMElement} node The DOM node whose ID will be set. + * @param {string} id The value of the ID attribute. + */ + function setID(node, id) { + var oldID = internalGetID(node); + if (oldID !== id) { + delete nodeCache[oldID]; + } + node.setAttribute(ATTR_NAME, id); + nodeCache[id] = node; + } + + /** + * Finds the node with the supplied React-generated DOM ID. + * + * @param {string} id A React-generated DOM ID. + * @return {DOMElement} DOM node with the suppled `id`. + * @internal + */ + function getNode(id) { + if (!nodeCache.hasOwnProperty(id) || !isValid(nodeCache[id], id)) { + nodeCache[id] = ReactMount.findReactNodeByID(id); + } + return nodeCache[id]; + } + + /** + * Finds the node with the supplied public React instance. + * + * @param {*} instance A public React instance. + * @return {?DOMElement} DOM node with the suppled `id`. + * @internal + */ + function getNodeFromInstance(instance) { + var id = ReactInstanceMap.get(instance)._rootNodeID; + if (ReactEmptyComponentRegistry.isNullComponentID(id)) { + return null; + } + if (!nodeCache.hasOwnProperty(id) || !isValid(nodeCache[id], id)) { + nodeCache[id] = ReactMount.findReactNodeByID(id); + } + return nodeCache[id]; + } + + /** + * A node is "valid" if it is contained by a currently mounted container. + * + * This means that the node does not have to be contained by a document in + * order to be considered valid. + * + * @param {?DOMElement} node The candidate DOM node. + * @param {string} id The expected ID of the node. + * @return {boolean} Whether the node is contained by a mounted container. + */ + function isValid(node, id) { + if (node) { + !(internalGetID(node) === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactMount: Unexpected modification of `%s`', ATTR_NAME) : invariant(false) : undefined; + + var container = ReactMount.findReactContainerForID(id); + if (container && containsNode(container, node)) { + return true; + } + } + + return false; + } + + /** + * Causes the cache to forget about one React-specific ID. + * + * @param {string} id The ID to forget. + */ + function purgeID(id) { + delete nodeCache[id]; + } + + var deepestNodeSoFar = null; + function findDeepestCachedAncestorImpl(ancestorID) { + var ancestor = nodeCache[ancestorID]; + if (ancestor && isValid(ancestor, ancestorID)) { + deepestNodeSoFar = ancestor; + } else { + // This node isn't populated in the cache, so presumably none of its + // descendants are. Break out of the loop. + return false; + } + } + + /** + * Return the deepest cached node whose ID is a prefix of `targetID`. + */ + function findDeepestCachedAncestor(targetID) { + deepestNodeSoFar = null; + ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl); + + var foundNode = deepestNodeSoFar; + deepestNodeSoFar = null; + return foundNode; + } + + /** + * Mounts this component and inserts it into the DOM. + * + * @param {ReactComponent} componentInstance The instance to mount. + * @param {string} rootID DOM ID of the root node. + * @param {DOMElement} container DOM element to mount into. + * @param {ReactReconcileTransaction} transaction + * @param {boolean} shouldReuseMarkup If true, do not insert markup + */ + function mountComponentIntoNode(componentInstance, rootID, container, transaction, shouldReuseMarkup, context) { + if (ReactDOMFeatureFlags.useCreateElement) { + context = assign({}, context); + if (container.nodeType === DOC_NODE_TYPE) { + context[ownerDocumentContextKey] = container; + } else { + context[ownerDocumentContextKey] = container.ownerDocument; + } + } + if (process.env.NODE_ENV !== 'production') { + if (context === emptyObject) { + context = {}; + } + var tag = container.nodeName.toLowerCase(); + context[validateDOMNesting.ancestorInfoContextKey] = validateDOMNesting.updatedAncestorInfo(null, tag, null); + } + var markup = ReactReconciler.mountComponent(componentInstance, rootID, transaction, context); + componentInstance._renderedComponent._topLevelWrapper = componentInstance; + ReactMount._mountImageIntoNode(markup, container, shouldReuseMarkup, transaction); + } + + /** + * Batched mount. + * + * @param {ReactComponent} componentInstance The instance to mount. + * @param {string} rootID DOM ID of the root node. + * @param {DOMElement} container DOM element to mount into. + * @param {boolean} shouldReuseMarkup If true, do not insert markup + */ + function batchedMountComponentIntoNode(componentInstance, rootID, container, shouldReuseMarkup, context) { + var transaction = ReactUpdates.ReactReconcileTransaction.getPooled( + /* forceHTML */shouldReuseMarkup); + transaction.perform(mountComponentIntoNode, null, componentInstance, rootID, container, transaction, shouldReuseMarkup, context); + ReactUpdates.ReactReconcileTransaction.release(transaction); + } + + /** + * Unmounts a component and removes it from the DOM. + * + * @param {ReactComponent} instance React component instance. + * @param {DOMElement} container DOM element to unmount from. + * @final + * @internal + * @see {ReactMount.unmountComponentAtNode} + */ + function unmountComponentFromNode(instance, container) { + ReactReconciler.unmountComponent(instance); + + if (container.nodeType === DOC_NODE_TYPE) { + container = container.documentElement; + } + + // http://jsperf.com/emptying-a-node + while (container.lastChild) { + container.removeChild(container.lastChild); + } + } + + /** + * True if the supplied DOM node has a direct React-rendered child that is + * not a React root element. Useful for warning in `render`, + * `unmountComponentAtNode`, etc. + * + * @param {?DOMElement} node The candidate DOM node. + * @return {boolean} True if the DOM element contains a direct child that was + * rendered by React but is not a root element. + * @internal + */ + function hasNonRootReactChild(node) { + var reactRootID = getReactRootID(node); + return reactRootID ? reactRootID !== ReactInstanceHandles.getReactRootIDFromNodeID(reactRootID) : false; + } + + /** + * Returns the first (deepest) ancestor of a node which is rendered by this copy + * of React. + */ + function findFirstReactDOMImpl(node) { + // This node might be from another React instance, so we make sure not to + // examine the node cache here + for (; node && node.parentNode !== node; node = node.parentNode) { + if (node.nodeType !== 1) { + // Not a DOMElement, therefore not a React component + continue; + } + var nodeID = internalGetID(node); + if (!nodeID) { + continue; + } + var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID); + + // If containersByReactRootID contains the container we find by crawling up + // the tree, we know that this instance of React rendered the node. + // nb. isValid's strategy (with containsNode) does not work because render + // trees may be nested and we don't want a false positive in that case. + var current = node; + var lastID; + do { + lastID = internalGetID(current); + current = current.parentNode; + if (current == null) { + // The passed-in node has been detached from the container it was + // originally rendered into. + return null; + } + } while (lastID !== reactRootID); + + if (current === containersByReactRootID[reactRootID]) { + return node; + } + } + return null; + } + + /** + * Temporary (?) hack so that we can store all top-level pending updates on + * composites instead of having to worry about different types of components + * here. + */ + var TopLevelWrapper = function () {}; + TopLevelWrapper.prototype.isReactComponent = {}; + if (process.env.NODE_ENV !== 'production') { + TopLevelWrapper.displayName = 'TopLevelWrapper'; + } + TopLevelWrapper.prototype.render = function () { + // this.props is actually a ReactElement + return this.props; + }; + + /** + * Mounting is the process of initializing a React component by creating its + * representative DOM elements and inserting them into a supplied `container`. + * Any prior content inside `container` is destroyed in the process. + * + * ReactMount.render( + * component, + * document.getElementById('container') + * ); + * + *
<-- Supplied `container`. + *
<-- Rendered reactRoot of React + * // ... component. + *
+ *
+ * + * Inside of `container`, the first element rendered is the "reactRoot". + */ + var ReactMount = { + + TopLevelWrapper: TopLevelWrapper, + + /** Exposed for debugging purposes **/ + _instancesByReactRootID: instancesByReactRootID, + + /** + * This is a hook provided to support rendering React components while + * ensuring that the apparent scroll position of its `container` does not + * change. + * + * @param {DOMElement} container The `container` being rendered into. + * @param {function} renderCallback This must be called once to do the render. + */ + scrollMonitor: function (container, renderCallback) { + renderCallback(); + }, + + /** + * Take a component that's already mounted into the DOM and replace its props + * @param {ReactComponent} prevComponent component instance already in the DOM + * @param {ReactElement} nextElement component instance to render + * @param {DOMElement} container container to render into + * @param {?function} callback function triggered on completion + */ + _updateRootComponent: function (prevComponent, nextElement, container, callback) { + ReactMount.scrollMonitor(container, function () { + ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement); + if (callback) { + ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback); + } + }); + + if (process.env.NODE_ENV !== 'production') { + // Record the root element in case it later gets transplanted. + rootElementsByReactRootID[getReactRootID(container)] = getReactRootElementInContainer(container); + } + + return prevComponent; + }, + + /** + * Register a component into the instance map and starts scroll value + * monitoring + * @param {ReactComponent} nextComponent component instance to render + * @param {DOMElement} container container to render into + * @return {string} reactRoot ID prefix + */ + _registerComponent: function (nextComponent, container) { + !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : invariant(false) : undefined; + + ReactBrowserEventEmitter.ensureScrollValueMonitoring(); + + var reactRootID = ReactMount.registerContainer(container); + instancesByReactRootID[reactRootID] = nextComponent; + return reactRootID; + }, + + /** + * Render a new component into the DOM. + * @param {ReactElement} nextElement element to render + * @param {DOMElement} container container to render into + * @param {boolean} shouldReuseMarkup if we should skip the markup insertion + * @return {ReactComponent} nextComponent + */ + _renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) { + // Various parts of our code (such as ReactCompositeComponent's + // _renderValidatedComponent) assume that calls to render aren't nested; + // verify that that's the case. + process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '_renderNewRootComponent(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from ' + 'render is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : undefined; + + var componentInstance = instantiateReactComponent(nextElement, null); + var reactRootID = ReactMount._registerComponent(componentInstance, container); + + // The initial render is synchronous but any updates that happen during + // rendering, in componentWillMount or componentDidMount, will be batched + // according to the current batching strategy. + + ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, reactRootID, container, shouldReuseMarkup, context); + + if (process.env.NODE_ENV !== 'production') { + // Record the root element in case it later gets transplanted. + rootElementsByReactRootID[reactRootID] = getReactRootElementInContainer(container); + } + + return componentInstance; + }, + + /** + * Renders a React component into the DOM in the supplied `container`. + * + * If the React component was previously rendered into `container`, this will + * perform an update on it and only mutate the DOM as necessary to reflect the + * latest React component. + * + * @param {ReactComponent} parentComponent The conceptual parent of this render tree. + * @param {ReactElement} nextElement Component element to render. + * @param {DOMElement} container DOM element to render into. + * @param {?function} callback function triggered on completion + * @return {ReactComponent} Component instance rendered in `container`. + */ + renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) { + !(parentComponent != null && parentComponent._reactInternalInstance != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : invariant(false) : undefined; + return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback); + }, + + _renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) { + !ReactElement.isValidElement(nextElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? ' Instead of passing an element string, make sure to instantiate ' + 'it by passing it to React.createElement.' : typeof nextElement === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' : + // Check if it quacks like an element + nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : invariant(false) : undefined; + + process.env.NODE_ENV !== 'production' ? warning(!container || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : undefined; + + var nextWrappedElement = new ReactElement(TopLevelWrapper, null, null, null, null, null, nextElement); + + var prevComponent = instancesByReactRootID[getReactRootID(container)]; + + if (prevComponent) { + var prevWrappedElement = prevComponent._currentElement; + var prevElement = prevWrappedElement.props; + if (shouldUpdateReactComponent(prevElement, nextElement)) { + var publicInst = prevComponent._renderedComponent.getPublicInstance(); + var updatedCallback = callback && function () { + callback.call(publicInst); + }; + ReactMount._updateRootComponent(prevComponent, nextWrappedElement, container, updatedCallback); + return publicInst; + } else { + ReactMount.unmountComponentAtNode(container); + } + } + + var reactRootElement = getReactRootElementInContainer(container); + var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement); + var containerHasNonRootReactChild = hasNonRootReactChild(container); + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : undefined; + + if (!containerHasReactMarkup || reactRootElement.nextSibling) { + var rootElementSibling = reactRootElement; + while (rootElementSibling) { + if (internalGetID(rootElementSibling)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.') : undefined; + break; + } + rootElementSibling = rootElementSibling.nextSibling; + } + } + } + + var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild; + var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, parentComponent != null ? parentComponent._reactInternalInstance._processChildContext(parentComponent._reactInternalInstance._context) : emptyObject)._renderedComponent.getPublicInstance(); + if (callback) { + callback.call(component); + } + return component; + }, + + /** + * Renders a React component into the DOM in the supplied `container`. + * + * If the React component was previously rendered into `container`, this will + * perform an update on it and only mutate the DOM as necessary to reflect the + * latest React component. + * + * @param {ReactElement} nextElement Component element to render. + * @param {DOMElement} container DOM element to render into. + * @param {?function} callback function triggered on completion + * @return {ReactComponent} Component instance rendered in `container`. + */ + render: function (nextElement, container, callback) { + return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback); + }, + + /** + * Registers a container node into which React components will be rendered. + * This also creates the "reactRoot" ID that will be assigned to the element + * rendered within. + * + * @param {DOMElement} container DOM element to register as a container. + * @return {string} The "reactRoot" ID of elements rendered within. + */ + registerContainer: function (container) { + var reactRootID = getReactRootID(container); + if (reactRootID) { + // If one exists, make sure it is a valid "reactRoot" ID. + reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(reactRootID); + } + if (!reactRootID) { + // No valid "reactRoot" ID found, create one. + reactRootID = ReactInstanceHandles.createReactRootID(); + } + containersByReactRootID[reactRootID] = container; + return reactRootID; + }, + + /** + * Unmounts and destroys the React component rendered in the `container`. + * + * @param {DOMElement} container DOM element containing a React component. + * @return {boolean} True if a component was found in and unmounted from + * `container` + */ + unmountComponentAtNode: function (container) { + // Various parts of our code (such as ReactCompositeComponent's + // _renderValidatedComponent) assume that calls to render aren't nested; + // verify that that's the case. (Strictly speaking, unmounting won't cause a + // render but we still don't expect to be in a render call here.) + process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, 'unmountComponentAtNode(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from render ' + 'is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : undefined; + + !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : invariant(false) : undefined; + + var reactRootID = getReactRootID(container); + var component = instancesByReactRootID[reactRootID]; + if (!component) { + // Check if the node being unmounted was rendered by React, but isn't a + // root node. + var containerHasNonRootReactChild = hasNonRootReactChild(container); + + // Check if the container itself is a React root node. + var containerID = internalGetID(container); + var isContainerReactRoot = containerID && containerID === ReactInstanceHandles.getReactRootIDFromNodeID(containerID); + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : undefined; + } + + return false; + } + ReactUpdates.batchedUpdates(unmountComponentFromNode, component, container); + delete instancesByReactRootID[reactRootID]; + delete containersByReactRootID[reactRootID]; + if (process.env.NODE_ENV !== 'production') { + delete rootElementsByReactRootID[reactRootID]; + } + return true; + }, + + /** + * Finds the container DOM element that contains React component to which the + * supplied DOM `id` belongs. + * + * @param {string} id The ID of an element rendered by a React component. + * @return {?DOMElement} DOM element that contains the `id`. + */ + findReactContainerForID: function (id) { + var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(id); + var container = containersByReactRootID[reactRootID]; + + if (process.env.NODE_ENV !== 'production') { + var rootElement = rootElementsByReactRootID[reactRootID]; + if (rootElement && rootElement.parentNode !== container) { + process.env.NODE_ENV !== 'production' ? warning( + // Call internalGetID here because getID calls isValid which calls + // findReactContainerForID (this function). + internalGetID(rootElement) === reactRootID, 'ReactMount: Root element ID differed from reactRootID.') : undefined; + var containerChild = container.firstChild; + if (containerChild && reactRootID === internalGetID(containerChild)) { + // If the container has a new child with the same ID as the old + // root element, then rootElementsByReactRootID[reactRootID] is + // just stale and needs to be updated. The case that deserves a + // warning is when the container is empty. + rootElementsByReactRootID[reactRootID] = containerChild; + } else { + process.env.NODE_ENV !== 'production' ? warning(false, 'ReactMount: Root element has been removed from its original ' + 'container. New container: %s', rootElement.parentNode) : undefined; + } + } + } + + return container; + }, + + /** + * Finds an element rendered by React with the supplied ID. + * + * @param {string} id ID of a DOM node in the React component. + * @return {DOMElement} Root DOM node of the React component. + */ + findReactNodeByID: function (id) { + var reactRoot = ReactMount.findReactContainerForID(id); + return ReactMount.findComponentRoot(reactRoot, id); + }, + + /** + * Traverses up the ancestors of the supplied node to find a node that is a + * DOM representation of a React component rendered by this copy of React. + * + * @param {*} node + * @return {?DOMEventTarget} + * @internal + */ + getFirstReactDOM: function (node) { + return findFirstReactDOMImpl(node); + }, + + /** + * Finds a node with the supplied `targetID` inside of the supplied + * `ancestorNode`. Exploits the ID naming scheme to perform the search + * quickly. + * + * @param {DOMEventTarget} ancestorNode Search from this root. + * @pararm {string} targetID ID of the DOM representation of the component. + * @return {DOMEventTarget} DOM node with the supplied `targetID`. + * @internal + */ + findComponentRoot: function (ancestorNode, targetID) { + var firstChildren = findComponentRootReusableArray; + var childIndex = 0; + + var deepestAncestor = findDeepestCachedAncestor(targetID) || ancestorNode; + + if (process.env.NODE_ENV !== 'production') { + // This will throw on the next line; give an early warning + process.env.NODE_ENV !== 'production' ? warning(deepestAncestor != null, 'React can\'t find the root component node for data-reactid value ' + '`%s`. If you\'re seeing this message, it probably means that ' + 'you\'ve loaded two copies of React on the page. At this time, only ' + 'a single copy of React can be loaded at a time.', targetID) : undefined; + } + + firstChildren[0] = deepestAncestor.firstChild; + firstChildren.length = 1; + + while (childIndex < firstChildren.length) { + var child = firstChildren[childIndex++]; + var targetChild; + + while (child) { + var childID = ReactMount.getID(child); + if (childID) { + // Even if we find the node we're looking for, we finish looping + // through its siblings to ensure they're cached so that we don't have + // to revisit this node again. Otherwise, we make n^2 calls to getID + // when visiting the many children of a single node in order. + + if (targetID === childID) { + targetChild = child; + } else if (ReactInstanceHandles.isAncestorIDOf(childID, targetID)) { + // If we find a child whose ID is an ancestor of the given ID, + // then we can be sure that we only want to search the subtree + // rooted at this child, so we can throw out the rest of the + // search state. + firstChildren.length = childIndex = 0; + firstChildren.push(child.firstChild); + } + } else { + // If this child had no ID, then there's a chance that it was + // injected automatically by the browser, as when a `` + // element sprouts an extra `` child as a side effect of + // `.innerHTML` parsing. Optimistically continue down this + // branch, but not before examining the other siblings. + firstChildren.push(child.firstChild); + } + + child = child.nextSibling; + } + + if (targetChild) { + // Emptying firstChildren/findComponentRootReusableArray is + // not necessary for correctness, but it helps the GC reclaim + // any nodes that were left at the end of the search. + firstChildren.length = 0; + + return targetChild; + } + } + + firstChildren.length = 0; + + true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findComponentRoot(..., %s): Unable to find element. This probably ' + 'means the DOM was unexpectedly mutated (e.g., by the browser), ' + 'usually due to forgetting a when using tables, nesting tags ' + 'like ,

, or , or using non-SVG elements in an ' + 'parent. ' + 'Try inspecting the child nodes of the element with React ID `%s`.', targetID, ReactMount.getID(ancestorNode)) : invariant(false) : undefined; + }, + + _mountImageIntoNode: function (markup, container, shouldReuseMarkup, transaction) { + !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : invariant(false) : undefined; + + if (shouldReuseMarkup) { + var rootElement = getReactRootElementInContainer(container); + if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) { + return; + } else { + var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME); + rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME); + + var rootMarkup = rootElement.outerHTML; + rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum); + + var normalizedMarkup = markup; + if (process.env.NODE_ENV !== 'production') { + // because rootMarkup is retrieved from the DOM, various normalizations + // will have occurred which will not be present in `markup`. Here, + // insert markup into a

or