Socket
Socket
Sign inDemoInstall

react-autosuggest

Package Overview
Dependencies
8
Maintainers
1
Versions
128
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 8.0.1 to 9.0.0

dist/theme.js

202

dist/Autosuggest.js

@@ -23,2 +23,4 @@ 'use strict';

var _theme = require('./theme');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -38,48 +40,17 @@

};
var defaultTheme = {
container: 'react-autosuggest__container',
containerOpen: 'react-autosuggest__container--open',
input: 'react-autosuggest__input',
suggestionsContainer: 'react-autosuggest__suggestions-container',
suggestionsList: 'react-autosuggest__suggestions-list',
suggestion: 'react-autosuggest__suggestion',
suggestionFocused: 'react-autosuggest__suggestion--focused',
sectionContainer: 'react-autosuggest__section-container',
sectionTitle: 'react-autosuggest__section-title'
var defaultRenderSuggestionsContainer = function defaultRenderSuggestionsContainer(_ref) {
var containerProps = _ref.containerProps,
children = _ref.children;
return _react2.default.createElement(
'div',
containerProps,
children
);
};
var mapToAutowhateverTheme = function mapToAutowhateverTheme(theme) {
var result = {};
for (var key in theme) {
switch (key) {
case 'suggestionsContainer':
result['itemsContainer'] = theme[key];
break;
case 'suggestion':
result['item'] = theme[key];
break;
case 'suggestionFocused':
result['itemFocused'] = theme[key];
break;
case 'suggestionsList':
result['itemsList'] = theme[key];
break;
default:
result[key] = theme[key];
}
}
return result;
};
var Autosuggest = function (_Component) {
_inherits(Autosuggest, _Component);
function Autosuggest(_ref) {
var alwaysRenderSuggestions = _ref.alwaysRenderSuggestions;
function Autosuggest(_ref2) {
var alwaysRenderSuggestions = _ref2.alwaysRenderSuggestions;

@@ -95,4 +66,4 @@ _classCallCheck(this, Autosuggest);

isCollapsed: !alwaysRenderSuggestions,
focusedSectionIndex: null,
focusedSuggestionIndex: null,
highlightedSectionIndex: null,
highlightedSuggestionIndex: null,
valueBeforeUpDown: null

@@ -114,9 +85,9 @@ };

if ((0, _arrays2.default)(nextProps.suggestions, this.props.suggestions)) {
if (nextProps.focusFirstSuggestion && nextProps.suggestions.length > 0 && this.justPressedUpDown === false) {
this.focusFirstSuggestion();
if (nextProps.highlightFirstSuggestion && nextProps.suggestions.length > 0 && this.justPressedUpDown === false) {
this.highlightFirstSuggestion();
}
} else {
if (this.willRenderSuggestions(nextProps)) {
if (nextProps.focusFirstSuggestion) {
this.focusFirstSuggestion();
if (nextProps.highlightFirstSuggestion) {
this.highlightFirstSuggestion();
}

@@ -128,3 +99,3 @@

} else {
this.resetFocusedSuggestion();
this.resetHighlightedSuggestion();
}

@@ -151,4 +122,4 @@ }

isFocused: false,
focusedSectionIndex: null,
focusedSuggestionIndex: null,
highlightedSectionIndex: null,
highlightedSuggestionIndex: null,
valueBeforeUpDown: null,

@@ -162,4 +133,4 @@ isCollapsed: !shouldRender

this.setState({
focusedSectionIndex: null,
focusedSuggestionIndex: null,
highlightedSectionIndex: null,
highlightedSuggestionIndex: null,
valueBeforeUpDown: null,

@@ -170,4 +141,4 @@ isCollapsed: !shouldRender

}, {
key: 'updateFocusedSuggestion',
value: function updateFocusedSuggestion(sectionIndex, suggestionIndex, prevValue) {
key: 'updateHighlightedSuggestion',
value: function updateHighlightedSuggestion(sectionIndex, suggestionIndex, prevValue) {
var valueBeforeUpDown = this.state.valueBeforeUpDown;

@@ -183,4 +154,4 @@

this.setState({
focusedSectionIndex: sectionIndex,
focusedSuggestionIndex: suggestionIndex,
highlightedSectionIndex: sectionIndex,
highlightedSuggestionIndex: suggestionIndex,
valueBeforeUpDown: valueBeforeUpDown

@@ -190,4 +161,4 @@ });

}, {
key: 'resetFocusedSuggestion',
value: function resetFocusedSuggestion() {
key: 'resetHighlightedSuggestion',
value: function resetHighlightedSuggestion() {
var shouldResetValueBeforeUpDown = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;

@@ -198,4 +169,4 @@ var valueBeforeUpDown = this.state.valueBeforeUpDown;

this.setState({
focusedSectionIndex: null,
focusedSuggestionIndex: null,
highlightedSectionIndex: null,
highlightedSuggestionIndex: null,
valueBeforeUpDown: shouldResetValueBeforeUpDown ? null : valueBeforeUpDown

@@ -215,4 +186,4 @@ });

this.setState({
focusedSectionIndex: null,
focusedSuggestionIndex: null,
highlightedSectionIndex: null,
highlightedSuggestionIndex: null,
valueBeforeUpDown: null,

@@ -238,14 +209,14 @@ isCollapsed: true

}, {
key: 'getFocusedSuggestion',
value: function getFocusedSuggestion() {
key: 'getHighlightedSuggestion',
value: function getHighlightedSuggestion() {
var _state = this.state,
focusedSectionIndex = _state.focusedSectionIndex,
focusedSuggestionIndex = _state.focusedSuggestionIndex;
highlightedSectionIndex = _state.highlightedSectionIndex,
highlightedSuggestionIndex = _state.highlightedSuggestionIndex;
if (focusedSuggestionIndex === null) {
if (highlightedSuggestionIndex === null) {
return null;
}
return this.getSuggestion(focusedSectionIndex, focusedSuggestionIndex);
return this.getSuggestion(highlightedSectionIndex, highlightedSuggestionIndex);
}

@@ -311,2 +282,12 @@ }, {

}, {
key: 'getQuery',
value: function getQuery() {
var inputProps = this.props.inputProps;
var value = inputProps.value;
var valueBeforeUpDown = this.state.valueBeforeUpDown;
return (valueBeforeUpDown || value).trim();
}
}, {
key: 'render',

@@ -319,3 +300,2 @@ value: function render() {

renderInputComponent = _props2.renderInputComponent,
renderSuggestionsContainer = _props2.renderSuggestionsContainer,
onSuggestionsFetchRequested = _props2.onSuggestionsFetchRequested,

@@ -334,4 +314,4 @@ renderSuggestion = _props2.renderSuggestion,

isCollapsed = _state2.isCollapsed,
focusedSectionIndex = _state2.focusedSectionIndex,
focusedSuggestionIndex = _state2.focusedSuggestionIndex,
highlightedSectionIndex = _state2.highlightedSectionIndex,
highlightedSuggestionIndex = _state2.highlightedSuggestionIndex,
valueBeforeUpDown = _state2.valueBeforeUpDown;

@@ -397,4 +377,4 @@

} else if (suggestions.length > 0) {
var newFocusedSectionIndex = data.newFocusedSectionIndex,
newFocusedItemIndex = data.newFocusedItemIndex;
var newHighlightedSectionIndex = data.newHighlightedSectionIndex,
newHighlightedItemIndex = data.newHighlightedItemIndex;

@@ -404,3 +384,3 @@

if (newFocusedItemIndex === null) {
if (newHighlightedItemIndex === null) {
// valueBeforeUpDown can be null if, for example, user

@@ -411,6 +391,6 @@ // hovers on the first suggestion and then pressed Up.

} else {
newValue = _this2.getSuggestionValueByIndex(newFocusedSectionIndex, newFocusedItemIndex);
newValue = _this2.getSuggestionValueByIndex(newHighlightedSectionIndex, newHighlightedItemIndex);
}
_this2.updateFocusedSuggestion(newFocusedSectionIndex, newFocusedItemIndex, value);
_this2.updateHighlightedSuggestion(newHighlightedSectionIndex, newHighlightedItemIndex, value);
_this2.maybeCallOnChange(event, newValue, event.key === 'ArrowDown' ? 'down' : 'up');

@@ -431,3 +411,3 @@ }

{
var focusedSuggestion = _this2.getFocusedSuggestion();
var highlightedSuggestion = _this2.getHighlightedSuggestion();

@@ -438,4 +418,4 @@ if (isOpen && !alwaysRenderSuggestions) {

if (focusedSuggestion !== null) {
var _newValue = getSuggestionValue(focusedSuggestion);
if (highlightedSuggestion !== null) {
var _newValue = getSuggestionValue(highlightedSuggestion);

@@ -445,6 +425,6 @@ _this2.maybeCallOnChange(event, _newValue, 'enter');

_this2.onSuggestionSelected(event, {
suggestion: focusedSuggestion,
suggestion: highlightedSuggestion,
suggestionValue: _newValue,
suggestionIndex: focusedSuggestionIndex,
sectionIndex: focusedSectionIndex,
suggestionIndex: highlightedSuggestionIndex,
sectionIndex: highlightedSectionIndex,
method: 'enter'

@@ -497,3 +477,3 @@ });

} else {
_this2.resetFocusedSuggestion();
_this2.resetHighlightedSuggestion();
}

@@ -509,3 +489,3 @@

var renderSuggestionData = {
query: (valueBeforeUpDown || value).trim()
query: this.getQuery()
};

@@ -517,3 +497,3 @@

renderInputComponent: renderInputComponent,
renderItemsContainer: renderSuggestionsContainer,
renderItemsContainer: this.renderSuggestionsContainer,
renderItem: renderSuggestion,

@@ -523,7 +503,7 @@ renderItemData: renderSuggestionData,

getSectionItems: getSectionSuggestions,
focusedSectionIndex: focusedSectionIndex,
focusedItemIndex: focusedSuggestionIndex,
highlightedSectionIndex: highlightedSectionIndex,
highlightedItemIndex: highlightedSuggestionIndex,
inputProps: autowhateverInputProps,
itemProps: this.itemProps,
theme: mapToAutowhateverTheme(theme),
theme: (0, _theme.mapToAutowhateverTheme)(theme),
id: id,

@@ -588,3 +568,3 @@ ref: this.storeReferences

focusInputOnSuggestionClick: _react.PropTypes.bool,
focusFirstSuggestion: _react.PropTypes.bool,
highlightFirstSuggestion: _react.PropTypes.bool,
theme: _react.PropTypes.object,

@@ -594,2 +574,3 @@ id: _react.PropTypes.string

Autosuggest.defaultProps = {
renderSuggestionsContainer: defaultRenderSuggestionsContainer,
shouldRenderSuggestions: defaultShouldRenderSuggestions,

@@ -599,4 +580,4 @@ alwaysRenderSuggestions: false,

focusInputOnSuggestionClick: true,
focusFirstSuggestion: false,
theme: defaultTheme,
highlightFirstSuggestion: false,
theme: _theme.defaultTheme,
id: '1'

@@ -641,11 +622,11 @@ };

this.onSuggestionMouseEnter = function (event, _ref2) {
var sectionIndex = _ref2.sectionIndex,
itemIndex = _ref2.itemIndex;
this.onSuggestionMouseEnter = function (event, _ref3) {
var sectionIndex = _ref3.sectionIndex,
itemIndex = _ref3.itemIndex;
_this3.updateFocusedSuggestion(sectionIndex, itemIndex);
_this3.updateHighlightedSuggestion(sectionIndex, itemIndex);
};
this.focusFirstSuggestion = function () {
_this3.updateFocusedSuggestion(_this3.props.multiSection ? 0 : null, 0);
this.highlightFirstSuggestion = function () {
_this3.updateHighlightedSuggestion(_this3.props.multiSection ? 0 : null, 0);
};

@@ -679,3 +660,3 @@

_this3.resetFocusedSuggestion();
_this3.resetHighlightedSuggestion();
};

@@ -726,15 +707,15 @@

var focusedSuggestion = _this3.getFocusedSuggestion();
var highlightedSuggestion = _this3.getHighlightedSuggestion();
_this3.inputBlurred(shouldRenderSuggestions(value));
onBlur && onBlur(_this3.blurEvent, { focusedSuggestion: focusedSuggestion });
onBlur && onBlur(_this3.blurEvent, { highlightedSuggestion: highlightedSuggestion });
};
this.resetFocusedSuggestionOnMouseLeave = function () {
_this3.resetFocusedSuggestion(false); // shouldResetValueBeforeUpDown
this.resetHighlightedSuggestionOnMouseLeave = function () {
_this3.resetHighlightedSuggestion(false); // shouldResetValueBeforeUpDown
};
this.itemProps = function (_ref3) {
var sectionIndex = _ref3.sectionIndex,
itemIndex = _ref3.itemIndex;
this.itemProps = function (_ref4) {
var sectionIndex = _ref4.sectionIndex,
itemIndex = _ref4.itemIndex;

@@ -745,3 +726,3 @@ return {

onMouseEnter: _this3.onSuggestionMouseEnter,
onMouseLeave: _this3.resetFocusedSuggestionOnMouseLeave,
onMouseLeave: _this3.resetHighlightedSuggestionOnMouseLeave,
onMouseDown: _this3.onSuggestionMouseDown,

@@ -752,4 +733,13 @@ onTouchStart: _this3.onSuggestionMouseDown, // Because on iOS `onMouseDown` is not triggered

};
this.renderSuggestionsContainer = function (_ref5) {
var containerProps = _ref5.containerProps,
children = _ref5.children;
var renderSuggestionsContainer = _this3.props.renderSuggestionsContainer;
return renderSuggestionsContainer({ containerProps: containerProps, children: children, query: _this3.getQuery() });
};
};
exports.default = Autosuggest;

@@ -1,1 +0,1 @@

!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.Autosuggest=t(require("React")):e.Autosuggest=t(e.React)}(this,function(e){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";e.exports=n(1).default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),c=n(2),l=o(c),f=n(3),p=o(f),d=n(4),g=o(d),m=function(){return!0},h=function(e){return e.trim().length>0},y={container:"react-autosuggest__container",containerOpen:"react-autosuggest__container--open",input:"react-autosuggest__input",suggestionsContainer:"react-autosuggest__suggestions-container",suggestionsList:"react-autosuggest__suggestions-list",suggestion:"react-autosuggest__suggestion",suggestionFocused:"react-autosuggest__suggestion--focused",sectionContainer:"react-autosuggest__section-container",sectionTitle:"react-autosuggest__section-title"},v=function(e){var t={};for(var n in e)switch(n){case"suggestionsContainer":t.itemsContainer=e[n];break;case"suggestion":t.item=e[n];break;case"suggestionFocused":t.itemFocused=e[n];break;case"suggestionsList":t.itemsList=e[n];break;default:t[n]=e[n]}return t},I=function(e){function t(e){var n=e.alwaysRenderSuggestions;r(this,t);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return S.call(o),o.state={isFocused:!1,isCollapsed:!n,focusedSectionIndex:null,focusedSuggestionIndex:null,valueBeforeUpDown:null},o.justPressedUpDown=!1,o}return u(t,e),a(t,[{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.onDocumentMouseDown)}},{key:"componentWillReceiveProps",value:function(e){(0,p.default)(e.suggestions,this.props.suggestions)?e.focusFirstSuggestion&&e.suggestions.length>0&&this.justPressedUpDown===!1&&this.focusFirstSuggestion():this.willRenderSuggestions(e)?(e.focusFirstSuggestion&&this.focusFirstSuggestion(),this.state.isCollapsed&&!this.justSelectedSuggestion&&this.revealSuggestions()):this.resetFocusedSuggestion()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.onDocumentMouseDown)}},{key:"inputFocused",value:function(e){this.setState({isFocused:!0,isCollapsed:!e})}},{key:"inputBlurred",value:function(e){this.setState({isFocused:!1,focusedSectionIndex:null,focusedSuggestionIndex:null,valueBeforeUpDown:null,isCollapsed:!e})}},{key:"inputChanged",value:function(e){this.setState({focusedSectionIndex:null,focusedSuggestionIndex:null,valueBeforeUpDown:null,isCollapsed:!e})}},{key:"updateFocusedSuggestion",value:function(e,t,n){var o=this.state.valueBeforeUpDown;null===t?o=null:null===o&&"undefined"!=typeof n&&(o=n),this.setState({focusedSectionIndex:e,focusedSuggestionIndex:t,valueBeforeUpDown:o})}},{key:"resetFocusedSuggestion",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.state.valueBeforeUpDown;this.setState({focusedSectionIndex:null,focusedSuggestionIndex:null,valueBeforeUpDown:e?null:t})}},{key:"revealSuggestions",value:function(){this.setState({isCollapsed:!1})}},{key:"closeSuggestions",value:function(){this.setState({focusedSectionIndex:null,focusedSuggestionIndex:null,valueBeforeUpDown:null,isCollapsed:!0})}},{key:"getSuggestion",value:function(e,t){var n=this.props,o=n.suggestions,r=n.multiSection,i=n.getSectionSuggestions;return r?i(o[e])[t]:o[t]}},{key:"getFocusedSuggestion",value:function(){var e=this.state,t=e.focusedSectionIndex,n=e.focusedSuggestionIndex;return null===n?null:this.getSuggestion(t,n)}},{key:"getSuggestionValueByIndex",value:function(e,t){var n=this.props.getSuggestionValue;return n(this.getSuggestion(e,t))}},{key:"getSuggestionIndices",value:function(e){var t=e.getAttribute("data-section-index"),n=e.getAttribute("data-suggestion-index");return{sectionIndex:"string"==typeof t?parseInt(t,10):null,suggestionIndex:parseInt(n,10)}}},{key:"findSuggestionElement",value:function(e){var t=e;do{if(null!==t.getAttribute("data-suggestion-index"))return t;t=t.parentNode}while(null!==t);throw console.error("Clicked element:",e),new Error("Couldn't find suggestion element")}},{key:"maybeCallOnChange",value:function(e,t,n){var o=this.props.inputProps,r=o.value,i=o.onChange;t!==r&&i(e,{newValue:t,method:n})}},{key:"willRenderSuggestions",value:function(e){var t=e.suggestions,n=e.inputProps,o=e.shouldRenderSuggestions,r=n.value;return t.length>0&&o(r)}},{key:"render",value:function(){var e=this,t=this.props,n=t.suggestions,o=t.renderInputComponent,r=t.renderSuggestionsContainer,i=t.onSuggestionsFetchRequested,u=t.renderSuggestion,a=t.inputProps,c=t.multiSection,f=t.renderSectionTitle,p=t.id,d=t.getSectionSuggestions,h=t.theme,y=t.getSuggestionValue,I=t.alwaysRenderSuggestions,S=this.state,b=S.isFocused,w=S.isCollapsed,x=S.focusedSectionIndex,P=S.focusedSuggestionIndex,C=S.valueBeforeUpDown,_=I?m:this.props.shouldRenderSuggestions,O=a.value,k=a.onFocus,T=a.onKeyDown,j=this.willRenderSuggestions(this.props),R=I||b&&!w&&j,D=R?n:[],E=s({},a,{onFocus:function(t){if(!e.justSelectedSuggestion&&!e.justClickedOnSuggestionsContainer){var n=_(O);e.inputFocused(n),k&&k(t),n&&i({value:O})}},onBlur:function(t){return e.justClickedOnSuggestionsContainer?void e.input.focus():(e.blurEvent=t,void(e.justSelectedSuggestion||(e.onBlur(),e.onSuggestionsClearRequested())))},onChange:function(t){var n=t.target.value,o=_(n);e.maybeCallOnChange(t,n,"type"),e.inputChanged(o),o?i({value:n}):e.onSuggestionsClearRequested()},onKeyDown:function(t,o){switch(t.key){case"ArrowDown":case"ArrowUp":if(w)_(O)&&(i({value:O}),e.revealSuggestions());else if(n.length>0){var r=o.newFocusedSectionIndex,u=o.newFocusedItemIndex,s=void 0;s=null===u?null===C?O:C:e.getSuggestionValueByIndex(r,u),e.updateFocusedSuggestion(r,u,O),e.maybeCallOnChange(t,s,"ArrowDown"===t.key?"down":"up")}t.preventDefault(),e.justPressedUpDown=!0,setTimeout(function(){e.justPressedUpDown=!1});break;case"Enter":var a=e.getFocusedSuggestion();if(R&&!I&&e.closeSuggestions(),null!==a){var c=y(a);e.maybeCallOnChange(t,c,"enter"),e.onSuggestionSelected(t,{suggestion:a,suggestionValue:c,suggestionIndex:P,sectionIndex:x,method:"enter"}),e.justSelectedSuggestion=!0,setTimeout(function(){e.justSelectedSuggestion=!1})}break;case"Escape":R&&t.preventDefault();var l=R&&!I;if(null===C){if(!l){var f="";e.maybeCallOnChange(t,f,"escape"),_(f)?i({value:f}):e.onSuggestionsClearRequested()}}else e.maybeCallOnChange(t,C,"escape");l?(e.onSuggestionsClearRequested(),e.closeSuggestions()):e.resetFocusedSuggestion()}T&&T(t)}}),F={query:(C||O).trim()};return l.default.createElement(g.default,{multiSection:c,items:D,renderInputComponent:o,renderItemsContainer:r,renderItem:u,renderItemData:F,renderSectionTitle:f,getSectionItems:d,focusedSectionIndex:x,focusedItemIndex:P,inputProps:E,itemProps:this.itemProps,theme:v(h),id:p,ref:this.storeReferences})}}]),t}(c.Component);I.defaultProps={shouldRenderSuggestions:h,alwaysRenderSuggestions:!1,multiSection:!1,focusInputOnSuggestionClick:!0,focusFirstSuggestion:!1,theme:y,id:"1"};var S=function(){var e=this;this.onDocumentMouseDown=function(t){e.justClickedOnSuggestionsContainer=!1;for(var n=t.detail&&t.detail.target||t.target;null!==n&&n!==document;){if(null!==n.getAttribute("data-suggestion-index"))return;if(n===e.suggestionsContainer)return void(e.justClickedOnSuggestionsContainer=!0);n=n.parentNode}},this.storeReferences=function(t){if(null!==t){var n=t.input,o=t.itemsContainer;e.input=n,e.suggestionsContainer=o}},this.onSuggestionMouseEnter=function(t,n){var o=n.sectionIndex,r=n.itemIndex;e.updateFocusedSuggestion(o,r)},this.focusFirstSuggestion=function(){e.updateFocusedSuggestion(e.props.multiSection?0:null,0)},this.onSuggestionMouseDown=function(){e.justSelectedSuggestion=!0},this.onSuggestionsClearRequested=function(){var t=e.props.onSuggestionsClearRequested;t&&t()},this.onSuggestionSelected=function(t,n){var o=e.props,r=o.alwaysRenderSuggestions,i=o.onSuggestionSelected,u=o.onSuggestionsFetchRequested;i&&i(t,n),r?u({value:n.suggestionValue}):e.onSuggestionsClearRequested(),e.resetFocusedSuggestion()},this.onSuggestionClick=function(t){var n=e.props,o=n.alwaysRenderSuggestions,r=n.focusInputOnSuggestionClick,i=e.getSuggestionIndices(e.findSuggestionElement(t.target)),u=i.sectionIndex,s=i.suggestionIndex,a=e.getSuggestion(u,s),c=e.props.getSuggestionValue(a);e.maybeCallOnChange(t,c,"click"),e.onSuggestionSelected(t,{suggestion:a,suggestionValue:c,suggestionIndex:s,sectionIndex:u,method:"click"}),o||e.closeSuggestions(),r===!0?e.input.focus():e.onBlur(),setTimeout(function(){e.justSelectedSuggestion=!1})},this.onBlur=function(){var t=e.props,n=t.inputProps,o=t.shouldRenderSuggestions,r=n.value,i=n.onBlur,u=e.getFocusedSuggestion();e.inputBlurred(o(r)),i&&i(e.blurEvent,{focusedSuggestion:u})},this.resetFocusedSuggestionOnMouseLeave=function(){e.resetFocusedSuggestion(!1)},this.itemProps=function(t){var n=t.sectionIndex,o=t.itemIndex;return{"data-section-index":n,"data-suggestion-index":o,onMouseEnter:e.onSuggestionMouseEnter,onMouseLeave:e.resetFocusedSuggestionOnMouseLeave,onMouseDown:e.onSuggestionMouseDown,onTouchStart:e.onSuggestionMouseDown,onClick:e.onSuggestionClick}}};t.default=I},function(t,n){t.exports=e},function(e,t){e.exports=function(e,t){if(e===t)return!0;var n=e.length;if(t.length!==n)return!1;for(var o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}},function(e,t,n){"use strict";e.exports=n(5).default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},a=function(){function e(e,t){var n=[],o=!0,r=!1,i=void 0;try{for(var u,s=e[Symbol.iterator]();!(o=(u=s.next()).done)&&(n.push(u.value),!t||n.length!==t);o=!0);}catch(e){r=!0,i=e}finally{try{!o&&s.return&&s.return()}finally{if(r)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),l=n(2),f=o(l),p=n(6),d=o(p),g=n(7),m=o(g),h=n(9),y=o(h),v=n(11),I=o(v),S=function(){return!0},b={},w=function(e){return f.default.createElement("input",e)},x=function(e){return f.default.createElement("div",e)},P={container:"react-autowhatever__container",containerOpen:"react-autowhatever__container--open",input:"react-autowhatever__input",itemsContainer:"react-autowhatever__items-container",itemsList:"react-autowhatever__items-list",item:"react-autowhatever__item",itemFocused:"react-autowhatever__item--focused",sectionContainer:"react-autowhatever__section-container",sectionTitle:"react-autowhatever__section-title"},C=function(e){function t(e){r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.focusedItem=null,n.setSectionsItems(e),n.setSectionIterator(e),n.setTheme(e),n.onKeyDown=n.onKeyDown.bind(n),n.storeInputReference=n.storeInputReference.bind(n),n.storeItemsContainerReference=n.storeItemsContainerReference.bind(n),n.onFocusedItemChange=n.onFocusedItemChange.bind(n),n.getItemId=n.getItemId.bind(n),n}return u(t,e),c(t,[{key:"componentDidMount",value:function(){this.ensureFocusedItemIsVisible()}},{key:"componentWillReceiveProps",value:function(e){e.items!==this.props.items&&this.setSectionsItems(e),e.items===this.props.items&&e.multiSection===this.props.multiSection||this.setSectionIterator(e),e.theme!==this.props.theme&&this.setTheme(e)}},{key:"componentDidUpdate",value:function(){this.ensureFocusedItemIsVisible()}},{key:"setSectionsItems",value:function(e){e.multiSection&&(this.sectionsItems=e.items.map(function(t){return e.getSectionItems(t)}),this.sectionsLengths=this.sectionsItems.map(function(e){return e.length}),this.allSectionsAreEmpty=this.sectionsLengths.every(function(e){return 0===e}))}},{key:"setSectionIterator",value:function(e){this.sectionIterator=(0,d.default)({multiSection:e.multiSection,data:e.multiSection?this.sectionsLengths:e.items.length})}},{key:"setTheme",value:function(e){this.theme=(0,m.default)(e.theme)}},{key:"storeInputReference",value:function(e){null!==e&&(this.input=e)}},{key:"storeItemsContainerReference",value:function(e){null!==e&&(this.itemsContainer=e)}},{key:"onFocusedItemChange",value:function(e){this.focusedItem=e}},{key:"getItemId",value:function(e,t){if(null===t)return null;var n=this.props.id,o=null===e?"":"section-"+e;return"react-autowhatever-"+n+"-"+o+"-item-"+t}},{key:"renderSections",value:function(){var e=this;if(this.allSectionsAreEmpty)return null;var t=this.theme,n=this.props,o=n.id,r=n.items,i=n.renderItem,u=n.renderItemData,s=n.shouldRenderSection,a=n.renderSectionTitle,c=n.focusedSectionIndex,l=n.focusedItemIndex,p=n.itemProps;return r.map(function(n,r){if(!s(n))return null;var d="react-autowhatever-"+o+"-",g=d+"section-"+r+"-";return f.default.createElement("div",t(g+"container","sectionContainer"),f.default.createElement(y.default,{section:n,renderSectionTitle:a,theme:t,sectionKeyPrefix:g}),f.default.createElement(I.default,{items:e.sectionsItems[r],itemProps:p,renderItem:i,renderItemData:u,sectionIndex:r,focusedItemIndex:c===r?l:null,onFocusedItemChange:e.onFocusedItemChange,getItemId:e.getItemId,theme:t,keyPrefix:d,ref:e.storeItemsListReference}))})}},{key:"renderItems",value:function(){var e=this.props.items;if(0===e.length)return null;var t=this.theme,n=this.props,o=n.id,r=n.renderItem,i=n.renderItemData,u=n.focusedSectionIndex,s=n.focusedItemIndex,a=n.itemProps;return f.default.createElement(I.default,{items:e,itemProps:a,renderItem:r,renderItemData:i,focusedItemIndex:null===u?s:null,onFocusedItemChange:this.onFocusedItemChange,getItemId:this.getItemId,theme:t,keyPrefix:"react-autowhatever-"+o+"-"})}},{key:"onKeyDown",value:function(e){var t=this.props,n=t.inputProps,o=t.focusedSectionIndex,r=t.focusedItemIndex;switch(e.key){case"ArrowDown":case"ArrowUp":var i="ArrowDown"===e.key?"next":"prev",u=this.sectionIterator[i]([o,r]),s=a(u,2),c=s[0],l=s[1];n.onKeyDown(e,{newFocusedSectionIndex:c,newFocusedItemIndex:l});break;default:n.onKeyDown(e,{focusedSectionIndex:o,focusedItemIndex:r})}}},{key:"ensureFocusedItemIsVisible",value:function(){var e=this.focusedItem;if(e){var t=this.itemsContainer,n=e.offsetParent===t?e.offsetTop:e.offsetTop-t.offsetTop,o=t.scrollTop;n<o?o=n:n+e.offsetHeight>o+t.offsetHeight&&(o=n+e.offsetHeight-t.offsetHeight),o!==t.scrollTop&&(t.scrollTop=o)}}},{key:"render",value:function(){var e=this.theme,t=this.props,n=t.id,o=t.multiSection,r=t.renderInputComponent,i=t.renderItemsContainer,u=t.focusedSectionIndex,a=t.focusedItemIndex,c=o?this.renderSections():this.renderItems(),l=null!==c,p=this.getItemId(u,a),d=e("react-autowhatever-"+n+"-container","container",l&&"containerOpen"),g="react-autowhatever-"+n,m=r(s({type:"text",value:"",autoComplete:"off",role:"combobox","aria-autocomplete":"list","aria-owns":g,"aria-expanded":l,"aria-haspopup":l,"aria-activedescendant":p},e("react-autowhatever-"+n+"-input","input"),this.props.inputProps,{onKeyDown:this.props.inputProps.onKeyDown&&this.onKeyDown,ref:this.storeInputReference})),h=i(s({id:g},e("react-autowhatever-"+n+"-items-container","itemsContainer"),{ref:this.storeItemsContainerReference,children:c}));return f.default.createElement("div",d,m,h)}}]),t}(l.Component);C.propTypes={id:l.PropTypes.string,multiSection:l.PropTypes.bool,renderInputComponent:l.PropTypes.func,items:l.PropTypes.array.isRequired,renderItemsContainer:l.PropTypes.func,renderItem:l.PropTypes.func,renderItemData:l.PropTypes.object,shouldRenderSection:l.PropTypes.func,renderSectionTitle:l.PropTypes.func,getSectionItems:l.PropTypes.func,inputComponent:l.PropTypes.func,inputProps:l.PropTypes.object,itemProps:l.PropTypes.oneOfType([l.PropTypes.object,l.PropTypes.func]),focusedSectionIndex:l.PropTypes.number,focusedItemIndex:l.PropTypes.number,theme:l.PropTypes.oneOfType([l.PropTypes.object,l.PropTypes.array])},C.defaultProps={id:"1",multiSection:!1,renderInputComponent:w,renderItemsContainer:x,shouldRenderSection:S,renderItem:function(){throw new Error("`renderItem` must be provided")},renderItemData:b,renderSectionTitle:function(){throw new Error("`renderSectionTitle` must be provided")},getSectionItems:function(){throw new Error("`getSectionItems` must be provided")},inputProps:b,itemProps:b,focusedSectionIndex:null,focusedItemIndex:null,theme:P},t.default=C},function(e,t){"use strict";var n=function(){function e(e,t){var n=[],o=!0,r=!1,i=void 0;try{for(var u,s=e[Symbol.iterator]();!(o=(u=s.next()).done)&&(n.push(u.value),!t||n.length!==t);o=!0);}catch(e){r=!0,i=e}finally{try{!o&&s.return&&s.return()}finally{if(r)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.exports=function(e){function t(e){for(null===e?e=0:e++;e<s.length&&0===s[e];)e++;return e===s.length?null:e}function o(e){for(null===e?e=s.length-1:e--;e>=0&&0===s[e];)e--;return e===-1?null:e}function r(e){var o=n(e,2),r=o[0],i=o[1];return a?null===i||i===s[r]-1?(r=t(r),null===r?[null,null]:[r,0]):[r,i+1]:0===s||i===s-1?[null,null]:null===i?[null,0]:[null,i+1]}function i(e){var t=n(e,2),r=t[0],i=t[1];return a?null===i||0===i?(r=o(r),null===r?[null,null]:[r,s[r]-1]):[r,i-1]:0===s||0===i?[null,null]:null===i?[null,s-1]:[null,i-1]}function u(e){return null===r(e)[1]}var s=e.data,a=e.multiSection;return{next:r,prev:i,isLast:u}}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){var n=[],o=!0,r=!1,i=void 0;try{for(var u,s=e[Symbol.iterator]();!(o=(u=s.next()).done)&&(n.push(u.value),!t||n.length!==t);o=!0);}catch(e){r=!0,i=e}finally{try{!o&&s.return&&s.return()}finally{if(r)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=n(8),s=o(u),a=function(e){return e};t.default=function(e){var t=Array.isArray(e)&&2===e.length?e:[e,null],n=i(t,2),o=n[0],u=n[1];return function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var c=n.map(function(e){return o[e]}).filter(a);return"string"==typeof c[0]||"function"==typeof u?{key:e,className:u?u.apply(void 0,r(c)):c.join(" ")}:{key:e,style:s.default.apply(void 0,[{}].concat(r(c)))}}},e.exports=t.default},function(e,t){"use strict";function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function o(e){var t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e))),t.filter(function(t){return r.call(e,t)})}var r=Object.prototype.propertyIsEnumerable;e.exports=Object.assign||function(e,t){for(var r,i,u=n(e),s=1;s<arguments.length;s++){r=arguments[s],i=o(Object(r));for(var a=0;a<i.length;a++)u[i[a]]=r[i[a]]}return u}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=n(2),c=o(a),l=n(10),f=o(l),p=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,e),s(t,[{key:"shouldComponentUpdate",value:function(e){return(0,f.default)(e,this.props)}},{key:"render",value:function(){var e=this.props,t=e.section,n=e.renderSectionTitle,o=e.theme,r=e.sectionKeyPrefix,i=n(t);return i?c.default.createElement("div",o(r+"title","sectionTitle"),i):null}}]),t}(a.Component);p.propTypes={section:a.PropTypes.any.isRequired,renderSectionTitle:a.PropTypes.func.isRequired,theme:a.PropTypes.func.isRequired,sectionKeyPrefix:a.PropTypes.string.isRequired},t.default=p},function(e,t){"use strict";function n(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e===t)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!0;var u={},s=void 0,a=void 0;for(s=0,a=n.length;s<a;s++)u[n[s]]=!0;for(s=0,a=r.length;s<a;s++){var c=r[s],l=e[c],f=t[c];if(l!==f){if(!u[c]||null===l||null===f||"object"!==("undefined"==typeof l?"undefined":o(l))||"object"!==("undefined"==typeof f?"undefined":o(f)))return!0;var p=Object.keys(l),d=Object.keys(f);if(p.length!==d.length)return!0;for(var g=0,m=p.length;g<m;g++){var h=p[g];if(l[h]!==f[h])return!0}}}return!1}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=n},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),c=n(2),l=o(c),f=n(12),p=o(f),d=n(10),g=o(d),m=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.storeFocusedItemReference=e.storeFocusedItemReference.bind(e),e}return u(t,e),a(t,[{key:"shouldComponentUpdate",value:function(e){return(0,g.default)(e,this.props,["itemProps"])}},{key:"storeFocusedItemReference",value:function(e){this.props.onFocusedItemChange(null===e?null:e.item)}},{key:"render",value:function(){var e=this,t=this.props,n=t.items,o=t.itemProps,r=t.renderItem,i=t.renderItemData,u=t.sectionIndex,a=t.focusedItemIndex,c=t.getItemId,f=t.theme,d=t.keyPrefix,g=null===u?d:d+"section-"+u+"-",m="function"==typeof o;return l.default.createElement("ul",s({role:"listbox"},f(g+"items-list","itemsList")),n.map(function(t,n){var d=n===a,h=g+"item-"+n,y=m?o({sectionIndex:u,itemIndex:n}):o,v=s({id:c(u,n)},f(h,"item",d&&"itemFocused"),y);return d&&(v.ref=e.storeFocusedItemReference),l.default.createElement(p.default,s({},v,{sectionIndex:u,itemIndex:n,item:t,renderItem:r,renderItemData:i}))}))}}]),t}(c.Component);m.propTypes={items:c.PropTypes.array.isRequired,itemProps:c.PropTypes.oneOfType([c.PropTypes.object,c.PropTypes.func]),renderItem:c.PropTypes.func.isRequired,renderItemData:c.PropTypes.object.isRequired,sectionIndex:c.PropTypes.number,focusedItemIndex:c.PropTypes.number,onFocusedItemChange:c.PropTypes.func.isRequired,getItemId:c.PropTypes.func.isRequired,theme:c.PropTypes.func.isRequired,keyPrefix:c.PropTypes.string.isRequired},m.defaultProps={sectionIndex:null},t.default=m},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),l=n(2),f=o(l),p=n(10),d=o(p),g=function(e){function t(){i(this,t);var e=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.storeItemReference=e.storeItemReference.bind(e),e.onMouseEnter=e.onMouseEnter.bind(e),e.onMouseLeave=e.onMouseLeave.bind(e),e.onMouseDown=e.onMouseDown.bind(e),e.onClick=e.onClick.bind(e),e}return s(t,e),c(t,[{key:"shouldComponentUpdate",value:function(e){return(0,d.default)(e,this.props,["renderItemData"])}},{key:"storeItemReference",value:function(e){null!==e&&(this.item=e)}},{key:"onMouseEnter",value:function(e){var t=this.props,n=t.sectionIndex,o=t.itemIndex;this.props.onMouseEnter(e,{sectionIndex:n,itemIndex:o})}},{key:"onMouseLeave",value:function(e){var t=this.props,n=t.sectionIndex,o=t.itemIndex;this.props.onMouseLeave(e,{sectionIndex:n,itemIndex:o})}},{key:"onMouseDown",value:function(e){var t=this.props,n=t.sectionIndex,o=t.itemIndex;this.props.onMouseDown(e,{sectionIndex:n,itemIndex:o})}},{key:"onClick",value:function(e){var t=this.props,n=t.sectionIndex,o=t.itemIndex;this.props.onClick(e,{sectionIndex:n,itemIndex:o})}},{key:"render",value:function(){var e=this.props,t=e.item,n=e.renderItem,o=e.renderItemData,i=r(e,["item","renderItem","renderItemData"]);return delete i.sectionIndex,delete i.itemIndex,"function"==typeof i.onMouseEnter&&(i.onMouseEnter=this.onMouseEnter),"function"==typeof i.onMouseLeave&&(i.onMouseLeave=this.onMouseLeave),"function"==typeof i.onMouseDown&&(i.onMouseDown=this.onMouseDown),"function"==typeof i.onClick&&(i.onClick=this.onClick),f.default.createElement("li",a({role:"option"},i,{ref:this.storeItemReference}),n(t,o))}}]),t}(l.Component);g.propTypes={sectionIndex:l.PropTypes.number,itemIndex:l.PropTypes.number.isRequired,item:l.PropTypes.any.isRequired,renderItem:l.PropTypes.func.isRequired,renderItemData:l.PropTypes.object.isRequired,onMouseEnter:l.PropTypes.func,onMouseLeave:l.PropTypes.func,onMouseDown:l.PropTypes.func,onClick:l.PropTypes.func},t.default=g}])});
!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.Autosuggest=t(require("React")):e.Autosuggest=t(e.React)}(this,function(e){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";e.exports=n(1).default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),l=n(2),c=o(l),g=n(3),p=o(g),d=n(4),f=o(d),h=n(13),m=function(){return!0},y=function(e){return e.trim().length>0},v=function(e){var t=e.containerProps,n=e.children;return c.default.createElement("div",t,n)},I=function(e){function t(e){var n=e.alwaysRenderSuggestions;r(this,t);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return S.call(o),o.state={isFocused:!1,isCollapsed:!n,highlightedSectionIndex:null,highlightedSuggestionIndex:null,valueBeforeUpDown:null},o.justPressedUpDown=!1,o}return u(t,e),a(t,[{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.onDocumentMouseDown)}},{key:"componentWillReceiveProps",value:function(e){(0,p.default)(e.suggestions,this.props.suggestions)?e.highlightFirstSuggestion&&e.suggestions.length>0&&this.justPressedUpDown===!1&&this.highlightFirstSuggestion():this.willRenderSuggestions(e)?(e.highlightFirstSuggestion&&this.highlightFirstSuggestion(),this.state.isCollapsed&&!this.justSelectedSuggestion&&this.revealSuggestions()):this.resetHighlightedSuggestion()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.onDocumentMouseDown)}},{key:"inputFocused",value:function(e){this.setState({isFocused:!0,isCollapsed:!e})}},{key:"inputBlurred",value:function(e){this.setState({isFocused:!1,highlightedSectionIndex:null,highlightedSuggestionIndex:null,valueBeforeUpDown:null,isCollapsed:!e})}},{key:"inputChanged",value:function(e){this.setState({highlightedSectionIndex:null,highlightedSuggestionIndex:null,valueBeforeUpDown:null,isCollapsed:!e})}},{key:"updateHighlightedSuggestion",value:function(e,t,n){var o=this.state.valueBeforeUpDown;null===t?o=null:null===o&&"undefined"!=typeof n&&(o=n),this.setState({highlightedSectionIndex:e,highlightedSuggestionIndex:t,valueBeforeUpDown:o})}},{key:"resetHighlightedSuggestion",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.state.valueBeforeUpDown;this.setState({highlightedSectionIndex:null,highlightedSuggestionIndex:null,valueBeforeUpDown:e?null:t})}},{key:"revealSuggestions",value:function(){this.setState({isCollapsed:!1})}},{key:"closeSuggestions",value:function(){this.setState({highlightedSectionIndex:null,highlightedSuggestionIndex:null,valueBeforeUpDown:null,isCollapsed:!0})}},{key:"getSuggestion",value:function(e,t){var n=this.props,o=n.suggestions,r=n.multiSection,i=n.getSectionSuggestions;return r?i(o[e])[t]:o[t]}},{key:"getHighlightedSuggestion",value:function(){var e=this.state,t=e.highlightedSectionIndex,n=e.highlightedSuggestionIndex;return null===n?null:this.getSuggestion(t,n)}},{key:"getSuggestionValueByIndex",value:function(e,t){var n=this.props.getSuggestionValue;return n(this.getSuggestion(e,t))}},{key:"getSuggestionIndices",value:function(e){var t=e.getAttribute("data-section-index"),n=e.getAttribute("data-suggestion-index");return{sectionIndex:"string"==typeof t?parseInt(t,10):null,suggestionIndex:parseInt(n,10)}}},{key:"findSuggestionElement",value:function(e){var t=e;do{if(null!==t.getAttribute("data-suggestion-index"))return t;t=t.parentNode}while(null!==t);throw console.error("Clicked element:",e),new Error("Couldn't find suggestion element")}},{key:"maybeCallOnChange",value:function(e,t,n){var o=this.props.inputProps,r=o.value,i=o.onChange;t!==r&&i(e,{newValue:t,method:n})}},{key:"willRenderSuggestions",value:function(e){var t=e.suggestions,n=e.inputProps,o=e.shouldRenderSuggestions,r=n.value;return t.length>0&&o(r)}},{key:"getQuery",value:function(){var e=this.props.inputProps,t=e.value,n=this.state.valueBeforeUpDown;return(n||t).trim()}},{key:"render",value:function(){var e=this,t=this.props,n=t.suggestions,o=t.renderInputComponent,r=t.onSuggestionsFetchRequested,i=t.renderSuggestion,u=t.inputProps,a=t.multiSection,l=t.renderSectionTitle,g=t.id,p=t.getSectionSuggestions,d=t.theme,y=t.getSuggestionValue,v=t.alwaysRenderSuggestions,I=this.state,S=I.isFocused,b=I.isCollapsed,w=I.highlightedSectionIndex,P=I.highlightedSuggestionIndex,x=I.valueBeforeUpDown,_=v?m:this.props.shouldRenderSuggestions,C=u.value,O=u.onFocus,T=u.onKeyDown,j=this.willRenderSuggestions(this.props),k=v||S&&!b&&j,R=k?n:[],D=s({},u,{onFocus:function(t){if(!e.justSelectedSuggestion&&!e.justClickedOnSuggestionsContainer){var n=_(C);e.inputFocused(n),O&&O(t),n&&r({value:C})}},onBlur:function(t){return e.justClickedOnSuggestionsContainer?void e.input.focus():(e.blurEvent=t,void(e.justSelectedSuggestion||(e.onBlur(),e.onSuggestionsClearRequested())))},onChange:function(t){var n=t.target.value,o=_(n);e.maybeCallOnChange(t,n,"type"),e.inputChanged(o),o?r({value:n}):e.onSuggestionsClearRequested()},onKeyDown:function(t,o){switch(t.key){case"ArrowDown":case"ArrowUp":if(b)_(C)&&(r({value:C}),e.revealSuggestions());else if(n.length>0){var i=o.newHighlightedSectionIndex,u=o.newHighlightedItemIndex,s=void 0;s=null===u?null===x?C:x:e.getSuggestionValueByIndex(i,u),e.updateHighlightedSuggestion(i,u,C),e.maybeCallOnChange(t,s,"ArrowDown"===t.key?"down":"up")}t.preventDefault(),e.justPressedUpDown=!0,setTimeout(function(){e.justPressedUpDown=!1});break;case"Enter":var a=e.getHighlightedSuggestion();if(k&&!v&&e.closeSuggestions(),null!==a){var l=y(a);e.maybeCallOnChange(t,l,"enter"),e.onSuggestionSelected(t,{suggestion:a,suggestionValue:l,suggestionIndex:P,sectionIndex:w,method:"enter"}),e.justSelectedSuggestion=!0,setTimeout(function(){e.justSelectedSuggestion=!1})}break;case"Escape":k&&t.preventDefault();var c=k&&!v;if(null===x){if(!c){var g="";e.maybeCallOnChange(t,g,"escape"),_(g)?r({value:g}):e.onSuggestionsClearRequested()}}else e.maybeCallOnChange(t,x,"escape");c?(e.onSuggestionsClearRequested(),e.closeSuggestions()):e.resetHighlightedSuggestion()}T&&T(t)}}),E={query:this.getQuery()};return c.default.createElement(f.default,{multiSection:a,items:R,renderInputComponent:o,renderItemsContainer:this.renderSuggestionsContainer,renderItem:i,renderItemData:E,renderSectionTitle:l,getSectionItems:p,highlightedSectionIndex:w,highlightedItemIndex:P,inputProps:D,itemProps:this.itemProps,theme:(0,h.mapToAutowhateverTheme)(d),id:g,ref:this.storeReferences})}}]),t}(l.Component);I.defaultProps={renderSuggestionsContainer:v,shouldRenderSuggestions:y,alwaysRenderSuggestions:!1,multiSection:!1,focusInputOnSuggestionClick:!0,highlightFirstSuggestion:!1,theme:h.defaultTheme,id:"1"};var S=function(){var e=this;this.onDocumentMouseDown=function(t){e.justClickedOnSuggestionsContainer=!1;for(var n=t.detail&&t.detail.target||t.target;null!==n&&n!==document;){if(null!==n.getAttribute("data-suggestion-index"))return;if(n===e.suggestionsContainer)return void(e.justClickedOnSuggestionsContainer=!0);n=n.parentNode}},this.storeReferences=function(t){if(null!==t){var n=t.input,o=t.itemsContainer;e.input=n,e.suggestionsContainer=o}},this.onSuggestionMouseEnter=function(t,n){var o=n.sectionIndex,r=n.itemIndex;e.updateHighlightedSuggestion(o,r)},this.highlightFirstSuggestion=function(){e.updateHighlightedSuggestion(e.props.multiSection?0:null,0)},this.onSuggestionMouseDown=function(){e.justSelectedSuggestion=!0},this.onSuggestionsClearRequested=function(){var t=e.props.onSuggestionsClearRequested;t&&t()},this.onSuggestionSelected=function(t,n){var o=e.props,r=o.alwaysRenderSuggestions,i=o.onSuggestionSelected,u=o.onSuggestionsFetchRequested;i&&i(t,n),r?u({value:n.suggestionValue}):e.onSuggestionsClearRequested(),e.resetHighlightedSuggestion()},this.onSuggestionClick=function(t){var n=e.props,o=n.alwaysRenderSuggestions,r=n.focusInputOnSuggestionClick,i=e.getSuggestionIndices(e.findSuggestionElement(t.target)),u=i.sectionIndex,s=i.suggestionIndex,a=e.getSuggestion(u,s),l=e.props.getSuggestionValue(a);e.maybeCallOnChange(t,l,"click"),e.onSuggestionSelected(t,{suggestion:a,suggestionValue:l,suggestionIndex:s,sectionIndex:u,method:"click"}),o||e.closeSuggestions(),r===!0?e.input.focus():e.onBlur(),setTimeout(function(){e.justSelectedSuggestion=!1})},this.onBlur=function(){var t=e.props,n=t.inputProps,o=t.shouldRenderSuggestions,r=n.value,i=n.onBlur,u=e.getHighlightedSuggestion();e.inputBlurred(o(r)),i&&i(e.blurEvent,{highlightedSuggestion:u})},this.resetHighlightedSuggestionOnMouseLeave=function(){e.resetHighlightedSuggestion(!1)},this.itemProps=function(t){var n=t.sectionIndex,o=t.itemIndex;return{"data-section-index":n,"data-suggestion-index":o,onMouseEnter:e.onSuggestionMouseEnter,onMouseLeave:e.resetHighlightedSuggestionOnMouseLeave,onMouseDown:e.onSuggestionMouseDown,onTouchStart:e.onSuggestionMouseDown,onClick:e.onSuggestionClick}},this.renderSuggestionsContainer=function(t){var n=t.containerProps,o=t.children,r=e.props.renderSuggestionsContainer;return r({containerProps:n,children:o,query:e.getQuery()})}};t.default=I},function(t,n){t.exports=e},function(e,t){e.exports=function(e,t){if(e===t)return!0;var n=e.length;if(t.length!==n)return!1;for(var o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}},function(e,t,n){"use strict";e.exports=n(5).default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){var n=[],o=!0,r=!1,i=void 0;try{for(var u,s=e[Symbol.iterator]();!(o=(u=s.next()).done)&&(n.push(u.value),!t||n.length!==t);o=!0);}catch(e){r=!0,i=e}finally{try{!o&&s.return&&s.return()}finally{if(r)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},c=n(2),g=o(c),p=n(6),d=o(p),f=n(7),h=o(f),m=n(9),y=o(m),v=n(11),I=o(v),S=function(){return!0},b={},w=function(e){return g.default.createElement("input",e)},P=function(e){var t=e.children,n=e.containerProps;return g.default.createElement("div",l({children:t},n))},x={container:"react-autowhatever__container",containerOpen:"react-autowhatever__container--open",input:"react-autowhatever__input",inputOpen:"react-autowhatever__input--open",inputFocused:"react-autowhatever__input--focused",itemsContainer:"react-autowhatever__items-container",itemsContainerOpen:"react-autowhatever__items-container--open",itemsList:"react-autowhatever__items-list",item:"react-autowhatever__item",itemFirst:"react-autowhatever__item--first",itemHighlighted:"react-autowhatever__item--highlighted",sectionContainer:"react-autowhatever__section-container",sectionContainerFirst:"react-autowhatever__section-container--first",sectionTitle:"react-autowhatever__section-title"},_=function(e){function t(e){r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.storeInputReference=function(e){null!==e&&(n.input=e)},n.storeItemsContainerReference=function(e){null!==e&&(n.itemsContainer=e)},n.onHighlightedItemChange=function(e){n.highlightedItem=e},n.getItemId=function(e,t){if(null===t)return null;var o=n.props.id,r=null===e?"":"section-"+e;return"react-autowhatever-"+o+"-"+r+"-item-"+t},n.onFocus=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!0}),t.onFocus&&t.onFocus(e)},n.onBlur=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!1}),t.onBlur&&t.onBlur(e)},n.onKeyDown=function(e){var t=n.props,o=t.inputProps,r=t.highlightedSectionIndex,i=t.highlightedItemIndex;switch(e.key){case"ArrowDown":case"ArrowUp":var u="ArrowDown"===e.key?"next":"prev",a=n.sectionIterator[u]([r,i]),l=s(a,2),c=l[0],g=l[1];o.onKeyDown(e,{newHighlightedSectionIndex:c,newHighlightedItemIndex:g});break;default:o.onKeyDown(e,{highlightedSectionIndex:r,highlightedItemIndex:i})}},n.highlightedItem=null,n.state={isInputFocused:!1},n.setSectionsItems(e),n.setSectionIterator(e),n.setTheme(e),n}return u(t,e),a(t,[{key:"componentDidMount",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"componentWillReceiveProps",value:function(e){e.items!==this.props.items&&this.setSectionsItems(e),e.items===this.props.items&&e.multiSection===this.props.multiSection||this.setSectionIterator(e),e.theme!==this.props.theme&&this.setTheme(e)}},{key:"componentDidUpdate",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"setSectionsItems",value:function(e){e.multiSection&&(this.sectionsItems=e.items.map(function(t){return e.getSectionItems(t)}),this.sectionsLengths=this.sectionsItems.map(function(e){return e.length}),this.allSectionsAreEmpty=this.sectionsLengths.every(function(e){return 0===e}))}},{key:"setSectionIterator",value:function(e){this.sectionIterator=(0,d.default)({multiSection:e.multiSection,data:e.multiSection?this.sectionsLengths:e.items.length})}},{key:"setTheme",value:function(e){this.theme=(0,h.default)(e.theme)}},{key:"renderSections",value:function(){var e=this;if(this.allSectionsAreEmpty)return null;var t=this.theme,n=this.props,o=n.id,r=n.items,i=n.renderItem,u=n.renderItemData,s=n.shouldRenderSection,a=n.renderSectionTitle,l=n.highlightedSectionIndex,c=n.highlightedItemIndex,p=n.itemProps;return r.map(function(n,r){if(!s(n))return null;var d="react-autowhatever-"+o+"-",f=d+"section-"+r+"-",h=0===r;return g.default.createElement("div",t(f+"container","sectionContainer",h&&"sectionContainerFirst"),g.default.createElement(y.default,{section:n,renderSectionTitle:a,theme:t,sectionKeyPrefix:f}),g.default.createElement(I.default,{items:e.sectionsItems[r],itemProps:p,renderItem:i,renderItemData:u,sectionIndex:r,highlightedItemIndex:l===r?c:null,onHighlightedItemChange:e.onHighlightedItemChange,getItemId:e.getItemId,theme:t,keyPrefix:d,ref:e.storeItemsListReference}))})}},{key:"renderItems",value:function(){var e=this.props.items;if(0===e.length)return null;var t=this.theme,n=this.props,o=n.id,r=n.renderItem,i=n.renderItemData,u=n.highlightedSectionIndex,s=n.highlightedItemIndex,a=n.itemProps;return g.default.createElement(I.default,{items:e,itemProps:a,renderItem:r,renderItemData:i,highlightedItemIndex:null===u?s:null,onHighlightedItemChange:this.onHighlightedItemChange,getItemId:this.getItemId,theme:t,keyPrefix:"react-autowhatever-"+o+"-"})}},{key:"ensureHighlightedItemIsVisible",value:function(){var e=this.highlightedItem;if(e){var t=this.itemsContainer,n=e.offsetParent===t?e.offsetTop:e.offsetTop-t.offsetTop,o=t.scrollTop;n<o?o=n:n+e.offsetHeight>o+t.offsetHeight&&(o=n+e.offsetHeight-t.offsetHeight),o!==t.scrollTop&&(t.scrollTop=o)}}},{key:"render",value:function(){var e=this.theme,t=this.props,n=t.id,o=t.multiSection,r=t.renderInputComponent,i=t.renderItemsContainer,u=t.highlightedSectionIndex,s=t.highlightedItemIndex,a=this.state.isInputFocused,c=o?this.renderSections():this.renderItems(),p=null!==c,d=this.getItemId(u,s),f=e("react-autowhatever-"+n+"-container","container",p&&"containerOpen"),h="react-autowhatever-"+n,m=r(l({type:"text",value:"",autoComplete:"off",role:"combobox","aria-autocomplete":"list","aria-owns":h,"aria-expanded":p,"aria-haspopup":p,"aria-activedescendant":d},e("react-autowhatever-"+n+"-input","input",p&&"inputOpen",a&&"inputFocused"),this.props.inputProps,{onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.props.inputProps.onKeyDown&&this.onKeyDown,ref:this.storeInputReference})),y=i({children:c,containerProps:l({id:h},e("react-autowhatever-"+n+"-items-container","itemsContainer",p&&"itemsContainerOpen"),{ref:this.storeItemsContainerReference})});return g.default.createElement("div",f,m,y)}}]),t}(c.Component);_.propTypes={id:c.PropTypes.string,multiSection:c.PropTypes.bool,renderInputComponent:c.PropTypes.func,renderItemsContainer:c.PropTypes.func,items:c.PropTypes.array.isRequired,renderItem:c.PropTypes.func,renderItemData:c.PropTypes.object,shouldRenderSection:c.PropTypes.func,renderSectionTitle:c.PropTypes.func,getSectionItems:c.PropTypes.func,inputProps:c.PropTypes.object,itemProps:c.PropTypes.oneOfType([c.PropTypes.object,c.PropTypes.func]),highlightedSectionIndex:c.PropTypes.number,highlightedItemIndex:c.PropTypes.number,theme:c.PropTypes.oneOfType([c.PropTypes.object,c.PropTypes.array])},_.defaultProps={id:"1",multiSection:!1,renderInputComponent:w,renderItemsContainer:P,shouldRenderSection:S,renderItem:function(){throw new Error("`renderItem` must be provided")},renderItemData:b,renderSectionTitle:function(){throw new Error("`renderSectionTitle` must be provided")},getSectionItems:function(){throw new Error("`getSectionItems` must be provided")},inputProps:b,itemProps:b,highlightedSectionIndex:null,highlightedItemIndex:null,theme:x},t.default=_},function(e,t){"use strict";var n=function(){function e(e,t){var n=[],o=!0,r=!1,i=void 0;try{for(var u,s=e[Symbol.iterator]();!(o=(u=s.next()).done)&&(n.push(u.value),!t||n.length!==t);o=!0);}catch(e){r=!0,i=e}finally{try{!o&&s.return&&s.return()}finally{if(r)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.exports=function(e){function t(e){for(null===e?e=0:e++;e<s.length&&0===s[e];)e++;return e===s.length?null:e}function o(e){for(null===e?e=s.length-1:e--;e>=0&&0===s[e];)e--;return e===-1?null:e}function r(e){var o=n(e,2),r=o[0],i=o[1];return a?null===i||i===s[r]-1?(r=t(r),null===r?[null,null]:[r,0]):[r,i+1]:0===s||i===s-1?[null,null]:null===i?[null,0]:[null,i+1]}function i(e){var t=n(e,2),r=t[0],i=t[1];return a?null===i||0===i?(r=o(r),null===r?[null,null]:[r,s[r]-1]):[r,i-1]:0===s||0===i?[null,null]:null===i?[null,s-1]:[null,i-1]}function u(e){return null===r(e)[1]}var s=e.data,a=e.multiSection;return{next:r,prev:i,isLast:u}}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){var n=[],o=!0,r=!1,i=void 0;try{for(var u,s=e[Symbol.iterator]();!(o=(u=s.next()).done)&&(n.push(u.value),!t||n.length!==t);o=!0);}catch(e){r=!0,i=e}finally{try{!o&&s.return&&s.return()}finally{if(r)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=n(8),s=o(u),a=function(e){return e};t.default=function(e){var t=Array.isArray(e)&&2===e.length?e:[e,null],n=i(t,2),o=n[0],u=n[1];return function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var l=n.map(function(e){return o[e]}).filter(a);return"string"==typeof l[0]||"function"==typeof u?{key:e,className:u?u.apply(void 0,r(l)):l.join(" ")}:{key:e,style:s.default.apply(void 0,[{}].concat(r(l)))}}},e.exports=t.default},function(e,t){"use strict";function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function o(e){var t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e))),t.filter(function(t){return r.call(e,t)})}var r=Object.prototype.propertyIsEnumerable;e.exports=Object.assign||function(e,t){for(var r,i,u=n(e),s=1;s<arguments.length;s++){r=arguments[s],i=o(Object(r));for(var a=0;a<i.length;a++)u[i[a]]=r[i[a]]}return u}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=n(2),l=o(a),c=n(10),g=o(c),p=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,e),s(t,[{key:"shouldComponentUpdate",value:function(e){return(0,g.default)(e,this.props)}},{key:"render",value:function(){var e=this.props,t=e.section,n=e.renderSectionTitle,o=e.theme,r=e.sectionKeyPrefix,i=n(t);return i?l.default.createElement("div",o(r+"title","sectionTitle"),i):null}}]),t}(a.Component);p.propTypes={section:a.PropTypes.any.isRequired,renderSectionTitle:a.PropTypes.func.isRequired,theme:a.PropTypes.func.isRequired,sectionKeyPrefix:a.PropTypes.string.isRequired},t.default=p},function(e,t){"use strict";function n(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e===t)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!0;var u={},s=void 0,a=void 0;for(s=0,a=n.length;s<a;s++)u[n[s]]=!0;for(s=0,a=r.length;s<a;s++){var l=r[s],c=e[l],g=t[l];if(c!==g){if(!u[l]||null===c||null===g||"object"!==("undefined"==typeof c?"undefined":o(c))||"object"!==("undefined"==typeof g?"undefined":o(g)))return!0;var p=Object.keys(c),d=Object.keys(g);if(p.length!==d.length)return!0;for(var f=0,h=p.length;f<h;f++){var m=p[f];if(c[m]!==g[m])return!0}}}return!1}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=n},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),l=n(2),c=o(l),g=n(12),p=o(g),d=n(10),f=o(d),h=function(e){function t(){var e,n,o,u;r(this,t);for(var s=arguments.length,a=Array(s),l=0;l<s;l++)a[l]=arguments[l];return n=o=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),o.storeHighlightedItemReference=function(e){o.props.onHighlightedItemChange(null===e?null:e.item)},u=n,i(o,u)}return u(t,e),a(t,[{key:"shouldComponentUpdate",value:function(e){return(0,f.default)(e,this.props,["itemProps"])}},{key:"render",value:function(){var e=this,t=this.props,n=t.items,o=t.itemProps,r=t.renderItem,i=t.renderItemData,u=t.sectionIndex,a=t.highlightedItemIndex,l=t.getItemId,g=t.theme,d=t.keyPrefix,f=null===u?d:d+"section-"+u+"-",h="function"==typeof o;return c.default.createElement("ul",s({role:"listbox"},g(f+"items-list","itemsList")),n.map(function(t,n){var d=0===n,m=n===a,y=f+"item-"+n,v=h?o({sectionIndex:u,itemIndex:n}):o,I=s({id:l(u,n)},g(y,"item",d&&"itemFirst",m&&"itemHighlighted"),v);return m&&(I.ref=e.storeHighlightedItemReference),c.default.createElement(p.default,s({},I,{sectionIndex:u,itemIndex:n,item:t,renderItem:r,renderItemData:i}))}))}}]),t}(l.Component);h.propTypes={items:l.PropTypes.array.isRequired,itemProps:l.PropTypes.oneOfType([l.PropTypes.object,l.PropTypes.func]),renderItem:l.PropTypes.func.isRequired,renderItemData:l.PropTypes.object.isRequired,sectionIndex:l.PropTypes.number,highlightedItemIndex:l.PropTypes.number,onHighlightedItemChange:l.PropTypes.func.isRequired,getItemId:l.PropTypes.func.isRequired,theme:l.PropTypes.func.isRequired,keyPrefix:l.PropTypes.string.isRequired},h.defaultProps={sectionIndex:null},t.default=h},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),c=n(2),g=o(c),p=n(10),d=o(p),f=function(e){function t(){var e,n,o,r;i(this,t);for(var s=arguments.length,a=Array(s),l=0;l<s;l++)a[l]=arguments[l];return n=o=u(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),o.storeItemReference=function(e){null!==e&&(o.item=e)},o.onMouseEnter=function(e){var t=o.props,n=t.sectionIndex,r=t.itemIndex;o.props.onMouseEnter(e,{sectionIndex:n,itemIndex:r})},o.onMouseLeave=function(e){var t=o.props,n=t.sectionIndex,r=t.itemIndex;o.props.onMouseLeave(e,{sectionIndex:n,itemIndex:r})},o.onMouseDown=function(e){var t=o.props,n=t.sectionIndex,r=t.itemIndex;o.props.onMouseDown(e,{sectionIndex:n,itemIndex:r})},o.onClick=function(e){var t=o.props,n=t.sectionIndex,r=t.itemIndex;o.props.onClick(e,{sectionIndex:n,itemIndex:r})},r=n,u(o,r)}return s(t,e),l(t,[{key:"shouldComponentUpdate",value:function(e){return(0,d.default)(e,this.props,["renderItemData"])}},{key:"render",value:function(){var e=this.props,t=e.item,n=e.renderItem,o=e.renderItemData,i=r(e,["item","renderItem","renderItemData"]);return delete i.sectionIndex,delete i.itemIndex,"function"==typeof i.onMouseEnter&&(i.onMouseEnter=this.onMouseEnter),"function"==typeof i.onMouseLeave&&(i.onMouseLeave=this.onMouseLeave),"function"==typeof i.onMouseDown&&(i.onMouseDown=this.onMouseDown),"function"==typeof i.onClick&&(i.onClick=this.onClick),g.default.createElement("li",a({role:"option"},i,{ref:this.storeItemReference}),n(t,o))}}]),t}(c.Component);f.propTypes={sectionIndex:c.PropTypes.number,itemIndex:c.PropTypes.number.isRequired,item:c.PropTypes.any.isRequired,renderItem:c.PropTypes.func.isRequired,renderItemData:c.PropTypes.object.isRequired,onMouseEnter:c.PropTypes.func,onMouseLeave:c.PropTypes.func,onMouseDown:c.PropTypes.func,onClick:c.PropTypes.func},t.default=f},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.defaultTheme={container:"react-autosuggest__container",containerOpen:"react-autosuggest__container--open",input:"react-autosuggest__input",inputOpen:"react-autosuggest__input--open",inputFocused:"react-autosuggest__input--focused",suggestionsContainer:"react-autosuggest__suggestions-container",suggestionsContainerOpen:"react-autosuggest__suggestions-container--open",suggestionsList:"react-autosuggest__suggestions-list",suggestion:"react-autosuggest__suggestion",suggestionFirst:"react-autosuggest__suggestion--first",suggestionHighlighted:"react-autosuggest__suggestion--highlighted",sectionContainer:"react-autosuggest__section-container",sectionContainerFirst:"react-autosuggest__section-container--first",sectionTitle:"react-autosuggest__section-title"},t.mapToAutowhateverTheme=function(e){var t={};for(var n in e)switch(n){case"suggestionsContainer":t.itemsContainer=e[n];break;case"suggestionsContainerOpen":t.itemsContainerOpen=e[n];break;case"suggestion":t.item=e[n];break;case"suggestionFirst":t.itemFirst=e[n];break;case"suggestionHighlighted":t.itemHighlighted=e[n];break;case"suggestionsList":t.itemsList=e[n];break;default:t[n]=e[n]}return t}}])});
{
"name": "react-autosuggest",
"version": "8.0.1",
"version": "9.0.0",
"description": "WAI-ARIA compliant React autosuggest component",

@@ -26,10 +26,10 @@ "main": "dist/index.js",

"dependencies": {
"react-autowhatever": "^7.0.0",
"react-autowhatever": "^9.1.0",
"shallow-equal": "^1.0.0"
},
"peerDependencies": {
"react": "^0.14.7 || ^15.0.1"
"react": ">=0.14.7 || >=16.0.0-alpha.2"
},
"devDependencies": {
"autoprefixer": "^6.7.3",
"autoprefixer": "^6.7.5",
"autosuggest-highlight": "^3.1.0",

@@ -48,8 +48,8 @@ "babel-cli": "^6.23.0",

"cross-env": "^3.1.4",
"css-loader": "^0.26.1",
"css-loader": "^0.26.2",
"es6-promise": "^4.0.5",
"eslint": "^3.15.0",
"eslint": "^3.16.1",
"eslint-plugin-react": "6.10.0",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.10.0",
"file-loader": "^0.10.1",
"ismobilejs": "^0.4.0",

@@ -63,6 +63,6 @@ "isomorphic-fetch": "^2.2.1",

"openurl": "^1.1.1",
"postcss-loader": "^1.3.0",
"react": "^15.4.2",
"react-addons-test-utils": "^15.4.2",
"react-dom": "^15.4.2",
"postcss-loader": "^1.3.2",
"react": "^16.0.0-alpha.2",
"react-addons-test-utils": "^16.0.0-alpha.2",
"react-dom": "^16.0.0-alpha.2",
"react-modal": "^1.6.5",

@@ -72,6 +72,6 @@ "react-transform-hmr": "^1.0.4",

"sinon-chai": "^2.8.0",
"style-loader": "^0.13.1",
"style-loader": "^0.13.2",
"svgo": "^0.7.2",
"svgo-loader": "^1.1.2",
"url-loader": "^0.5.7",
"url-loader": "^0.5.8",
"webpack": "^1.14.0",

@@ -78,0 +78,0 @@ "webpack-dev-server": "^1.16.2"

@@ -22,4 +22,4 @@ [![Build Status](https://img.shields.io/codeship/41810250-aa07-0132-fbf4-4e62e8945e03/master.svg?style=flat-square)](https://codeship.com/projects/67868)

* Suggestions can be retrieved [asynchronously](http://codepen.io/moroshko/pen/EPZpev)
* [Focus the first suggestion](#focusFirstSuggestionProp) in the list if you wish
* Supports styling using [CSS Modules](https://github.com/css-modules/css-modules), [Radium](https://github.com/FormidableLabs/radium), [Inline styles](https://facebook.github.io/react/tips/inline-styles.html), global CSS, [and more](#themeProp)
* [Highlight the first suggestion](#highlightFirstSuggestionProp) in the list if you wish
* Supports styling using [CSS Modules](https://github.com/css-modules/css-modules), [Radium](https://github.com/FormidableLabs/radium), [Aphrodite](https://github.com/Khan/aphrodite), [JSS](https://github.com/cssinjs/jss), [and more](#themeProp)
* You decide [when to show suggestions](#shouldRenderSuggestionsProp) (e.g. when user types 2 or more characters)

@@ -156,3 +156,3 @@ * [Always render suggestions](#alwaysRenderSuggestionsProp) (useful for mobile and modals)

| [`alwaysRenderSuggestions`](#alwaysRenderSuggestionsProp) | Boolean | | Set it to `true` if you'd like to render suggestions even when the input element is not focused. |
| [`focusFirstSuggestion`](#focusFirstSuggestionProp) | Boolean | | Set it to `true` if you'd like Autosuggest to automatically highlight the first suggestion. |
| [`highlightFirstSuggestion`](#highlightFirstSuggestionProp) | Boolean | | Set it to `true` if you'd like Autosuggest to automatically highlight the first suggestion. |
| [`focusInputOnSuggestionClick`](#focusInputOnSuggestionClickProp) | Boolean | | Set it to `false` if you don't want Autosuggest to keep the input element focused when suggestions are clicked/tapped. |

@@ -172,3 +172,3 @@ | [`multiSection`](#multiSectionProp) | Boolean | | Set it to `true` if you'd like to display suggestions in multiple sections (with optional titles). |

For a plain list of suggestions, every item in `suggestions` should be a single suggestion. It's up to you what shape every suggestion takes. For example:
For a plain list of suggestions, every item in `suggestions` represents a single suggestion. It's up to you what shape every suggestion takes. For example:

@@ -195,3 +195,3 @@ ```js

To display [multiple sections](#multiSectionProp), every item in `suggestions` should be a single section. Again, it's up to you what shape every section takes. For example:
For [multiple sections](#multiSectionProp), every item in `suggestions` represents a single section. Again, it's up to you what shape every section takes. For example:

@@ -299,3 +299,3 @@ ```js

Autosuggest is a [controlled component](https://facebook.github.io/react/docs/forms.html#controlled-components). Therefore, you should pass at least a `value` and an `onChange` callback to the input element. You can pass any other props as well. For example:
Autosuggest is a [controlled component](https://facebook.github.io/react/docs/forms.html#controlled-components). Therefore, you MUST pass at least a `value` and an `onChange` callback to the input element. You can pass any other props as well. For example:

@@ -338,3 +338,3 @@ ```js

```js
function onBlur(event, { focusedSuggestion })
function onBlur(event, { highlightedSuggestion })
```

@@ -344,3 +344,3 @@

* `focusedSuggestion` - the suggestion that was highlighted just before the input element lost focus, or `null` if there was no highlighted suggestion.
* `highlightedSuggestion` - the suggestion that was highlighted just before the input element lost focus, or `null` if there was no highlighted suggestion.

@@ -398,6 +398,6 @@ <a name="onSuggestionSelectedProp"></a>

<a name="focusFirstSuggestionProp"></a>
#### focusFirstSuggestion (optional)
<a name="highlightFirstSuggestionProp"></a>
#### highlightFirstSuggestion (optional)
When `focusFirstSuggestion={true}`, Autosuggest will automatically highlight the first suggestion. Defaults to `false`.
When `highlightFirstSuggestion={true}`, Autosuggest will automatically highlight the first suggestion. Defaults to `false`.

@@ -463,3 +463,3 @@ <a name="focusInputOnSuggestionClickProp"></a>

To keep Autosuggest [accessible](https://www.w3.org/TR/wai-aria-practices/#autocomplete), `renderInputComponent` should:
To keep Autosuggest [accessible](https://www.w3.org/TR/wai-aria-practices/#autocomplete), `renderInputComponent` MUST:

@@ -486,3 +486,3 @@ * render an input element

You shouldn't specify `renderSuggestionsContainer` unless you want to customize the content or behaviour of the suggestions container beyond rendering the suggestions themselves. For example, you might want to add a custom text before/after the suggestions list, or [customize the scrolling behaviour of the suggestions container](https://github.com/moroshko/react-autosuggest/blob/master/FAQ.md#limitSuggestionsContainerScrolling).
You shouldn't specify `renderSuggestionsContainer` unless you want to customize the content or behaviour of the suggestions container beyond rendering the suggestions themselves. For example, you might want to add a custom text before/after the suggestions list, or to [customize the scrolling behaviour of the suggestions container](https://github.com/moroshko/react-autosuggest/blob/master/FAQ.md#limitSuggestionsContainerScrolling).

@@ -492,20 +492,21 @@ The signature is:

```js
function renderSuggestionsContainer(props)
function renderSuggestionsContainer({ containerProps, children, query })
```
You should pass all the `props` to the topmost element that is returned from `renderSuggestionsContainer` with the following exceptions:
where:
* `children` - these are the suggestions themselves. It's up to you where to render them.
* `ref` - when `renderSuggestionsContainer` returns a composite component (e.g. `<IsolatedScroll ... />` as opposed to a DOM node like `<div ... />`), you should call `ref` with the topmost element that the composite component renders.
* `containerProps` - props that you MUST pass to the topmost element that is returned from `renderSuggestionsContainer`.
* `children` - the suggestions themselves. It's up to you where to render them.
* `query` - Same as `query` in [`renderSuggestion`](#renderSuggestionProp).
Example:
For example:
```js
function renderSuggestionsContainer({ children, ...rest }) {
function renderSuggestionsContainer({ containerProps , children, query }) {
return (
<div {...rest}>
<p>
Some text
</p>
<div {... containerProps}>
{children}
<div>
Press Enter to search <strong>{query}</strong>
</div>
</div>

@@ -516,7 +517,11 @@ );

When `renderSuggestionsContainer` returns a composite component (e.g. `<IsolatedScroll ... />` as opposed to a DOM node like `<div ... />`), you MUST call `containerProps.ref` with the topmost element that the composite component renders.
For example:
```js
import IsolatedScroll from 'react-isolated-scroll';
function renderSuggestionsContainer({ ref, ...rest }) {
function renderSuggestionsContainer({ containerProps, children }) {
const { ref, ...restContainerProps } = containerProps;
const callRef = isolatedScroll => {

@@ -529,3 +534,5 @@ if (isolatedScroll !== null) {

return (
<IsolatedScroll {...rest} ref={callRef} />
<IsolatedScroll ref={callRef} {...restContainerProps}>
{children}
</IsolatedScroll>
);

@@ -540,3 +547,3 @@ }

It uses [react-themeable](https://github.com/markdalgleish/react-themeable) to allow you to style your Autosuggest component using [CSS Modules](https://github.com/css-modules/css-modules), [Radium](https://github.com/FormidableLabs/radium), [React Style](https://github.com/js-next/react-style), [JSS](https://github.com/jsstyles/jss), [Inline styles](https://facebook.github.io/react/tips/inline-styles.html), or even global CSS.
It uses [react-themeable](https://github.com/markdalgleish/react-themeable) that allows you to style your Autosuggest component using [CSS Modules](https://github.com/css-modules/css-modules), [Radium](https://github.com/FormidableLabs/radium), [Aphrodite](https://github.com/Khan/aphrodite), [JSS](https://github.com/cssinjs/jss), [Inline styles](https://facebook.github.io/react/docs/dom-elements.html#style), and global CSS.

@@ -552,3 +559,3 @@ For example, to style the Autosuggest using CSS Modules, do:

.suggestion { ... }
.suggestionFocused { ... }
.suggestionHighlighted { ... }
...

@@ -568,11 +575,16 @@ ```

{
container: 'react-autosuggest__container',
containerOpen: 'react-autosuggest__container--open',
input: 'react-autosuggest__input',
suggestionsContainer: 'react-autosuggest__suggestions-container',
suggestionsList: 'react-autosuggest__suggestions-list',
suggestion: 'react-autosuggest__suggestion',
suggestionFocused: 'react-autosuggest__suggestion--focused',
sectionContainer: 'react-autosuggest__section-container',
sectionTitle: 'react-autosuggest__section-title'
container: 'react-autosuggest__container',
containerOpen: 'react-autosuggest__container--open',
input: 'react-autosuggest__input',
inputOpen: 'react-autosuggest__input--open',
inputFocused: 'react-autosuggest__input--focused',
suggestionsContainer: 'react-autosuggest__suggestions-container',
suggestionsContainerOpen: 'react-autosuggest__suggestions-container--open',
suggestionsList: 'react-autosuggest__suggestions-list',
suggestion: 'react-autosuggest__suggestion',
suggestionFirst: 'react-autosuggest__suggestion--first',
suggestionHighlighted: 'react-autosuggest__suggestion--highlighted',
sectionContainer: 'react-autosuggest__section-container',
sectionContainerFirst: 'react-autosuggest__section-container--first',
sectionTitle: 'react-autosuggest__section-title'
}

@@ -579,0 +591,0 @@ ```

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc