Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More β†’
Socket
Sign inDemoInstall
Socket

downshift

Package Overview
Dependencies
Maintainers
1
Versions
354
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

downshift - npm Package Compare versions

Comparing version 1.16.4 to 1.17.0

56

dist/downshift.cjs.js

@@ -795,2 +795,3 @@ 'use strict';

this.getRootProps.refKey = undefined;
this.getRootProps.suppressRefError = undefined;
// we do something similar for getLabelProps

@@ -805,3 +806,5 @@ this.getLabelProps.called = false;

if (this.getRootProps.called) {
validateGetRootPropsCalledCorrectly(element, this.getRootProps);
if (!this.getRootProps.suppressRefError) {
validateGetRootPropsCalledCorrectly(element, this.getRootProps);
}
return element;

@@ -999,2 +1002,6 @@ } else if (isDOMElement(element)) {

var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref4$suppressRefErro = _ref4.suppressRefError,
suppressRefError = _ref4$suppressRefErro === undefined ? false : _ref4$suppressRefErro;
var _ref3$refKey = _ref3.refKey,

@@ -1008,2 +1015,3 @@ refKey = _ref3$refKey === undefined ? 'ref' : _ref3$refKey,

_this5.getRootProps.refKey = refKey;
_this5.getRootProps.suppressRefError = suppressRefError;
return _extends(defineProperty({}, refKey, _this5.rootRef), rest);

@@ -1048,7 +1056,7 @@ };

this.getButtonProps = function () {
var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var onClick = _ref4.onClick,
onKeyDown = _ref4.onKeyDown,
rest = objectWithoutProperties(_ref4, ['onClick', 'onKeyDown']);
var onClick = _ref5.onClick,
onKeyDown = _ref5.onKeyDown,
rest = objectWithoutProperties(_ref5, ['onClick', 'onKeyDown']);

@@ -1095,11 +1103,11 @@ var _getState3 = _this5.getState(),

this.getInputProps = function () {
var _ref6;
var _ref7;
var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var onKeyDown = _ref5.onKeyDown,
onBlur = _ref5.onBlur,
onChange = _ref5.onChange,
onInput = _ref5.onInput,
rest = objectWithoutProperties(_ref5, ['onKeyDown', 'onBlur', 'onChange', 'onInput']);
var onKeyDown = _ref6.onKeyDown,
onBlur = _ref6.onBlur,
onChange = _ref6.onChange,
onInput = _ref6.onInput,
rest = objectWithoutProperties(_ref6, ['onKeyDown', 'onBlur', 'onChange', 'onInput']);

@@ -1122,3 +1130,3 @@ _this5.getInputProps.called = true;

var eventHandlers = rest.disabled ? {} : (_ref6 = {}, defineProperty(_ref6, onChangeKey, composeEventHandlers(onChange, onInput, _this5.input_handleChange)), defineProperty(_ref6, 'onKeyDown', composeEventHandlers(onKeyDown, _this5.input_handleKeyDown)), defineProperty(_ref6, 'onBlur', composeEventHandlers(onBlur, _this5.input_handleBlur)), _ref6);
var eventHandlers = rest.disabled ? {} : (_ref7 = {}, defineProperty(_ref7, onChangeKey, composeEventHandlers(onChange, onInput, _this5.input_handleChange)), defineProperty(_ref7, 'onKeyDown', composeEventHandlers(onKeyDown, _this5.input_handleKeyDown)), defineProperty(_ref7, 'onBlur', composeEventHandlers(onBlur, _this5.input_handleBlur)), _ref7);
return _extends({

@@ -1157,10 +1165,10 @@ role: 'combobox',

this.getItemProps = function () {
var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref8 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var onMouseEnter = _ref7.onMouseEnter,
onClick = _ref7.onClick,
index = _ref7.index,
_ref7$item = _ref7.item,
item = _ref7$item === undefined ? requiredProp('getItemProps', 'item') : _ref7$item,
rest = objectWithoutProperties(_ref7, ['onMouseEnter', 'onClick', 'index', 'item']);
var onMouseEnter = _ref8.onMouseEnter,
onClick = _ref8.onClick,
index = _ref8.index,
_ref8$item = _ref8.item,
item = _ref8$item === undefined ? requiredProp('getItemProps', 'item') : _ref8$item,
rest = objectWithoutProperties(_ref8, ['onMouseEnter', 'onClick', 'index', 'item']);

@@ -1195,4 +1203,4 @@ if (index === undefined) {

otherStateToSet = pickState(otherStateToSet);
_this5.internalSetState(function (_ref8) {
var selectedItem = _ref8.selectedItem;
_this5.internalSetState(function (_ref9) {
var selectedItem = _ref9.selectedItem;
return _extends({

@@ -1211,4 +1219,4 @@ isOpen: false,

otherStateToSet = pickState(otherStateToSet);
_this5.internalSetState(function (_ref9) {
var isOpen = _ref9.isOpen;
_this5.internalSetState(function (_ref10) {
var isOpen = _ref10.isOpen;

@@ -1215,0 +1223,0 @@ return _extends({ isOpen: !isOpen }, otherStateToSet);

@@ -790,2 +790,3 @@ import React, { Component } from 'react';

this.getRootProps.refKey = undefined;
this.getRootProps.suppressRefError = undefined;
// we do something similar for getLabelProps

@@ -800,3 +801,5 @@ this.getLabelProps.called = false;

if (this.getRootProps.called) {
validateGetRootPropsCalledCorrectly(element, this.getRootProps);
if (!this.getRootProps.suppressRefError) {
validateGetRootPropsCalledCorrectly(element, this.getRootProps);
}
return element;

@@ -994,2 +997,6 @@ } else if (isDOMElement(element)) {

var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref4$suppressRefErro = _ref4.suppressRefError,
suppressRefError = _ref4$suppressRefErro === undefined ? false : _ref4$suppressRefErro;
var _ref3$refKey = _ref3.refKey,

@@ -1003,2 +1010,3 @@ refKey = _ref3$refKey === undefined ? 'ref' : _ref3$refKey,

_this5.getRootProps.refKey = refKey;
_this5.getRootProps.suppressRefError = suppressRefError;
return _extends(defineProperty({}, refKey, _this5.rootRef), rest);

@@ -1043,7 +1051,7 @@ };

this.getButtonProps = function () {
var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var onClick = _ref4.onClick,
onKeyDown = _ref4.onKeyDown,
rest = objectWithoutProperties(_ref4, ['onClick', 'onKeyDown']);
var onClick = _ref5.onClick,
onKeyDown = _ref5.onKeyDown,
rest = objectWithoutProperties(_ref5, ['onClick', 'onKeyDown']);

@@ -1090,11 +1098,11 @@ var _getState3 = _this5.getState(),

this.getInputProps = function () {
var _ref6;
var _ref7;
var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var onKeyDown = _ref5.onKeyDown,
onBlur = _ref5.onBlur,
onChange = _ref5.onChange,
onInput = _ref5.onInput,
rest = objectWithoutProperties(_ref5, ['onKeyDown', 'onBlur', 'onChange', 'onInput']);
var onKeyDown = _ref6.onKeyDown,
onBlur = _ref6.onBlur,
onChange = _ref6.onChange,
onInput = _ref6.onInput,
rest = objectWithoutProperties(_ref6, ['onKeyDown', 'onBlur', 'onChange', 'onInput']);

@@ -1117,3 +1125,3 @@ _this5.getInputProps.called = true;

var eventHandlers = rest.disabled ? {} : (_ref6 = {}, defineProperty(_ref6, onChangeKey, composeEventHandlers(onChange, onInput, _this5.input_handleChange)), defineProperty(_ref6, 'onKeyDown', composeEventHandlers(onKeyDown, _this5.input_handleKeyDown)), defineProperty(_ref6, 'onBlur', composeEventHandlers(onBlur, _this5.input_handleBlur)), _ref6);
var eventHandlers = rest.disabled ? {} : (_ref7 = {}, defineProperty(_ref7, onChangeKey, composeEventHandlers(onChange, onInput, _this5.input_handleChange)), defineProperty(_ref7, 'onKeyDown', composeEventHandlers(onKeyDown, _this5.input_handleKeyDown)), defineProperty(_ref7, 'onBlur', composeEventHandlers(onBlur, _this5.input_handleBlur)), _ref7);
return _extends({

@@ -1152,10 +1160,10 @@ role: 'combobox',

this.getItemProps = function () {
var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref8 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var onMouseEnter = _ref7.onMouseEnter,
onClick = _ref7.onClick,
index = _ref7.index,
_ref7$item = _ref7.item,
item = _ref7$item === undefined ? requiredProp('getItemProps', 'item') : _ref7$item,
rest = objectWithoutProperties(_ref7, ['onMouseEnter', 'onClick', 'index', 'item']);
var onMouseEnter = _ref8.onMouseEnter,
onClick = _ref8.onClick,
index = _ref8.index,
_ref8$item = _ref8.item,
item = _ref8$item === undefined ? requiredProp('getItemProps', 'item') : _ref8$item,
rest = objectWithoutProperties(_ref8, ['onMouseEnter', 'onClick', 'index', 'item']);

@@ -1190,4 +1198,4 @@ if (index === undefined) {

otherStateToSet = pickState(otherStateToSet);
_this5.internalSetState(function (_ref8) {
var selectedItem = _ref8.selectedItem;
_this5.internalSetState(function (_ref9) {
var selectedItem = _ref9.selectedItem;
return _extends({

@@ -1206,4 +1214,4 @@ isOpen: false,

otherStateToSet = pickState(otherStateToSet);
_this5.internalSetState(function (_ref9) {
var isOpen = _ref9.isOpen;
_this5.internalSetState(function (_ref10) {
var isOpen = _ref10.isOpen;

@@ -1210,0 +1218,0 @@ return _extends({ isOpen: !isOpen }, otherStateToSet);

@@ -796,2 +796,3 @@ (function (global, factory) {

this.getRootProps.refKey = undefined;
this.getRootProps.suppressRefError = undefined;
// we do something similar for getLabelProps

@@ -806,3 +807,5 @@ this.getLabelProps.called = false;

if (this.getRootProps.called) {
validateGetRootPropsCalledCorrectly(element, this.getRootProps);
if (!this.getRootProps.suppressRefError) {
validateGetRootPropsCalledCorrectly(element, this.getRootProps);
}
return element;

@@ -1000,2 +1003,6 @@ } else if (isDOMElement(element)) {

var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref4$suppressRefErro = _ref4.suppressRefError,
suppressRefError = _ref4$suppressRefErro === undefined ? false : _ref4$suppressRefErro;
var _ref3$refKey = _ref3.refKey,

@@ -1009,2 +1016,3 @@ refKey = _ref3$refKey === undefined ? 'ref' : _ref3$refKey,

_this5.getRootProps.refKey = refKey;
_this5.getRootProps.suppressRefError = suppressRefError;
return _extends(defineProperty({}, refKey, _this5.rootRef), rest);

@@ -1049,7 +1057,7 @@ };

this.getButtonProps = function () {
var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var onClick = _ref4.onClick,
onKeyDown = _ref4.onKeyDown,
rest = objectWithoutProperties(_ref4, ['onClick', 'onKeyDown']);
var onClick = _ref5.onClick,
onKeyDown = _ref5.onKeyDown,
rest = objectWithoutProperties(_ref5, ['onClick', 'onKeyDown']);

@@ -1096,11 +1104,11 @@ var _getState3 = _this5.getState(),

this.getInputProps = function () {
var _ref6;
var _ref7;
var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var onKeyDown = _ref5.onKeyDown,
onBlur = _ref5.onBlur,
onChange = _ref5.onChange,
onInput = _ref5.onInput,
rest = objectWithoutProperties(_ref5, ['onKeyDown', 'onBlur', 'onChange', 'onInput']);
var onKeyDown = _ref6.onKeyDown,
onBlur = _ref6.onBlur,
onChange = _ref6.onChange,
onInput = _ref6.onInput,
rest = objectWithoutProperties(_ref6, ['onKeyDown', 'onBlur', 'onChange', 'onInput']);

@@ -1123,3 +1131,3 @@ _this5.getInputProps.called = true;

var eventHandlers = rest.disabled ? {} : (_ref6 = {}, defineProperty(_ref6, onChangeKey, composeEventHandlers(onChange, onInput, _this5.input_handleChange)), defineProperty(_ref6, 'onKeyDown', composeEventHandlers(onKeyDown, _this5.input_handleKeyDown)), defineProperty(_ref6, 'onBlur', composeEventHandlers(onBlur, _this5.input_handleBlur)), _ref6);
var eventHandlers = rest.disabled ? {} : (_ref7 = {}, defineProperty(_ref7, onChangeKey, composeEventHandlers(onChange, onInput, _this5.input_handleChange)), defineProperty(_ref7, 'onKeyDown', composeEventHandlers(onKeyDown, _this5.input_handleKeyDown)), defineProperty(_ref7, 'onBlur', composeEventHandlers(onBlur, _this5.input_handleBlur)), _ref7);
return _extends({

@@ -1158,10 +1166,10 @@ role: 'combobox',

this.getItemProps = function () {
var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref8 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var onMouseEnter = _ref7.onMouseEnter,
onClick = _ref7.onClick,
index = _ref7.index,
_ref7$item = _ref7.item,
item = _ref7$item === undefined ? requiredProp('getItemProps', 'item') : _ref7$item,
rest = objectWithoutProperties(_ref7, ['onMouseEnter', 'onClick', 'index', 'item']);
var onMouseEnter = _ref8.onMouseEnter,
onClick = _ref8.onClick,
index = _ref8.index,
_ref8$item = _ref8.item,
item = _ref8$item === undefined ? requiredProp('getItemProps', 'item') : _ref8$item,
rest = objectWithoutProperties(_ref8, ['onMouseEnter', 'onClick', 'index', 'item']);

@@ -1196,4 +1204,4 @@ if (index === undefined) {

otherStateToSet = pickState(otherStateToSet);
_this5.internalSetState(function (_ref8) {
var selectedItem = _ref8.selectedItem;
_this5.internalSetState(function (_ref9) {
var selectedItem = _ref9.selectedItem;
return _extends({

@@ -1212,4 +1220,4 @@ isOpen: false,

otherStateToSet = pickState(otherStateToSet);
_this5.internalSetState(function (_ref9) {
var isOpen = _ref9.isOpen;
_this5.internalSetState(function (_ref10) {
var isOpen = _ref10.isOpen;

@@ -1216,0 +1224,0 @@ return _extends({ isOpen: !isOpen }, otherStateToSet);

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("prop-types")):"function"==typeof define&&define.amd?define(["react","prop-types"],t):e.Downshift=t(e.React,e.PropTypes)}(this,function(e,t){"use strict";function n(e){return"function"==typeof e?e:o}function o(){}function i(e,t,n){return null!==t&&t!==n.parentNode?e(t)?t===document.body&&0===t.scrollTop?document.documentElement:t:i(e,t.parentNode,n):null}function r(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,o=Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return t.some(function(t){return t&&t.apply(void 0,[e].concat(o)),e.defaultPrevented})}}function u(e){return e+"-"+b++}function s(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.find(function(e){return void 0!==e})}function l(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}function a(e){return e.nodeName?"string"==typeof e.nodeName:"string"==typeof e.type}function p(e){return e.props||e.attributes}function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return C.forEach(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])}),t}var h="default"in e?e.default:e;t=t&&t.hasOwnProperty("default")?t.default:t;var c=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},f=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}}(),g=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},m=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},y=function(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},v=function(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},I=function(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)},_="undefined"==typeof document?null:document.getElementById("a11y-status-message"),w=[],b=1,S=i.bind(null,function(e){return e.scrollHeight>e.clientHeight}),C=["highlightedIndex","inputValue","isOpen","selectedItem","type"],k=function(t){function i(){var e;c(this,i);for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];var r=v(this,(e=i.__proto__||Object.getPrototypeOf(i)).call.apply(e,[this].concat(n)));x.call(r);var u=r.getState({highlightedIndex:r.props.defaultHighlightedIndex,isOpen:r.props.defaultIsOpen,inputValue:r.props.defaultInputValue,selectedItem:r.props.defaultSelectedItem});return u.selectedItem&&(u.inputValue=r.props.itemToString(u.selectedItem)),r.state=u,r}return function(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)}(i,e.Component),f(i,[{key:"getState",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state;return Object.keys(t).reduce(function(n,o){return n[o]=e.isControlledProp(o)?e.props[o]:t[o],n},{})}},{key:"isControlledProp",value:function(e){return void 0!==this.props[e]}},{key:"getItemCount",value:function(){return void 0===this.props.itemCount?this.items.length:this.props.itemCount}},{key:"internalSetState",value:function(e,t){var o=this,r=void 0,u=void 0,s={},l="function"==typeof e;return!l&&e.hasOwnProperty("inputValue")&&this.props.onInputValueChange(e.inputValue,m({},this.getStateAndHelpers(),e)),this.setState(function(t){t=o.getState(t),e=l?e(t):e;var n={},a={};return(r=e.hasOwnProperty("selectedItem"))&&e.selectedItem!==t.selectedItem&&(u=e.selectedItem),e.type=e.type||i.stateChangeTypes.unknown,Object.keys(e).forEach(function(i){t[i]!==e[i]&&(s[i]=e[i]),"type"!==i&&(a[i]=e[i],o.isControlledProp(i)||(n[i]=e[i]))}),l&&e.hasOwnProperty("inputValue")&&o.props.onInputValueChange(e.inputValue,m({},o.getStateAndHelpers(),e)),n},function(){n(t)();Object.keys(s).length>1&&o.props.onStateChange(s,o.getStateAndHelpers()),r&&o.props.onSelect(e.selectedItem,o.getStateAndHelpers()),void 0!==u&&o.props.onChange(u,o.getStateAndHelpers()),o.props.onUserAction(s,o.getStateAndHelpers())})}},{key:"getStateAndHelpers",value:function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,o=e.selectedItem,i=e.isOpen,r=this.props,u=r.id,s=r.itemToString,l=this.getRootProps,a=this.getButtonProps,p=this.getLabelProps,d=this.getInputProps,h=this.getItemProps,c=this.openMenu,f=this.closeMenu,g=this.toggleMenu,m=this.selectItem,y=this.selectItemAtIndex,v=this.selectHighlightedItem,I=this.setHighlightedIndex,_=this.clearSelection,w=this.clearItems;return{getRootProps:l,getButtonProps:a,getLabelProps:p,getInputProps:d,getItemProps:h,reset:this.reset,openMenu:c,closeMenu:f,toggleMenu:g,selectItem:m,selectItemAtIndex:y,selectHighlightedItem:v,setHighlightedIndex:I,clearSelection:_,clearItems:w,itemToString:s,id:u,highlightedIndex:t,inputValue:n,isOpen:i,selectedItem:o}}},{key:"getItemId",value:function(e){return this.props.id+"-item-"+e}},{key:"componentDidMount",value:function(){var e=this;this._isMounted=!0;var t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,t.target!==e._rootNode&&e._rootNode.contains(t.target)||!e.getState().isOpen||e.reset({type:i.stateChangeTypes.mouseUp},function(){return e.props.onOuterClick(e.getStateAndHelpers())})};this.props.environment.addEventListener("mousedown",t),this.props.environment.addEventListener("mouseup",n),this.cleanup=function(){e._isMounted=!1,e.props.environment.removeEventListener("mousedown",t),e.props.environment.removeEventListener("mouseup",n)}}},{key:"componentDidUpdate",value:function(e){this.isControlledProp("selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:i.stateChangeTypes.controlledPropUpdatedSelectedItem,inputValue:this.props.itemToString(this.props.selectedItem)}),this.updateStatus()}},{key:"componentWillUnmount",value:function(){this.cleanup()}},{key:"render",value:function(){var e=l(this.props.children,o);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var t=l(e(this.getStateAndHelpers()));if(!t)return null;if(this.getRootProps.called)return function(e,t){var n=t.refKey,o="ref"!==n,i=!a(e);if(i&&!o)throw new Error("downshift: You returned a non-DOM element. You must specify a refKey in getRootProps");if(!i&&o)throw new Error('downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified "'+n+'"');if(!p(e).hasOwnProperty(n))throw new Error('downshift: You must apply the ref prop "'+n+'" from getRootProps onto your root element.')}(t,this.getRootProps),t;if(a(t))return h.cloneElement(t,this.getRootProps(p(t)));throw new Error("downshift: If you return a non-DOM element, you must use apply the getRootProps function")}}]),i}();k.propTypes={children:t.func,defaultHighlightedIndex:t.number,defaultSelectedItem:t.any,defaultInputValue:t.string,defaultIsOpen:t.bool,getA11yStatusMessage:t.func,itemToString:t.func,onChange:t.func,onSelect:t.func,onStateChange:t.func,onInputValueChange:t.func,onUserAction:t.func,onClick:t.func,onOuterClick:t.func,selectedItemChanged:t.func,itemCount:t.number,id:t.string,environment:t.shape({addEventListener:t.func,removeEventListener:t.func,document:t.shape({getElementById:t.func})}),selectedItem:t.any,isOpen:t.bool,inputValue:t.string,highlightedIndex:t.number},k.defaultProps={defaultHighlightedIndex:null,defaultSelectedItem:null,defaultInputValue:"",defaultIsOpen:!1,getA11yStatusMessage:function(e){var t=e.isOpen,n=e.highlightedItem,o=e.selectedItem,i=e.resultCount,r=e.previousResultCount,u=e.itemToString;return t?i?n&&i===r?u(n):i+" "+(1===i?"result is":"results are")+" available, use up and down arrow keys to navigate.":"No results.":o?u(o):""},id:u("downshift"),itemToString:function(e){return null==e?"":String(e)},onStateChange:function(){},onInputValueChange:function(){},onUserAction:function(){},onChange:function(){},onSelect:function(){},onOuterClick:function(){},selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window},k.stateChangeTypes={unknown:"__autocomplete_unknown__",mouseUp:"__autocomplete_mouseup__",itemMouseEnter:"__autocomplete_item_mouseenter__",keyDownArrowUp:"__autocomplete_keydown_arrow_up__",keyDownArrowDown:"__autocomplete_keydown_arrow_down__",keyDownEscape:"__autocomplete_keydown_escape__",keyDownEnter:"__autocomplete_keydown_enter__",blurInput:"__autocomplete_blur_input__",changeInput:"__autocomplete_change_input__",keyDownSpaceButton:"__autocomplete_keydown_space_button__",clickButton:"__autocomplete_click_button__",controlledPropUpdatedSelectedItem:"__autocomplete_controlled_prop_updated_selected_item__"};var x=function(){var e=this;this.root_handleClick=r(this.props.onClick,this.root_handleClick),this.input=null,this.items=[],this.previousResultCount=0,this.getItemNodeFromIndex=function(t){return e.props.environment.document.getElementById(e.getItemId(t))},this.setHighlightedIndex=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.props.defaultHighlightedIndex,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n=d(n),e.internalSetState(m({highlightedIndex:t},n),function(){!function(e,t){var n=S(e,t);if(null!==n){var o=getComputedStyle(n),i=n.getBoundingClientRect(),r=parseInt(o.borderTopWidth,10),u=r+parseInt(o.borderBottomWidth,10),s=i.top+r,l=e.getBoundingClientRect();if(l.top<0)n.scrollTop+=l.top;else if(l.top>0&&i.top<0)i.bottom>0&&l.bottom+u>i.bottom&&(n.scrollTop+=l.bottom-i.bottom+u);else{var a=l.top+n.scrollTop-s;a<n.scrollTop?n.scrollTop=a:a+l.height+u>n.scrollTop+i.height&&(n.scrollTop=a+l.height-i.height+u)}}}(e.getItemNodeFromIndex(e.getState().highlightedIndex),e._rootNode)})},this.openAndHighlightDefaultIndex=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.setHighlightedIndex(void 0,m({isOpen:!0},t))},this.highlightDefaultIndex=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.setHighlightedIndex(void 0,t)},this.moveHighlightedIndex=function(t,n){e.getState().isOpen?e.changeHighlightedIndex(t,n):e.openAndHighlightDefaultIndex(n)},this.changeHighlightedIndex=function(t,n){var o=e.getItemCount()-1;if(!(o<0)){var i=e.getState().highlightedIndex;null===i&&(i=t>0?-1:o+1);var r=i+t;r<0?r=o:r>o&&(r=0),e.setHighlightedIndex(r,n)}},this.clearSelection=function(t){e.internalSetState({selectedItem:null,inputValue:"",isOpen:!1},function(){var o=e._rootNode.querySelector("#"+e.inputId);o&&o.focus&&o.focus(),n(t)()})},this.selectItem=function(t,o,i){o=d(o),e.internalSetState(m({isOpen:!1,highlightedIndex:e.props.defaultHighlightedIndex,selectedItem:t,inputValue:e.props.itemToString(t)},o),n(i))},this.selectItemAtIndex=function(t,n,o){var i=e.items[t];null!=i&&e.selectItem(i,n,o)},this.selectHighlightedItem=function(t,n){return e.selectItemAtIndex(e.getState().highlightedIndex,t,n)},this.rootRef=function(t){return e._rootNode=t},this.getRootProps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.refKey,o=void 0===n?"ref":n,i=y(t,["refKey"]);return e.getRootProps.called=!0,e.getRootProps.refKey=o,m(g({},o,e.rootRef),i)},this.keyDownHandlers={ArrowDown:function(e){e.preventDefault();var t=e.shiftKey?5:1;this.moveHighlightedIndex(t,{type:k.stateChangeTypes.keyDownArrowDown})},ArrowUp:function(e){e.preventDefault();var t=e.shiftKey?-5:-1;this.moveHighlightedIndex(t,{type:k.stateChangeTypes.keyDownArrowUp})},Enter:function(e){this.getState().isOpen&&(e.preventDefault(),this.selectHighlightedItem({type:k.stateChangeTypes.keyDownEnter}))},Escape:function(e){e.preventDefault(),this.reset({type:k.stateChangeTypes.keyDownEscape})}},this.buttonKeyDownHandlers=m({},this.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:k.stateChangeTypes.keyDownSpaceButton})}}),this.getButtonProps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.onClick,o=t.onKeyDown,i=y(t,["onClick","onKeyDown"]),u=e.getState().isOpen,s=i.disabled?{}:{onClick:r(n,e.button_handleClick),onKeyDown:r(o,e.button_handleKeyDown)};return m({role:"button","aria-label":u?"close menu":"open menu","aria-expanded":u,"aria-haspopup":!0},s,i)},this.button_handleKeyDown=function(t){e.buttonKeyDownHandlers[t.key]&&e.buttonKeyDownHandlers[t.key].call(e,t)},this.button_handleClick=function(t){t.preventDefault(),e.toggleMenu({type:k.stateChangeTypes.clickButton})},this.getLabelProps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.getLabelProps.called=!0,e.getInputProps.called&&t.htmlFor&&t.htmlFor!==e.inputId)throw new Error('downshift: You provided the htmlFor of "'+t.htmlFor+'" for your label, but the id of your input is "'+e.inputId+'". You must either remove the id from your input or set the htmlFor of the label equal to the input id.');return e.inputId=s(e.inputId,t.htmlFor,u("downshift-input")),m({},t,{htmlFor:e.inputId})},this.getInputProps=function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=n.onKeyDown,i=n.onBlur,l=n.onChange,a=n.onInput,p=y(n,["onKeyDown","onBlur","onChange","onInput"]);if(e.getInputProps.called=!0,e.getLabelProps.called&&p.id&&p.id!==e.inputId)throw new Error('downshift: You provided the id of "'+p.id+'" for your input, but the htmlFor of your label is "'+e.inputId+'". You must either remove the id from your input or set the htmlFor of the label equal to the input id.');e.inputId=s(e.inputId,p.id,u("downshift-input"));var d=Boolean(!1)?"onInput":"onChange",h=e.getState(),c=h.inputValue,f=h.isOpen,v=h.highlightedIndex,I=p.disabled?{}:(t={},g(t,d,r(l,a,e.input_handleChange)),g(t,"onKeyDown",r(o,e.input_handleKeyDown)),g(t,"onBlur",r(i,e.input_handleBlur)),t);return m({role:"combobox","aria-autocomplete":"list","aria-expanded":f,"aria-activedescendant":"number"==typeof v&&v>=0?e.getItemId(v):null,autoComplete:"off",value:c},I,p,{id:e.inputId})},this.input_handleKeyDown=function(t){t.key&&e.keyDownHandlers[t.key]&&e.keyDownHandlers[t.key].call(e,t)},this.input_handleChange=function(t){e.internalSetState({type:k.stateChangeTypes.changeInput,isOpen:!0,inputValue:t.target.value})},this.input_handleBlur=function(){e.isMouseDown||e.reset({type:k.stateChangeTypes.blurInput})},this.getItemProps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.onMouseEnter,o=t.onClick,i=t.index,u=t.item,s=void 0===u?function(e,t){throw new Error('The property "'+t+'" is required in "'+e+'"')}("getItemProps","item"):u,l=y(t,["onMouseEnter","onClick","index","item"]);return void 0===i?(e.items.push(s),i=e.items.indexOf(s)):e.items[i]=s,m({id:e.getItemId(i),onMouseEnter:r(n,function(){e.setHighlightedIndex(i,{type:k.stateChangeTypes.itemMouseEnter})}),onClick:r(o,function(){e.selectItemAtIndex(i)})},l)},this.clearItems=function(){e.items=[]},this.reset=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments[1];t=d(t),e.internalSetState(function(n){var o=n.selectedItem;return m({isOpen:!1,highlightedIndex:null,inputValue:e.props.itemToString(o)},t)},n(o))},this.toggleMenu=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments[1];t=d(t),e.internalSetState(function(e){var n=e.isOpen;return m({isOpen:!n},t)},function(){e.getState().isOpen&&e.highlightDefaultIndex(),n(o)()})},this.openMenu=function(t){e.internalSetState({isOpen:!0},n(t))},this.closeMenu=function(t){e.internalSetState({isOpen:!1},n(t))},this.updateStatus=function(e,t){var n=void 0;return function(){for(var o=arguments.length,i=Array(o),r=0;r<o;r++)i[r]=arguments[r];n&&clearTimeout(n),n=setTimeout(function(){n=null,e.apply(void 0,i)},t)}}(function(){if(e._isMounted){var t=e.getState(),n=e.items[t.highlightedIndex]||{},o=e.getItemCount(),i=e.props.getA11yStatusMessage(m({itemToString:e.props.itemToString,previousResultCount:e.previousResultCount,resultCount:o,highlightedItem:n},t));e.previousResultCount=o,function(e){var t=w[w.length-1]===e;w=t?[].concat(I(w),[e]):[e];for(var n=_||((_=document.createElement("div")).setAttribute("id","a11y-status-message"),_.setAttribute("role","status"),_.setAttribute("aria-live","assertive"),_.setAttribute("aria-relevant","additions text"),Object.assign(_.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),document.body.appendChild(_),_);n.lastChild;)n.removeChild(n.firstChild);w.filter(Boolean).forEach(function(e,t){n.appendChild(function(e,t){var n=t===w.length-1?"block":"none",o=document.createElement("div");return o.style.display=n,o.textContent=e,o}(e,t))})}(i)}},200)};return k.default=k,k});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("prop-types")):"function"==typeof define&&define.amd?define(["react","prop-types"],t):e.Downshift=t(e.React,e.PropTypes)}(this,function(e,t){"use strict";function n(e){return"function"==typeof e?e:o}function o(){}function i(e,t,n){return null!==t&&t!==n.parentNode?e(t)?t===document.body&&0===t.scrollTop?document.documentElement:t:i(e,t.parentNode,n):null}function r(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,o=Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return t.some(function(t){return t&&t.apply(void 0,[e].concat(o)),e.defaultPrevented})}}function u(e){return e+"-"+b++}function s(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.find(function(e){return void 0!==e})}function l(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}function a(e){return e.nodeName?"string"==typeof e.nodeName:"string"==typeof e.type}function p(e){return e.props||e.attributes}function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return C.forEach(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])}),t}var h="default"in e?e.default:e;t=t&&t.hasOwnProperty("default")?t.default:t;var c=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},f=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}}(),g=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},m=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},y=function(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},v=function(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},I=function(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)},_="undefined"==typeof document?null:document.getElementById("a11y-status-message"),w=[],b=1,S=i.bind(null,function(e){return e.scrollHeight>e.clientHeight}),C=["highlightedIndex","inputValue","isOpen","selectedItem","type"],k=function(t){function i(){var e;c(this,i);for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];var r=v(this,(e=i.__proto__||Object.getPrototypeOf(i)).call.apply(e,[this].concat(n)));P.call(r);var u=r.getState({highlightedIndex:r.props.defaultHighlightedIndex,isOpen:r.props.defaultIsOpen,inputValue:r.props.defaultInputValue,selectedItem:r.props.defaultSelectedItem});return u.selectedItem&&(u.inputValue=r.props.itemToString(u.selectedItem)),r.state=u,r}return function(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)}(i,e.Component),f(i,[{key:"getState",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state;return Object.keys(t).reduce(function(n,o){return n[o]=e.isControlledProp(o)?e.props[o]:t[o],n},{})}},{key:"isControlledProp",value:function(e){return void 0!==this.props[e]}},{key:"getItemCount",value:function(){return void 0===this.props.itemCount?this.items.length:this.props.itemCount}},{key:"internalSetState",value:function(e,t){var o=this,r=void 0,u=void 0,s={},l="function"==typeof e;return!l&&e.hasOwnProperty("inputValue")&&this.props.onInputValueChange(e.inputValue,m({},this.getStateAndHelpers(),e)),this.setState(function(t){t=o.getState(t),e=l?e(t):e;var n={},a={};return(r=e.hasOwnProperty("selectedItem"))&&e.selectedItem!==t.selectedItem&&(u=e.selectedItem),e.type=e.type||i.stateChangeTypes.unknown,Object.keys(e).forEach(function(i){t[i]!==e[i]&&(s[i]=e[i]),"type"!==i&&(a[i]=e[i],o.isControlledProp(i)||(n[i]=e[i]))}),l&&e.hasOwnProperty("inputValue")&&o.props.onInputValueChange(e.inputValue,m({},o.getStateAndHelpers(),e)),n},function(){n(t)();Object.keys(s).length>1&&o.props.onStateChange(s,o.getStateAndHelpers()),r&&o.props.onSelect(e.selectedItem,o.getStateAndHelpers()),void 0!==u&&o.props.onChange(u,o.getStateAndHelpers()),o.props.onUserAction(s,o.getStateAndHelpers())})}},{key:"getStateAndHelpers",value:function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,o=e.selectedItem,i=e.isOpen,r=this.props,u=r.id,s=r.itemToString,l=this.getRootProps,a=this.getButtonProps,p=this.getLabelProps,d=this.getInputProps,h=this.getItemProps,c=this.openMenu,f=this.closeMenu,g=this.toggleMenu,m=this.selectItem,y=this.selectItemAtIndex,v=this.selectHighlightedItem,I=this.setHighlightedIndex,_=this.clearSelection,w=this.clearItems;return{getRootProps:l,getButtonProps:a,getLabelProps:p,getInputProps:d,getItemProps:h,reset:this.reset,openMenu:c,closeMenu:f,toggleMenu:g,selectItem:m,selectItemAtIndex:y,selectHighlightedItem:v,setHighlightedIndex:I,clearSelection:_,clearItems:w,itemToString:s,id:u,highlightedIndex:t,inputValue:n,isOpen:i,selectedItem:o}}},{key:"getItemId",value:function(e){return this.props.id+"-item-"+e}},{key:"componentDidMount",value:function(){var e=this;this._isMounted=!0;var t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,t.target!==e._rootNode&&e._rootNode.contains(t.target)||!e.getState().isOpen||e.reset({type:i.stateChangeTypes.mouseUp},function(){return e.props.onOuterClick(e.getStateAndHelpers())})};this.props.environment.addEventListener("mousedown",t),this.props.environment.addEventListener("mouseup",n),this.cleanup=function(){e._isMounted=!1,e.props.environment.removeEventListener("mousedown",t),e.props.environment.removeEventListener("mouseup",n)}}},{key:"componentDidUpdate",value:function(e){this.isControlledProp("selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:i.stateChangeTypes.controlledPropUpdatedSelectedItem,inputValue:this.props.itemToString(this.props.selectedItem)}),this.updateStatus()}},{key:"componentWillUnmount",value:function(){this.cleanup()}},{key:"render",value:function(){var e=l(this.props.children,o);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var t=l(e(this.getStateAndHelpers()));if(!t)return null;if(this.getRootProps.called)return this.getRootProps.suppressRefError||function(e,t){var n=t.refKey,o="ref"!==n,i=!a(e);if(i&&!o)throw new Error("downshift: You returned a non-DOM element. You must specify a refKey in getRootProps");if(!i&&o)throw new Error('downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified "'+n+'"');if(!p(e).hasOwnProperty(n))throw new Error('downshift: You must apply the ref prop "'+n+'" from getRootProps onto your root element.')}(t,this.getRootProps),t;if(a(t))return h.cloneElement(t,this.getRootProps(p(t)));throw new Error("downshift: If you return a non-DOM element, you must use apply the getRootProps function")}}]),i}();k.propTypes={children:t.func,defaultHighlightedIndex:t.number,defaultSelectedItem:t.any,defaultInputValue:t.string,defaultIsOpen:t.bool,getA11yStatusMessage:t.func,itemToString:t.func,onChange:t.func,onSelect:t.func,onStateChange:t.func,onInputValueChange:t.func,onUserAction:t.func,onClick:t.func,onOuterClick:t.func,selectedItemChanged:t.func,itemCount:t.number,id:t.string,environment:t.shape({addEventListener:t.func,removeEventListener:t.func,document:t.shape({getElementById:t.func})}),selectedItem:t.any,isOpen:t.bool,inputValue:t.string,highlightedIndex:t.number},k.defaultProps={defaultHighlightedIndex:null,defaultSelectedItem:null,defaultInputValue:"",defaultIsOpen:!1,getA11yStatusMessage:function(e){var t=e.isOpen,n=e.highlightedItem,o=e.selectedItem,i=e.resultCount,r=e.previousResultCount,u=e.itemToString;return t?i?n&&i===r?u(n):i+" "+(1===i?"result is":"results are")+" available, use up and down arrow keys to navigate.":"No results.":o?u(o):""},id:u("downshift"),itemToString:function(e){return null==e?"":String(e)},onStateChange:function(){},onInputValueChange:function(){},onUserAction:function(){},onChange:function(){},onSelect:function(){},onOuterClick:function(){},selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window},k.stateChangeTypes={unknown:"__autocomplete_unknown__",mouseUp:"__autocomplete_mouseup__",itemMouseEnter:"__autocomplete_item_mouseenter__",keyDownArrowUp:"__autocomplete_keydown_arrow_up__",keyDownArrowDown:"__autocomplete_keydown_arrow_down__",keyDownEscape:"__autocomplete_keydown_escape__",keyDownEnter:"__autocomplete_keydown_enter__",blurInput:"__autocomplete_blur_input__",changeInput:"__autocomplete_change_input__",keyDownSpaceButton:"__autocomplete_keydown_space_button__",clickButton:"__autocomplete_click_button__",controlledPropUpdatedSelectedItem:"__autocomplete_controlled_prop_updated_selected_item__"};var P=function(){var e=this;this.root_handleClick=r(this.props.onClick,this.root_handleClick),this.input=null,this.items=[],this.previousResultCount=0,this.getItemNodeFromIndex=function(t){return e.props.environment.document.getElementById(e.getItemId(t))},this.setHighlightedIndex=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.props.defaultHighlightedIndex,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n=d(n),e.internalSetState(m({highlightedIndex:t},n),function(){!function(e,t){var n=S(e,t);if(null!==n){var o=getComputedStyle(n),i=n.getBoundingClientRect(),r=parseInt(o.borderTopWidth,10),u=r+parseInt(o.borderBottomWidth,10),s=i.top+r,l=e.getBoundingClientRect();if(l.top<0)n.scrollTop+=l.top;else if(l.top>0&&i.top<0)i.bottom>0&&l.bottom+u>i.bottom&&(n.scrollTop+=l.bottom-i.bottom+u);else{var a=l.top+n.scrollTop-s;a<n.scrollTop?n.scrollTop=a:a+l.height+u>n.scrollTop+i.height&&(n.scrollTop=a+l.height-i.height+u)}}}(e.getItemNodeFromIndex(e.getState().highlightedIndex),e._rootNode)})},this.openAndHighlightDefaultIndex=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.setHighlightedIndex(void 0,m({isOpen:!0},t))},this.highlightDefaultIndex=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.setHighlightedIndex(void 0,t)},this.moveHighlightedIndex=function(t,n){e.getState().isOpen?e.changeHighlightedIndex(t,n):e.openAndHighlightDefaultIndex(n)},this.changeHighlightedIndex=function(t,n){var o=e.getItemCount()-1;if(!(o<0)){var i=e.getState().highlightedIndex;null===i&&(i=t>0?-1:o+1);var r=i+t;r<0?r=o:r>o&&(r=0),e.setHighlightedIndex(r,n)}},this.clearSelection=function(t){e.internalSetState({selectedItem:null,inputValue:"",isOpen:!1},function(){var o=e._rootNode.querySelector("#"+e.inputId);o&&o.focus&&o.focus(),n(t)()})},this.selectItem=function(t,o,i){o=d(o),e.internalSetState(m({isOpen:!1,highlightedIndex:e.props.defaultHighlightedIndex,selectedItem:t,inputValue:e.props.itemToString(t)},o),n(i))},this.selectItemAtIndex=function(t,n,o){var i=e.items[t];null!=i&&e.selectItem(i,n,o)},this.selectHighlightedItem=function(t,n){return e.selectItemAtIndex(e.getState().highlightedIndex,t,n)},this.rootRef=function(t){return e._rootNode=t},this.getRootProps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).suppressRefError,o=void 0!==n&&n,i=t.refKey,r=void 0===i?"ref":i,u=y(t,["refKey"]);return e.getRootProps.called=!0,e.getRootProps.refKey=r,e.getRootProps.suppressRefError=o,m(g({},r,e.rootRef),u)},this.keyDownHandlers={ArrowDown:function(e){e.preventDefault();var t=e.shiftKey?5:1;this.moveHighlightedIndex(t,{type:k.stateChangeTypes.keyDownArrowDown})},ArrowUp:function(e){e.preventDefault();var t=e.shiftKey?-5:-1;this.moveHighlightedIndex(t,{type:k.stateChangeTypes.keyDownArrowUp})},Enter:function(e){this.getState().isOpen&&(e.preventDefault(),this.selectHighlightedItem({type:k.stateChangeTypes.keyDownEnter}))},Escape:function(e){e.preventDefault(),this.reset({type:k.stateChangeTypes.keyDownEscape})}},this.buttonKeyDownHandlers=m({},this.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:k.stateChangeTypes.keyDownSpaceButton})}}),this.getButtonProps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.onClick,o=t.onKeyDown,i=y(t,["onClick","onKeyDown"]),u=e.getState().isOpen,s=i.disabled?{}:{onClick:r(n,e.button_handleClick),onKeyDown:r(o,e.button_handleKeyDown)};return m({role:"button","aria-label":u?"close menu":"open menu","aria-expanded":u,"aria-haspopup":!0},s,i)},this.button_handleKeyDown=function(t){e.buttonKeyDownHandlers[t.key]&&e.buttonKeyDownHandlers[t.key].call(e,t)},this.button_handleClick=function(t){t.preventDefault(),e.toggleMenu({type:k.stateChangeTypes.clickButton})},this.getLabelProps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.getLabelProps.called=!0,e.getInputProps.called&&t.htmlFor&&t.htmlFor!==e.inputId)throw new Error('downshift: You provided the htmlFor of "'+t.htmlFor+'" for your label, but the id of your input is "'+e.inputId+'". You must either remove the id from your input or set the htmlFor of the label equal to the input id.');return e.inputId=s(e.inputId,t.htmlFor,u("downshift-input")),m({},t,{htmlFor:e.inputId})},this.getInputProps=function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=n.onKeyDown,i=n.onBlur,l=n.onChange,a=n.onInput,p=y(n,["onKeyDown","onBlur","onChange","onInput"]);if(e.getInputProps.called=!0,e.getLabelProps.called&&p.id&&p.id!==e.inputId)throw new Error('downshift: You provided the id of "'+p.id+'" for your input, but the htmlFor of your label is "'+e.inputId+'". You must either remove the id from your input or set the htmlFor of the label equal to the input id.');e.inputId=s(e.inputId,p.id,u("downshift-input"));var d=Boolean(!1)?"onInput":"onChange",h=e.getState(),c=h.inputValue,f=h.isOpen,v=h.highlightedIndex,I=p.disabled?{}:(t={},g(t,d,r(l,a,e.input_handleChange)),g(t,"onKeyDown",r(o,e.input_handleKeyDown)),g(t,"onBlur",r(i,e.input_handleBlur)),t);return m({role:"combobox","aria-autocomplete":"list","aria-expanded":f,"aria-activedescendant":"number"==typeof v&&v>=0?e.getItemId(v):null,autoComplete:"off",value:c},I,p,{id:e.inputId})},this.input_handleKeyDown=function(t){t.key&&e.keyDownHandlers[t.key]&&e.keyDownHandlers[t.key].call(e,t)},this.input_handleChange=function(t){e.internalSetState({type:k.stateChangeTypes.changeInput,isOpen:!0,inputValue:t.target.value})},this.input_handleBlur=function(){e.isMouseDown||e.reset({type:k.stateChangeTypes.blurInput})},this.getItemProps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.onMouseEnter,o=t.onClick,i=t.index,u=t.item,s=void 0===u?function(e,t){throw new Error('The property "'+t+'" is required in "'+e+'"')}("getItemProps","item"):u,l=y(t,["onMouseEnter","onClick","index","item"]);return void 0===i?(e.items.push(s),i=e.items.indexOf(s)):e.items[i]=s,m({id:e.getItemId(i),onMouseEnter:r(n,function(){e.setHighlightedIndex(i,{type:k.stateChangeTypes.itemMouseEnter})}),onClick:r(o,function(){e.selectItemAtIndex(i)})},l)},this.clearItems=function(){e.items=[]},this.reset=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments[1];t=d(t),e.internalSetState(function(n){var o=n.selectedItem;return m({isOpen:!1,highlightedIndex:null,inputValue:e.props.itemToString(o)},t)},n(o))},this.toggleMenu=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments[1];t=d(t),e.internalSetState(function(e){var n=e.isOpen;return m({isOpen:!n},t)},function(){e.getState().isOpen&&e.highlightDefaultIndex(),n(o)()})},this.openMenu=function(t){e.internalSetState({isOpen:!0},n(t))},this.closeMenu=function(t){e.internalSetState({isOpen:!1},n(t))},this.updateStatus=function(e,t){var n=void 0;return function(){for(var o=arguments.length,i=Array(o),r=0;r<o;r++)i[r]=arguments[r];n&&clearTimeout(n),n=setTimeout(function(){n=null,e.apply(void 0,i)},t)}}(function(){if(e._isMounted){var t=e.getState(),n=e.items[t.highlightedIndex]||{},o=e.getItemCount(),i=e.props.getA11yStatusMessage(m({itemToString:e.props.itemToString,previousResultCount:e.previousResultCount,resultCount:o,highlightedItem:n},t));e.previousResultCount=o,function(e){var t=w[w.length-1]===e;w=t?[].concat(I(w),[e]):[e];for(var n=_||((_=document.createElement("div")).setAttribute("id","a11y-status-message"),_.setAttribute("role","status"),_.setAttribute("aria-live","assertive"),_.setAttribute("aria-relevant","additions text"),Object.assign(_.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),document.body.appendChild(_),_);n.lastChild;)n.removeChild(n.firstChild);w.filter(Boolean).forEach(function(e,t){n.appendChild(function(e,t){var n=t===w.length-1?"block":"none",o=document.createElement("div");return o.style.display=n,o.textContent=e,o}(e,t))})}(i)}},200)};return k.default=k,k});
//# sourceMappingURL=downshift.umd.min.js.map
{
"name": "downshift",
"version": "1.16.4",
"version": "1.17.0",
"description": "A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete components",

@@ -5,0 +5,0 @@ "main": "dist/downshift.cjs.js",

@@ -794,2 +794,3 @@ 'use strict';

this.getRootProps.refKey = undefined;
this.getRootProps.suppressRefError = undefined;
// we do something similar for getLabelProps

@@ -804,3 +805,5 @@ this.getLabelProps.called = false;

if (this.getRootProps.called) {
validateGetRootPropsCalledCorrectly(element, this.getRootProps);
if (!this.getRootProps.suppressRefError) {
validateGetRootPropsCalledCorrectly(element, this.getRootProps);
}
return element;

@@ -964,2 +967,6 @@ } else if (isDOMElement(element)) {

var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref4$suppressRefErro = _ref4.suppressRefError,
suppressRefError = _ref4$suppressRefErro === undefined ? false : _ref4$suppressRefErro;
var _ref3$refKey = _ref3.refKey,

@@ -973,2 +980,3 @@ refKey = _ref3$refKey === undefined ? 'ref' : _ref3$refKey,

_this5.getRootProps.refKey = refKey;
_this5.getRootProps.suppressRefError = suppressRefError;
return _extends(defineProperty({}, refKey, _this5.rootRef), rest);

@@ -1013,7 +1021,7 @@ };

this.getButtonProps = function () {
var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var onClick = _ref4.onClick,
onKeyDown = _ref4.onKeyDown,
rest = objectWithoutProperties(_ref4, ['onClick', 'onKeyDown']);
var onClick = _ref5.onClick,
onKeyDown = _ref5.onKeyDown,
rest = objectWithoutProperties(_ref5, ['onClick', 'onKeyDown']);

@@ -1060,11 +1068,11 @@ var _getState3 = _this5.getState(),

this.getInputProps = function () {
var _ref6;
var _ref7;
var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var onKeyDown = _ref5.onKeyDown,
onBlur = _ref5.onBlur,
onChange = _ref5.onChange,
onInput = _ref5.onInput,
rest = objectWithoutProperties(_ref5, ['onKeyDown', 'onBlur', 'onChange', 'onInput']);
var onKeyDown = _ref6.onKeyDown,
onBlur = _ref6.onBlur,
onChange = _ref6.onChange,
onInput = _ref6.onInput,
rest = objectWithoutProperties(_ref6, ['onKeyDown', 'onBlur', 'onChange', 'onInput']);

@@ -1087,3 +1095,3 @@ _this5.getInputProps.called = true;

var eventHandlers = rest.disabled ? {} : (_ref6 = {}, defineProperty(_ref6, onChangeKey, composeEventHandlers(onChange, onInput, _this5.input_handleChange)), defineProperty(_ref6, 'onKeyDown', composeEventHandlers(onKeyDown, _this5.input_handleKeyDown)), defineProperty(_ref6, 'onBlur', composeEventHandlers(onBlur, _this5.input_handleBlur)), _ref6);
var eventHandlers = rest.disabled ? {} : (_ref7 = {}, defineProperty(_ref7, onChangeKey, composeEventHandlers(onChange, onInput, _this5.input_handleChange)), defineProperty(_ref7, 'onKeyDown', composeEventHandlers(onKeyDown, _this5.input_handleKeyDown)), defineProperty(_ref7, 'onBlur', composeEventHandlers(onBlur, _this5.input_handleBlur)), _ref7);
return _extends({

@@ -1122,10 +1130,10 @@ role: 'combobox',

this.getItemProps = function () {
var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref8 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var onMouseEnter = _ref7.onMouseEnter,
onClick = _ref7.onClick,
index = _ref7.index,
_ref7$item = _ref7.item,
item = _ref7$item === undefined ? requiredProp('getItemProps', 'item') : _ref7$item,
rest = objectWithoutProperties(_ref7, ['onMouseEnter', 'onClick', 'index', 'item']);
var onMouseEnter = _ref8.onMouseEnter,
onClick = _ref8.onClick,
index = _ref8.index,
_ref8$item = _ref8.item,
item = _ref8$item === undefined ? requiredProp('getItemProps', 'item') : _ref8$item,
rest = objectWithoutProperties(_ref8, ['onMouseEnter', 'onClick', 'index', 'item']);

@@ -1160,4 +1168,4 @@ if (index === undefined) {

otherStateToSet = pickState(otherStateToSet);
_this5.internalSetState(function (_ref8) {
var selectedItem = _ref8.selectedItem;
_this5.internalSetState(function (_ref9) {
var selectedItem = _ref9.selectedItem;
return _extends({

@@ -1176,4 +1184,4 @@ isOpen: false,

otherStateToSet = pickState(otherStateToSet);
_this5.internalSetState(function (_ref9) {
var isOpen = _ref9.isOpen;
_this5.internalSetState(function (_ref10) {
var isOpen = _ref10.isOpen;

@@ -1180,0 +1188,0 @@ return _extends({ isOpen: !isOpen }, otherStateToSet);

@@ -789,2 +789,3 @@ import React, { Component } from 'preact';

this.getRootProps.refKey = undefined;
this.getRootProps.suppressRefError = undefined;
// we do something similar for getLabelProps

@@ -799,3 +800,5 @@ this.getLabelProps.called = false;

if (this.getRootProps.called) {
validateGetRootPropsCalledCorrectly(element, this.getRootProps);
if (!this.getRootProps.suppressRefError) {
validateGetRootPropsCalledCorrectly(element, this.getRootProps);
}
return element;

@@ -959,2 +962,6 @@ } else if (isDOMElement(element)) {

var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref4$suppressRefErro = _ref4.suppressRefError,
suppressRefError = _ref4$suppressRefErro === undefined ? false : _ref4$suppressRefErro;
var _ref3$refKey = _ref3.refKey,

@@ -968,2 +975,3 @@ refKey = _ref3$refKey === undefined ? 'ref' : _ref3$refKey,

_this5.getRootProps.refKey = refKey;
_this5.getRootProps.suppressRefError = suppressRefError;
return _extends(defineProperty({}, refKey, _this5.rootRef), rest);

@@ -1008,7 +1016,7 @@ };

this.getButtonProps = function () {
var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var onClick = _ref4.onClick,
onKeyDown = _ref4.onKeyDown,
rest = objectWithoutProperties(_ref4, ['onClick', 'onKeyDown']);
var onClick = _ref5.onClick,
onKeyDown = _ref5.onKeyDown,
rest = objectWithoutProperties(_ref5, ['onClick', 'onKeyDown']);

@@ -1055,11 +1063,11 @@ var _getState3 = _this5.getState(),

this.getInputProps = function () {
var _ref6;
var _ref7;
var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var onKeyDown = _ref5.onKeyDown,
onBlur = _ref5.onBlur,
onChange = _ref5.onChange,
onInput = _ref5.onInput,
rest = objectWithoutProperties(_ref5, ['onKeyDown', 'onBlur', 'onChange', 'onInput']);
var onKeyDown = _ref6.onKeyDown,
onBlur = _ref6.onBlur,
onChange = _ref6.onChange,
onInput = _ref6.onInput,
rest = objectWithoutProperties(_ref6, ['onKeyDown', 'onBlur', 'onChange', 'onInput']);

@@ -1082,3 +1090,3 @@ _this5.getInputProps.called = true;

var eventHandlers = rest.disabled ? {} : (_ref6 = {}, defineProperty(_ref6, onChangeKey, composeEventHandlers(onChange, onInput, _this5.input_handleChange)), defineProperty(_ref6, 'onKeyDown', composeEventHandlers(onKeyDown, _this5.input_handleKeyDown)), defineProperty(_ref6, 'onBlur', composeEventHandlers(onBlur, _this5.input_handleBlur)), _ref6);
var eventHandlers = rest.disabled ? {} : (_ref7 = {}, defineProperty(_ref7, onChangeKey, composeEventHandlers(onChange, onInput, _this5.input_handleChange)), defineProperty(_ref7, 'onKeyDown', composeEventHandlers(onKeyDown, _this5.input_handleKeyDown)), defineProperty(_ref7, 'onBlur', composeEventHandlers(onBlur, _this5.input_handleBlur)), _ref7);
return _extends({

@@ -1117,10 +1125,10 @@ role: 'combobox',

this.getItemProps = function () {
var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref8 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var onMouseEnter = _ref7.onMouseEnter,
onClick = _ref7.onClick,
index = _ref7.index,
_ref7$item = _ref7.item,
item = _ref7$item === undefined ? requiredProp('getItemProps', 'item') : _ref7$item,
rest = objectWithoutProperties(_ref7, ['onMouseEnter', 'onClick', 'index', 'item']);
var onMouseEnter = _ref8.onMouseEnter,
onClick = _ref8.onClick,
index = _ref8.index,
_ref8$item = _ref8.item,
item = _ref8$item === undefined ? requiredProp('getItemProps', 'item') : _ref8$item,
rest = objectWithoutProperties(_ref8, ['onMouseEnter', 'onClick', 'index', 'item']);

@@ -1155,4 +1163,4 @@ if (index === undefined) {

otherStateToSet = pickState(otherStateToSet);
_this5.internalSetState(function (_ref8) {
var selectedItem = _ref8.selectedItem;
_this5.internalSetState(function (_ref9) {
var selectedItem = _ref9.selectedItem;
return _extends({

@@ -1171,4 +1179,4 @@ isOpen: false,

otherStateToSet = pickState(otherStateToSet);
_this5.internalSetState(function (_ref9) {
var isOpen = _ref9.isOpen;
_this5.internalSetState(function (_ref10) {
var isOpen = _ref10.isOpen;

@@ -1175,0 +1183,0 @@ return _extends({ isOpen: !isOpen }, otherStateToSet);

@@ -795,2 +795,3 @@ (function (global, factory) {

this.getRootProps.refKey = undefined;
this.getRootProps.suppressRefError = undefined;
// we do something similar for getLabelProps

@@ -805,3 +806,5 @@ this.getLabelProps.called = false;

if (this.getRootProps.called) {
validateGetRootPropsCalledCorrectly(element, this.getRootProps);
if (!this.getRootProps.suppressRefError) {
validateGetRootPropsCalledCorrectly(element, this.getRootProps);
}
return element;

@@ -965,2 +968,6 @@ } else if (isDOMElement(element)) {

var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref4$suppressRefErro = _ref4.suppressRefError,
suppressRefError = _ref4$suppressRefErro === undefined ? false : _ref4$suppressRefErro;
var _ref3$refKey = _ref3.refKey,

@@ -974,2 +981,3 @@ refKey = _ref3$refKey === undefined ? 'ref' : _ref3$refKey,

_this5.getRootProps.refKey = refKey;
_this5.getRootProps.suppressRefError = suppressRefError;
return _extends(defineProperty({}, refKey, _this5.rootRef), rest);

@@ -1014,7 +1022,7 @@ };

this.getButtonProps = function () {
var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var onClick = _ref4.onClick,
onKeyDown = _ref4.onKeyDown,
rest = objectWithoutProperties(_ref4, ['onClick', 'onKeyDown']);
var onClick = _ref5.onClick,
onKeyDown = _ref5.onKeyDown,
rest = objectWithoutProperties(_ref5, ['onClick', 'onKeyDown']);

@@ -1061,11 +1069,11 @@ var _getState3 = _this5.getState(),

this.getInputProps = function () {
var _ref6;
var _ref7;
var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var onKeyDown = _ref5.onKeyDown,
onBlur = _ref5.onBlur,
onChange = _ref5.onChange,
onInput = _ref5.onInput,
rest = objectWithoutProperties(_ref5, ['onKeyDown', 'onBlur', 'onChange', 'onInput']);
var onKeyDown = _ref6.onKeyDown,
onBlur = _ref6.onBlur,
onChange = _ref6.onChange,
onInput = _ref6.onInput,
rest = objectWithoutProperties(_ref6, ['onKeyDown', 'onBlur', 'onChange', 'onInput']);

@@ -1088,3 +1096,3 @@ _this5.getInputProps.called = true;

var eventHandlers = rest.disabled ? {} : (_ref6 = {}, defineProperty(_ref6, onChangeKey, composeEventHandlers(onChange, onInput, _this5.input_handleChange)), defineProperty(_ref6, 'onKeyDown', composeEventHandlers(onKeyDown, _this5.input_handleKeyDown)), defineProperty(_ref6, 'onBlur', composeEventHandlers(onBlur, _this5.input_handleBlur)), _ref6);
var eventHandlers = rest.disabled ? {} : (_ref7 = {}, defineProperty(_ref7, onChangeKey, composeEventHandlers(onChange, onInput, _this5.input_handleChange)), defineProperty(_ref7, 'onKeyDown', composeEventHandlers(onKeyDown, _this5.input_handleKeyDown)), defineProperty(_ref7, 'onBlur', composeEventHandlers(onBlur, _this5.input_handleBlur)), _ref7);
return _extends({

@@ -1123,10 +1131,10 @@ role: 'combobox',

this.getItemProps = function () {
var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref8 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var onMouseEnter = _ref7.onMouseEnter,
onClick = _ref7.onClick,
index = _ref7.index,
_ref7$item = _ref7.item,
item = _ref7$item === undefined ? requiredProp('getItemProps', 'item') : _ref7$item,
rest = objectWithoutProperties(_ref7, ['onMouseEnter', 'onClick', 'index', 'item']);
var onMouseEnter = _ref8.onMouseEnter,
onClick = _ref8.onClick,
index = _ref8.index,
_ref8$item = _ref8.item,
item = _ref8$item === undefined ? requiredProp('getItemProps', 'item') : _ref8$item,
rest = objectWithoutProperties(_ref8, ['onMouseEnter', 'onClick', 'index', 'item']);

@@ -1161,4 +1169,4 @@ if (index === undefined) {

otherStateToSet = pickState(otherStateToSet);
_this5.internalSetState(function (_ref8) {
var selectedItem = _ref8.selectedItem;
_this5.internalSetState(function (_ref9) {
var selectedItem = _ref9.selectedItem;
return _extends({

@@ -1177,4 +1185,4 @@ isOpen: false,

otherStateToSet = pickState(otherStateToSet);
_this5.internalSetState(function (_ref9) {
var isOpen = _ref9.isOpen;
_this5.internalSetState(function (_ref10) {
var isOpen = _ref10.isOpen;

@@ -1181,0 +1189,0 @@ return _extends({ isOpen: !isOpen }, otherStateToSet);

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("preact")):"function"==typeof define&&define.amd?define(["preact"],t):e.Downshift=t(e.preact)}(this,function(e){"use strict";function t(e){return"function"==typeof e?e:n}function n(){}function o(e,t,n){return null!==t&&t!==n.parentNode?e(t)?t===document.body&&0===t.scrollTop?document.documentElement:t:o(e,t.parentNode,n):null}function i(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,o=Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return t.some(function(t){return t&&t.apply(void 0,[e].concat(o)),e.defaultPrevented})}}function r(e){return e+"-"+w++}function u(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.find(function(e){return void 0!==e})}function s(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}function l(e){return e.nodeName?"string"==typeof e.nodeName:"string"==typeof e.type}function a(e){return e.props||e.attributes}function p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return S.forEach(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])}),t}var d="default"in e?e.default:e,h=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},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}}(),g=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},f=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},m=function(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},y=function(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},v=function(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)},I="undefined"==typeof document?null:document.getElementById("a11y-status-message"),_=[],w=1,b=o.bind(null,function(e){return e.scrollHeight>e.clientHeight}),S=["highlightedIndex","inputValue","isOpen","selectedItem","type"],C=function(o){function i(){var e;h(this,i);for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];var r=y(this,(e=i.__proto__||Object.getPrototypeOf(i)).call.apply(e,[this].concat(n)));k.call(r);var u=r.getState({highlightedIndex:r.props.defaultHighlightedIndex,isOpen:r.props.defaultIsOpen,inputValue:r.props.defaultInputValue,selectedItem:r.props.defaultSelectedItem});return u.selectedItem&&(u.inputValue=r.props.itemToString(u.selectedItem)),r.state=u,r}return function(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)}(i,e.Component),c(i,[{key:"getState",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state;return Object.keys(t).reduce(function(n,o){return n[o]=e.isControlledProp(o)?e.props[o]:t[o],n},{})}},{key:"isControlledProp",value:function(e){return void 0!==this.props[e]}},{key:"getItemCount",value:function(){return void 0===this.props.itemCount?this.items.length:this.props.itemCount}},{key:"internalSetState",value:function(e,n){var o=this,r=void 0,u=void 0,s={},l="function"==typeof e;return!l&&e.hasOwnProperty("inputValue")&&this.props.onInputValueChange(e.inputValue,f({},this.getStateAndHelpers(),e)),this.setState(function(t){t=o.getState(t),e=l?e(t):e;var n={},a={};return(r=e.hasOwnProperty("selectedItem"))&&e.selectedItem!==t.selectedItem&&(u=e.selectedItem),e.type=e.type||i.stateChangeTypes.unknown,Object.keys(e).forEach(function(i){t[i]!==e[i]&&(s[i]=e[i]),"type"!==i&&(a[i]=e[i],o.isControlledProp(i)||(n[i]=e[i]))}),l&&e.hasOwnProperty("inputValue")&&o.props.onInputValueChange(e.inputValue,f({},o.getStateAndHelpers(),e)),n},function(){t(n)();Object.keys(s).length>1&&o.props.onStateChange(s,o.getStateAndHelpers()),r&&o.props.onSelect(e.selectedItem,o.getStateAndHelpers()),void 0!==u&&o.props.onChange(u,o.getStateAndHelpers()),o.props.onUserAction(s,o.getStateAndHelpers())})}},{key:"getStateAndHelpers",value:function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,o=e.selectedItem,i=e.isOpen,r=this.props,u=r.id,s=r.itemToString,l=this.getRootProps,a=this.getButtonProps,p=this.getLabelProps,d=this.getInputProps,h=this.getItemProps,c=this.openMenu,g=this.closeMenu,f=this.toggleMenu,m=this.selectItem,y=this.selectItemAtIndex,v=this.selectHighlightedItem,I=this.setHighlightedIndex,_=this.clearSelection,w=this.clearItems;return{getRootProps:l,getButtonProps:a,getLabelProps:p,getInputProps:d,getItemProps:h,reset:this.reset,openMenu:c,closeMenu:g,toggleMenu:f,selectItem:m,selectItemAtIndex:y,selectHighlightedItem:v,setHighlightedIndex:I,clearSelection:_,clearItems:w,itemToString:s,id:u,highlightedIndex:t,inputValue:n,isOpen:i,selectedItem:o}}},{key:"getItemId",value:function(e){return this.props.id+"-item-"+e}},{key:"componentDidMount",value:function(){var e=this;this._isMounted=!0;var t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,t.target!==e._rootNode&&e._rootNode.contains(t.target)||!e.getState().isOpen||e.reset({type:i.stateChangeTypes.mouseUp},function(){return e.props.onOuterClick(e.getStateAndHelpers())})};this.props.environment.addEventListener("mousedown",t),this.props.environment.addEventListener("mouseup",n),this.cleanup=function(){e._isMounted=!1,e.props.environment.removeEventListener("mousedown",t),e.props.environment.removeEventListener("mouseup",n)}}},{key:"componentDidUpdate",value:function(e){this.isControlledProp("selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:i.stateChangeTypes.controlledPropUpdatedSelectedItem,inputValue:this.props.itemToString(this.props.selectedItem)}),this.updateStatus()}},{key:"componentWillUnmount",value:function(){this.cleanup()}},{key:"render",value:function(){var e=s(this.props.children,n);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var t=s(e(this.getStateAndHelpers()));if(!t)return null;if(this.getRootProps.called)return function(e,t){var n=t.refKey,o="ref"!==n,i=!l(e);if(i&&!o)throw new Error("downshift: You returned a non-DOM element. You must specify a refKey in getRootProps");if(!i&&o)throw new Error('downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified "'+n+'"');if(!a(e).hasOwnProperty(n))throw new Error('downshift: You must apply the ref prop "'+n+'" from getRootProps onto your root element.')}(t,this.getRootProps),t;if(l(t))return d.cloneElement(t,this.getRootProps(a(t)));throw new Error("downshift: If you return a non-DOM element, you must use apply the getRootProps function")}}]),i}();C.defaultProps={defaultHighlightedIndex:null,defaultSelectedItem:null,defaultInputValue:"",defaultIsOpen:!1,getA11yStatusMessage:function(e){var t=e.isOpen,n=e.highlightedItem,o=e.selectedItem,i=e.resultCount,r=e.previousResultCount,u=e.itemToString;return t?i?n&&i===r?u(n):i+" "+(1===i?"result is":"results are")+" available, use up and down arrow keys to navigate.":"No results.":o?u(o):""},id:r("downshift"),itemToString:function(e){return null==e?"":String(e)},onStateChange:function(){},onInputValueChange:function(){},onUserAction:function(){},onChange:function(){},onSelect:function(){},onOuterClick:function(){},selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window},C.stateChangeTypes={unknown:"__autocomplete_unknown__",mouseUp:"__autocomplete_mouseup__",itemMouseEnter:"__autocomplete_item_mouseenter__",keyDownArrowUp:"__autocomplete_keydown_arrow_up__",keyDownArrowDown:"__autocomplete_keydown_arrow_down__",keyDownEscape:"__autocomplete_keydown_escape__",keyDownEnter:"__autocomplete_keydown_enter__",blurInput:"__autocomplete_blur_input__",changeInput:"__autocomplete_change_input__",keyDownSpaceButton:"__autocomplete_keydown_space_button__",clickButton:"__autocomplete_click_button__",controlledPropUpdatedSelectedItem:"__autocomplete_controlled_prop_updated_selected_item__"};var k=function(){var e=this;this.root_handleClick=i(this.props.onClick,this.root_handleClick),this.input=null,this.items=[],this.previousResultCount=0,this.getItemNodeFromIndex=function(t){return e.props.environment.document.getElementById(e.getItemId(t))},this.setHighlightedIndex=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.props.defaultHighlightedIndex,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n=p(n),e.internalSetState(f({highlightedIndex:t},n),function(){!function(e,t){var n=b(e,t);if(null!==n){var o=getComputedStyle(n),i=n.getBoundingClientRect(),r=parseInt(o.borderTopWidth,10),u=r+parseInt(o.borderBottomWidth,10),s=i.top+r,l=e.getBoundingClientRect();if(l.top<0)n.scrollTop+=l.top;else if(l.top>0&&i.top<0)i.bottom>0&&l.bottom+u>i.bottom&&(n.scrollTop+=l.bottom-i.bottom+u);else{var a=l.top+n.scrollTop-s;a<n.scrollTop?n.scrollTop=a:a+l.height+u>n.scrollTop+i.height&&(n.scrollTop=a+l.height-i.height+u)}}}(e.getItemNodeFromIndex(e.getState().highlightedIndex),e._rootNode)})},this.openAndHighlightDefaultIndex=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.setHighlightedIndex(void 0,f({isOpen:!0},t))},this.highlightDefaultIndex=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.setHighlightedIndex(void 0,t)},this.moveHighlightedIndex=function(t,n){e.getState().isOpen?e.changeHighlightedIndex(t,n):e.openAndHighlightDefaultIndex(n)},this.changeHighlightedIndex=function(t,n){var o=e.getItemCount()-1;if(!(o<0)){var i=e.getState().highlightedIndex;null===i&&(i=t>0?-1:o+1);var r=i+t;r<0?r=o:r>o&&(r=0),e.setHighlightedIndex(r,n)}},this.clearSelection=function(n){e.internalSetState({selectedItem:null,inputValue:"",isOpen:!1},function(){var o=e._rootNode.querySelector("#"+e.inputId);o&&o.focus&&o.focus(),t(n)()})},this.selectItem=function(n,o,i){o=p(o),e.internalSetState(f({isOpen:!1,highlightedIndex:e.props.defaultHighlightedIndex,selectedItem:n,inputValue:e.props.itemToString(n)},o),t(i))},this.selectItemAtIndex=function(t,n,o){var i=e.items[t];null!=i&&e.selectItem(i,n,o)},this.selectHighlightedItem=function(t,n){return e.selectItemAtIndex(e.getState().highlightedIndex,t,n)},this.rootRef=function(t){return e._rootNode=t},this.getRootProps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.refKey,o=void 0===n?"ref":n,i=m(t,["refKey"]);return e.getRootProps.called=!0,e.getRootProps.refKey=o,f(g({},o,e.rootRef),i)},this.keyDownHandlers={ArrowDown:function(e){e.preventDefault();var t=e.shiftKey?5:1;this.moveHighlightedIndex(t,{type:C.stateChangeTypes.keyDownArrowDown})},ArrowUp:function(e){e.preventDefault();var t=e.shiftKey?-5:-1;this.moveHighlightedIndex(t,{type:C.stateChangeTypes.keyDownArrowUp})},Enter:function(e){this.getState().isOpen&&(e.preventDefault(),this.selectHighlightedItem({type:C.stateChangeTypes.keyDownEnter}))},Escape:function(e){e.preventDefault(),this.reset({type:C.stateChangeTypes.keyDownEscape})}},this.buttonKeyDownHandlers=f({},this.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:C.stateChangeTypes.keyDownSpaceButton})}}),this.getButtonProps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.onClick,o=t.onKeyDown,r=m(t,["onClick","onKeyDown"]),u=e.getState().isOpen,s=r.disabled?{}:{onClick:i(n,e.button_handleClick),onKeyDown:i(o,e.button_handleKeyDown)};return f({role:"button","aria-label":u?"close menu":"open menu","aria-expanded":u,"aria-haspopup":!0},s,r)},this.button_handleKeyDown=function(t){e.buttonKeyDownHandlers[t.key]&&e.buttonKeyDownHandlers[t.key].call(e,t)},this.button_handleClick=function(t){t.preventDefault(),e.toggleMenu({type:C.stateChangeTypes.clickButton})},this.getLabelProps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.getLabelProps.called=!0,e.getInputProps.called&&t.htmlFor&&t.htmlFor!==e.inputId)throw new Error('downshift: You provided the htmlFor of "'+t.htmlFor+'" for your label, but the id of your input is "'+e.inputId+'". You must either remove the id from your input or set the htmlFor of the label equal to the input id.');return e.inputId=u(e.inputId,t.htmlFor,r("downshift-input")),f({},t,{htmlFor:e.inputId})},this.getInputProps=function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=n.onKeyDown,s=n.onBlur,l=n.onChange,a=n.onInput,p=m(n,["onKeyDown","onBlur","onChange","onInput"]);if(e.getInputProps.called=!0,e.getLabelProps.called&&p.id&&p.id!==e.inputId)throw new Error('downshift: You provided the id of "'+p.id+'" for your input, but the htmlFor of your label is "'+e.inputId+'". You must either remove the id from your input or set the htmlFor of the label equal to the input id.');e.inputId=u(e.inputId,p.id,r("downshift-input"));var d=Boolean(!0)?"onInput":"onChange",h=e.getState(),c=h.inputValue,y=h.isOpen,v=h.highlightedIndex,I=p.disabled?{}:(t={},g(t,d,i(l,a,e.input_handleChange)),g(t,"onKeyDown",i(o,e.input_handleKeyDown)),g(t,"onBlur",i(s,e.input_handleBlur)),t);return f({role:"combobox","aria-autocomplete":"list","aria-expanded":y,"aria-activedescendant":"number"==typeof v&&v>=0?e.getItemId(v):null,autoComplete:"off",value:c},I,p,{id:e.inputId})},this.input_handleKeyDown=function(t){t.key&&e.keyDownHandlers[t.key]&&e.keyDownHandlers[t.key].call(e,t)},this.input_handleChange=function(t){e.internalSetState({type:C.stateChangeTypes.changeInput,isOpen:!0,inputValue:t.target.value})},this.input_handleBlur=function(){e.isMouseDown||e.reset({type:C.stateChangeTypes.blurInput})},this.getItemProps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.onMouseEnter,o=t.onClick,r=t.index,u=t.item,s=void 0===u?function(e,t){throw new Error('The property "'+t+'" is required in "'+e+'"')}("getItemProps","item"):u,l=m(t,["onMouseEnter","onClick","index","item"]);return void 0===r?(e.items.push(s),r=e.items.indexOf(s)):e.items[r]=s,f({id:e.getItemId(r),onMouseEnter:i(n,function(){e.setHighlightedIndex(r,{type:C.stateChangeTypes.itemMouseEnter})}),onClick:i(o,function(){e.selectItemAtIndex(r)})},l)},this.clearItems=function(){e.items=[]},this.reset=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments[1];n=p(n),e.internalSetState(function(t){var o=t.selectedItem;return f({isOpen:!1,highlightedIndex:null,inputValue:e.props.itemToString(o)},n)},t(o))},this.toggleMenu=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments[1];n=p(n),e.internalSetState(function(e){var t=e.isOpen;return f({isOpen:!t},n)},function(){e.getState().isOpen&&e.highlightDefaultIndex(),t(o)()})},this.openMenu=function(n){e.internalSetState({isOpen:!0},t(n))},this.closeMenu=function(n){e.internalSetState({isOpen:!1},t(n))},this.updateStatus=function(e,t){var n=void 0;return function(){for(var o=arguments.length,i=Array(o),r=0;r<o;r++)i[r]=arguments[r];n&&clearTimeout(n),n=setTimeout(function(){n=null,e.apply(void 0,i)},t)}}(function(){if(e._isMounted){var t=e.getState(),n=e.items[t.highlightedIndex]||{},o=e.getItemCount(),i=e.props.getA11yStatusMessage(f({itemToString:e.props.itemToString,previousResultCount:e.previousResultCount,resultCount:o,highlightedItem:n},t));e.previousResultCount=o,function(e){var t=_[_.length-1]===e;_=t?[].concat(v(_),[e]):[e];for(var n=I||((I=document.createElement("div")).setAttribute("id","a11y-status-message"),I.setAttribute("role","status"),I.setAttribute("aria-live","assertive"),I.setAttribute("aria-relevant","additions text"),Object.assign(I.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),document.body.appendChild(I),I);n.lastChild;)n.removeChild(n.firstChild);_.filter(Boolean).forEach(function(e,t){n.appendChild(function(e,t){var n=t===_.length-1?"block":"none",o=document.createElement("div");return o.style.display=n,o.textContent=e,o}(e,t))})}(i)}},200)};return C.default=C,C});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("preact")):"function"==typeof define&&define.amd?define(["preact"],t):e.Downshift=t(e.preact)}(this,function(e){"use strict";function t(e){return"function"==typeof e?e:n}function n(){}function o(e,t,n){return null!==t&&t!==n.parentNode?e(t)?t===document.body&&0===t.scrollTop?document.documentElement:t:o(e,t.parentNode,n):null}function i(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,o=Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return t.some(function(t){return t&&t.apply(void 0,[e].concat(o)),e.defaultPrevented})}}function r(e){return e+"-"+w++}function u(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.find(function(e){return void 0!==e})}function s(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}function l(e){return e.nodeName?"string"==typeof e.nodeName:"string"==typeof e.type}function a(e){return e.props||e.attributes}function p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return S.forEach(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])}),t}var d="default"in e?e.default:e,h=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},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}}(),g=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},f=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},m=function(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},y=function(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},v=function(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)},I="undefined"==typeof document?null:document.getElementById("a11y-status-message"),_=[],w=1,b=o.bind(null,function(e){return e.scrollHeight>e.clientHeight}),S=["highlightedIndex","inputValue","isOpen","selectedItem","type"],C=function(o){function i(){var e;h(this,i);for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];var r=y(this,(e=i.__proto__||Object.getPrototypeOf(i)).call.apply(e,[this].concat(n)));k.call(r);var u=r.getState({highlightedIndex:r.props.defaultHighlightedIndex,isOpen:r.props.defaultIsOpen,inputValue:r.props.defaultInputValue,selectedItem:r.props.defaultSelectedItem});return u.selectedItem&&(u.inputValue=r.props.itemToString(u.selectedItem)),r.state=u,r}return function(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)}(i,e.Component),c(i,[{key:"getState",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state;return Object.keys(t).reduce(function(n,o){return n[o]=e.isControlledProp(o)?e.props[o]:t[o],n},{})}},{key:"isControlledProp",value:function(e){return void 0!==this.props[e]}},{key:"getItemCount",value:function(){return void 0===this.props.itemCount?this.items.length:this.props.itemCount}},{key:"internalSetState",value:function(e,n){var o=this,r=void 0,u=void 0,s={},l="function"==typeof e;return!l&&e.hasOwnProperty("inputValue")&&this.props.onInputValueChange(e.inputValue,f({},this.getStateAndHelpers(),e)),this.setState(function(t){t=o.getState(t),e=l?e(t):e;var n={},a={};return(r=e.hasOwnProperty("selectedItem"))&&e.selectedItem!==t.selectedItem&&(u=e.selectedItem),e.type=e.type||i.stateChangeTypes.unknown,Object.keys(e).forEach(function(i){t[i]!==e[i]&&(s[i]=e[i]),"type"!==i&&(a[i]=e[i],o.isControlledProp(i)||(n[i]=e[i]))}),l&&e.hasOwnProperty("inputValue")&&o.props.onInputValueChange(e.inputValue,f({},o.getStateAndHelpers(),e)),n},function(){t(n)();Object.keys(s).length>1&&o.props.onStateChange(s,o.getStateAndHelpers()),r&&o.props.onSelect(e.selectedItem,o.getStateAndHelpers()),void 0!==u&&o.props.onChange(u,o.getStateAndHelpers()),o.props.onUserAction(s,o.getStateAndHelpers())})}},{key:"getStateAndHelpers",value:function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,o=e.selectedItem,i=e.isOpen,r=this.props,u=r.id,s=r.itemToString,l=this.getRootProps,a=this.getButtonProps,p=this.getLabelProps,d=this.getInputProps,h=this.getItemProps,c=this.openMenu,g=this.closeMenu,f=this.toggleMenu,m=this.selectItem,y=this.selectItemAtIndex,v=this.selectHighlightedItem,I=this.setHighlightedIndex,_=this.clearSelection,w=this.clearItems;return{getRootProps:l,getButtonProps:a,getLabelProps:p,getInputProps:d,getItemProps:h,reset:this.reset,openMenu:c,closeMenu:g,toggleMenu:f,selectItem:m,selectItemAtIndex:y,selectHighlightedItem:v,setHighlightedIndex:I,clearSelection:_,clearItems:w,itemToString:s,id:u,highlightedIndex:t,inputValue:n,isOpen:i,selectedItem:o}}},{key:"getItemId",value:function(e){return this.props.id+"-item-"+e}},{key:"componentDidMount",value:function(){var e=this;this._isMounted=!0;var t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,t.target!==e._rootNode&&e._rootNode.contains(t.target)||!e.getState().isOpen||e.reset({type:i.stateChangeTypes.mouseUp},function(){return e.props.onOuterClick(e.getStateAndHelpers())})};this.props.environment.addEventListener("mousedown",t),this.props.environment.addEventListener("mouseup",n),this.cleanup=function(){e._isMounted=!1,e.props.environment.removeEventListener("mousedown",t),e.props.environment.removeEventListener("mouseup",n)}}},{key:"componentDidUpdate",value:function(e){this.isControlledProp("selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:i.stateChangeTypes.controlledPropUpdatedSelectedItem,inputValue:this.props.itemToString(this.props.selectedItem)}),this.updateStatus()}},{key:"componentWillUnmount",value:function(){this.cleanup()}},{key:"render",value:function(){var e=s(this.props.children,n);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var t=s(e(this.getStateAndHelpers()));if(!t)return null;if(this.getRootProps.called)return this.getRootProps.suppressRefError||function(e,t){var n=t.refKey,o="ref"!==n,i=!l(e);if(i&&!o)throw new Error("downshift: You returned a non-DOM element. You must specify a refKey in getRootProps");if(!i&&o)throw new Error('downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified "'+n+'"');if(!a(e).hasOwnProperty(n))throw new Error('downshift: You must apply the ref prop "'+n+'" from getRootProps onto your root element.')}(t,this.getRootProps),t;if(l(t))return d.cloneElement(t,this.getRootProps(a(t)));throw new Error("downshift: If you return a non-DOM element, you must use apply the getRootProps function")}}]),i}();C.defaultProps={defaultHighlightedIndex:null,defaultSelectedItem:null,defaultInputValue:"",defaultIsOpen:!1,getA11yStatusMessage:function(e){var t=e.isOpen,n=e.highlightedItem,o=e.selectedItem,i=e.resultCount,r=e.previousResultCount,u=e.itemToString;return t?i?n&&i===r?u(n):i+" "+(1===i?"result is":"results are")+" available, use up and down arrow keys to navigate.":"No results.":o?u(o):""},id:r("downshift"),itemToString:function(e){return null==e?"":String(e)},onStateChange:function(){},onInputValueChange:function(){},onUserAction:function(){},onChange:function(){},onSelect:function(){},onOuterClick:function(){},selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window},C.stateChangeTypes={unknown:"__autocomplete_unknown__",mouseUp:"__autocomplete_mouseup__",itemMouseEnter:"__autocomplete_item_mouseenter__",keyDownArrowUp:"__autocomplete_keydown_arrow_up__",keyDownArrowDown:"__autocomplete_keydown_arrow_down__",keyDownEscape:"__autocomplete_keydown_escape__",keyDownEnter:"__autocomplete_keydown_enter__",blurInput:"__autocomplete_blur_input__",changeInput:"__autocomplete_change_input__",keyDownSpaceButton:"__autocomplete_keydown_space_button__",clickButton:"__autocomplete_click_button__",controlledPropUpdatedSelectedItem:"__autocomplete_controlled_prop_updated_selected_item__"};var k=function(){var e=this;this.root_handleClick=i(this.props.onClick,this.root_handleClick),this.input=null,this.items=[],this.previousResultCount=0,this.getItemNodeFromIndex=function(t){return e.props.environment.document.getElementById(e.getItemId(t))},this.setHighlightedIndex=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.props.defaultHighlightedIndex,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n=p(n),e.internalSetState(f({highlightedIndex:t},n),function(){!function(e,t){var n=b(e,t);if(null!==n){var o=getComputedStyle(n),i=n.getBoundingClientRect(),r=parseInt(o.borderTopWidth,10),u=r+parseInt(o.borderBottomWidth,10),s=i.top+r,l=e.getBoundingClientRect();if(l.top<0)n.scrollTop+=l.top;else if(l.top>0&&i.top<0)i.bottom>0&&l.bottom+u>i.bottom&&(n.scrollTop+=l.bottom-i.bottom+u);else{var a=l.top+n.scrollTop-s;a<n.scrollTop?n.scrollTop=a:a+l.height+u>n.scrollTop+i.height&&(n.scrollTop=a+l.height-i.height+u)}}}(e.getItemNodeFromIndex(e.getState().highlightedIndex),e._rootNode)})},this.openAndHighlightDefaultIndex=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.setHighlightedIndex(void 0,f({isOpen:!0},t))},this.highlightDefaultIndex=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.setHighlightedIndex(void 0,t)},this.moveHighlightedIndex=function(t,n){e.getState().isOpen?e.changeHighlightedIndex(t,n):e.openAndHighlightDefaultIndex(n)},this.changeHighlightedIndex=function(t,n){var o=e.getItemCount()-1;if(!(o<0)){var i=e.getState().highlightedIndex;null===i&&(i=t>0?-1:o+1);var r=i+t;r<0?r=o:r>o&&(r=0),e.setHighlightedIndex(r,n)}},this.clearSelection=function(n){e.internalSetState({selectedItem:null,inputValue:"",isOpen:!1},function(){var o=e._rootNode.querySelector("#"+e.inputId);o&&o.focus&&o.focus(),t(n)()})},this.selectItem=function(n,o,i){o=p(o),e.internalSetState(f({isOpen:!1,highlightedIndex:e.props.defaultHighlightedIndex,selectedItem:n,inputValue:e.props.itemToString(n)},o),t(i))},this.selectItemAtIndex=function(t,n,o){var i=e.items[t];null!=i&&e.selectItem(i,n,o)},this.selectHighlightedItem=function(t,n){return e.selectItemAtIndex(e.getState().highlightedIndex,t,n)},this.rootRef=function(t){return e._rootNode=t},this.getRootProps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).suppressRefError,o=void 0!==n&&n,i=t.refKey,r=void 0===i?"ref":i,u=m(t,["refKey"]);return e.getRootProps.called=!0,e.getRootProps.refKey=r,e.getRootProps.suppressRefError=o,f(g({},r,e.rootRef),u)},this.keyDownHandlers={ArrowDown:function(e){e.preventDefault();var t=e.shiftKey?5:1;this.moveHighlightedIndex(t,{type:C.stateChangeTypes.keyDownArrowDown})},ArrowUp:function(e){e.preventDefault();var t=e.shiftKey?-5:-1;this.moveHighlightedIndex(t,{type:C.stateChangeTypes.keyDownArrowUp})},Enter:function(e){this.getState().isOpen&&(e.preventDefault(),this.selectHighlightedItem({type:C.stateChangeTypes.keyDownEnter}))},Escape:function(e){e.preventDefault(),this.reset({type:C.stateChangeTypes.keyDownEscape})}},this.buttonKeyDownHandlers=f({},this.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:C.stateChangeTypes.keyDownSpaceButton})}}),this.getButtonProps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.onClick,o=t.onKeyDown,r=m(t,["onClick","onKeyDown"]),u=e.getState().isOpen,s=r.disabled?{}:{onClick:i(n,e.button_handleClick),onKeyDown:i(o,e.button_handleKeyDown)};return f({role:"button","aria-label":u?"close menu":"open menu","aria-expanded":u,"aria-haspopup":!0},s,r)},this.button_handleKeyDown=function(t){e.buttonKeyDownHandlers[t.key]&&e.buttonKeyDownHandlers[t.key].call(e,t)},this.button_handleClick=function(t){t.preventDefault(),e.toggleMenu({type:C.stateChangeTypes.clickButton})},this.getLabelProps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.getLabelProps.called=!0,e.getInputProps.called&&t.htmlFor&&t.htmlFor!==e.inputId)throw new Error('downshift: You provided the htmlFor of "'+t.htmlFor+'" for your label, but the id of your input is "'+e.inputId+'". You must either remove the id from your input or set the htmlFor of the label equal to the input id.');return e.inputId=u(e.inputId,t.htmlFor,r("downshift-input")),f({},t,{htmlFor:e.inputId})},this.getInputProps=function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=n.onKeyDown,s=n.onBlur,l=n.onChange,a=n.onInput,p=m(n,["onKeyDown","onBlur","onChange","onInput"]);if(e.getInputProps.called=!0,e.getLabelProps.called&&p.id&&p.id!==e.inputId)throw new Error('downshift: You provided the id of "'+p.id+'" for your input, but the htmlFor of your label is "'+e.inputId+'". You must either remove the id from your input or set the htmlFor of the label equal to the input id.');e.inputId=u(e.inputId,p.id,r("downshift-input"));var d=Boolean(!0)?"onInput":"onChange",h=e.getState(),c=h.inputValue,y=h.isOpen,v=h.highlightedIndex,I=p.disabled?{}:(t={},g(t,d,i(l,a,e.input_handleChange)),g(t,"onKeyDown",i(o,e.input_handleKeyDown)),g(t,"onBlur",i(s,e.input_handleBlur)),t);return f({role:"combobox","aria-autocomplete":"list","aria-expanded":y,"aria-activedescendant":"number"==typeof v&&v>=0?e.getItemId(v):null,autoComplete:"off",value:c},I,p,{id:e.inputId})},this.input_handleKeyDown=function(t){t.key&&e.keyDownHandlers[t.key]&&e.keyDownHandlers[t.key].call(e,t)},this.input_handleChange=function(t){e.internalSetState({type:C.stateChangeTypes.changeInput,isOpen:!0,inputValue:t.target.value})},this.input_handleBlur=function(){e.isMouseDown||e.reset({type:C.stateChangeTypes.blurInput})},this.getItemProps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.onMouseEnter,o=t.onClick,r=t.index,u=t.item,s=void 0===u?function(e,t){throw new Error('The property "'+t+'" is required in "'+e+'"')}("getItemProps","item"):u,l=m(t,["onMouseEnter","onClick","index","item"]);return void 0===r?(e.items.push(s),r=e.items.indexOf(s)):e.items[r]=s,f({id:e.getItemId(r),onMouseEnter:i(n,function(){e.setHighlightedIndex(r,{type:C.stateChangeTypes.itemMouseEnter})}),onClick:i(o,function(){e.selectItemAtIndex(r)})},l)},this.clearItems=function(){e.items=[]},this.reset=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments[1];n=p(n),e.internalSetState(function(t){var o=t.selectedItem;return f({isOpen:!1,highlightedIndex:null,inputValue:e.props.itemToString(o)},n)},t(o))},this.toggleMenu=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments[1];n=p(n),e.internalSetState(function(e){var t=e.isOpen;return f({isOpen:!t},n)},function(){e.getState().isOpen&&e.highlightDefaultIndex(),t(o)()})},this.openMenu=function(n){e.internalSetState({isOpen:!0},t(n))},this.closeMenu=function(n){e.internalSetState({isOpen:!1},t(n))},this.updateStatus=function(e,t){var n=void 0;return function(){for(var o=arguments.length,i=Array(o),r=0;r<o;r++)i[r]=arguments[r];n&&clearTimeout(n),n=setTimeout(function(){n=null,e.apply(void 0,i)},t)}}(function(){if(e._isMounted){var t=e.getState(),n=e.items[t.highlightedIndex]||{},o=e.getItemCount(),i=e.props.getA11yStatusMessage(f({itemToString:e.props.itemToString,previousResultCount:e.previousResultCount,resultCount:o,highlightedItem:n},t));e.previousResultCount=o,function(e){var t=_[_.length-1]===e;_=t?[].concat(v(_),[e]):[e];for(var n=I||((I=document.createElement("div")).setAttribute("id","a11y-status-message"),I.setAttribute("role","status"),I.setAttribute("aria-live","assertive"),I.setAttribute("aria-relevant","additions text"),Object.assign(I.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),document.body.appendChild(I),I);n.lastChild;)n.removeChild(n.firstChild);_.filter(Boolean).forEach(function(e,t){n.appendChild(function(e,t){var n=t===_.length-1?"block":"none",o=document.createElement("div");return o.style.display=n,o.textContent=e,o}(e,t))})}(i)}},200)};return C.default=C,C});
//# sourceMappingURL=downshift.umd.min.js.map

@@ -20,3 +20,3 @@ <h1 align="center">

[![All Contributors](https://img.shields.io/badge/all_contributors-43-orange.svg?style=flat-square)](#contributors)
[![All Contributors](https://img.shields.io/badge/all_contributors-45-orange.svg?style=flat-square)](#contributors)
[![PRs Welcome][prs-badge]][prs]

@@ -190,3 +190,3 @@ [![Chat][chat-badge]][chat]

Used to determine if the new `selectedItem` has changed compared to the
Used to determine if the new `selectedItem` has changed compared to the
previous `selectedItem` and properly update Downshift's internal state.

@@ -278,3 +278,3 @@

Called whenever the input value changes. Useful to use instead or in combination of `onStateChange` when `inputValue` is a controlled prop to [avoid issues with cursor positions](https://github.com/paypal/downshift/issues/217).
Called whenever the input value changes. Useful to use instead or in combination of `onStateChange` when `inputValue` is a controlled prop to [avoid issues with cursor positions](https://github.com/paypal/downshift/issues/217).

@@ -413,3 +413,3 @@ - `inputValue`: The current value of the input

| `getLabelProps` | `function({})` | returns the props you should apply to the `label` element that you render. |
| `getRootProps` | `function({})` | returns the props you should apply to the root element that you render. It can be optional. |
| `getRootProps` | `function({},{})` | returns the props you should apply to the root element that you render. It can be optional. |

@@ -432,2 +432,13 @@ #### `getRootProps`

If you're rendering a composite component, `Downshift` checks that
`getRootProps` is called and that `refKey` is a prop of the returned composite
component.
This is done to catch common causes of errors but, in some cases, the check
could fail even if the ref is correctly forwarded to the root DOM component.
In these cases, you can provide the object `{suppressRefError : true}` as the
second argument to `getRootProps` to completely bypass the check.
**Please use it with extreme care and only if you are absolutely sure that the
ref is correctly forwarded otherwise `Downshift` will unexpectedly fail.**
See issue paypal/downshift#235 for the discussion that lead to this.
#### `getInputProps`

@@ -658,10 +669,10 @@

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
| [<img src="https://avatars.githubusercontent.com/u/1500684?v=3" width="100px;"/><br /><sub><b>Kent C. Dodds</b></sub>](https://kentcdodds.com)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=kentcdodds "Code") [πŸ“–](https://github.com/paypal/downshift/commits?author=kentcdodds "Documentation") [πŸš‡](#infra-kentcdodds "Infrastructure (Hosting, Build-Tools, etc)") [⚠️](https://github.com/paypal/downshift/commits?author=kentcdodds "Tests") | [<img src="https://avatars0.githubusercontent.com/u/100200?v=4" width="100px;"/><br /><sub><b>Ryan Florence</b></sub>](http://twitter.com/ryanflorence)<br />[πŸ€”](#ideas-ryanflorence "Ideas, Planning, & Feedback") | [<img src="https://avatars3.githubusercontent.com/u/112170?v=4" width="100px;"/><br /><sub><b>Jared Forsyth</b></sub>](http://jaredforsyth.com)<br />[πŸ€”](#ideas-jaredly "Ideas, Planning, & Feedback") [πŸ“–](https://github.com/paypal/downshift/commits?author=jaredly "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/8162598?v=4" width="100px;"/><br /><sub><b>Jack Moore</b></sub>](https://github.com/jtmthf)<br />[πŸ’‘](#example-jtmthf "Examples") | [<img src="https://avatars1.githubusercontent.com/u/2762082?v=4" width="100px;"/><br /><sub><b>Travis Arnold</b></sub>](http://travisrayarnold.com)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=souporserious "Code") [πŸ“–](https://github.com/paypal/downshift/commits?author=souporserious "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/1045233?v=4" width="100px;"/><br /><sub><b>Marcy Sutton</b></sub>](http://marcysutton.com)<br />[πŸ›](https://github.com/paypal/downshift/issues?q=author%3Amarcysutton "Bug reports") [πŸ€”](#ideas-marcysutton "Ideas, Planning, & Feedback") | [<img src="https://avatars2.githubusercontent.com/u/244704?v=4" width="100px;"/><br /><sub><b>Jeremy Gayed</b></sub>](http://www.jeremygayed.com)<br />[πŸ’‘](#example-tizmagik "Examples") |
| [<img src="https://avatars.githubusercontent.com/u/1500684?v=3" width="100px;"/><br /><sub>Kent C. Dodds</sub>](https://kentcdodds.com)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=kentcdodds "Code") [πŸ“–](https://github.com/paypal/downshift/commits?author=kentcdodds "Documentation") [πŸš‡](#infra-kentcdodds "Infrastructure (Hosting, Build-Tools, etc)") [⚠️](https://github.com/paypal/downshift/commits?author=kentcdodds "Tests") | [<img src="https://avatars0.githubusercontent.com/u/100200?v=4" width="100px;"/><br /><sub>Ryan Florence</sub>](http://twitter.com/ryanflorence)<br />[πŸ€”](#ideas-ryanflorence "Ideas, Planning, & Feedback") | [<img src="https://avatars3.githubusercontent.com/u/112170?v=4" width="100px;"/><br /><sub>Jared Forsyth</sub>](http://jaredforsyth.com)<br />[πŸ€”](#ideas-jaredly "Ideas, Planning, & Feedback") [πŸ“–](https://github.com/paypal/downshift/commits?author=jaredly "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/8162598?v=4" width="100px;"/><br /><sub>Jack Moore</sub>](https://github.com/jtmthf)<br />[πŸ’‘](#example-jtmthf "Examples") | [<img src="https://avatars1.githubusercontent.com/u/2762082?v=4" width="100px;"/><br /><sub>Travis Arnold</sub>](http://travisrayarnold.com)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=souporserious "Code") [πŸ“–](https://github.com/paypal/downshift/commits?author=souporserious "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/1045233?v=4" width="100px;"/><br /><sub>Marcy Sutton</sub>](http://marcysutton.com)<br />[πŸ›](https://github.com/paypal/downshift/issues?q=author%3Amarcysutton "Bug reports") [πŸ€”](#ideas-marcysutton "Ideas, Planning, & Feedback") | [<img src="https://avatars2.githubusercontent.com/u/244704?v=4" width="100px;"/><br /><sub>Jeremy Gayed</sub>](http://www.jeremygayed.com)<br />[πŸ’‘](#example-tizmagik "Examples") |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| [<img src="https://avatars3.githubusercontent.com/u/6270048?v=4" width="100px;"/><br /><sub><b>Haroen Viaene</b></sub>](https://haroen.me)<br />[πŸ’‘](#example-Haroenv "Examples") | [<img src="https://avatars2.githubusercontent.com/u/15073300?v=4" width="100px;"/><br /><sub><b>monssef</b></sub>](https://github.com/rezof)<br />[πŸ’‘](#example-rezof "Examples") | [<img src="https://avatars2.githubusercontent.com/u/5382443?v=4" width="100px;"/><br /><sub><b>Federico Zivolo</b></sub>](https://fezvrasta.github.io)<br />[πŸ“–](https://github.com/paypal/downshift/commits?author=FezVrasta "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/746482?v=4" width="100px;"/><br /><sub><b>Divyendu Singh</b></sub>](https://divyendusingh.com)<br />[πŸ’‘](#example-divyenduz "Examples") [πŸ’»](https://github.com/paypal/downshift/commits?author=divyenduz "Code") [πŸ“–](https://github.com/paypal/downshift/commits?author=divyenduz "Documentation") [⚠️](https://github.com/paypal/downshift/commits?author=divyenduz "Tests") | [<img src="https://avatars1.githubusercontent.com/u/841955?v=4" width="100px;"/><br /><sub><b>Muhammad Salman</b></sub>](https://github.com/salmanmanekia)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=salmanmanekia "Code") | [<img src="https://avatars3.githubusercontent.com/u/10820159?v=4" width="100px;"/><br /><sub><b>JoΓ£o Alberto</b></sub>](https://twitter.com/psicotropidev)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=psicotropicos "Code") | [<img src="https://avatars0.githubusercontent.com/u/16327281?v=4" width="100px;"/><br /><sub><b>Bernard Lin</b></sub>](https://github.com/bernard-lin)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=bernard-lin "Code") [πŸ“–](https://github.com/paypal/downshift/commits?author=bernard-lin "Documentation") |
| [<img src="https://avatars1.githubusercontent.com/u/7330124?v=4" width="100px;"/><br /><sub><b>Geoff Davis</b></sub>](https://geoffdavis.info)<br />[πŸ’‘](#example-geoffdavis92 "Examples") | [<img src="https://avatars0.githubusercontent.com/u/3415488?v=4" width="100px;"/><br /><sub><b>Anup</b></sub>](https://github.com/reznord)<br />[πŸ“–](https://github.com/paypal/downshift/commits?author=reznord "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/340520?v=4" width="100px;"/><br /><sub><b>Ferdinand Salis</b></sub>](http://ferdinandsalis.com)<br />[πŸ›](https://github.com/paypal/downshift/issues?q=author%3Aferdinandsalis "Bug reports") [πŸ’»](https://github.com/paypal/downshift/commits?author=ferdinandsalis "Code") | [<img src="https://avatars2.githubusercontent.com/u/662750?v=4" width="100px;"/><br /><sub><b>Kye Hohenberger</b></sub>](https://github.com/tkh44)<br />[πŸ›](https://github.com/paypal/downshift/issues?q=author%3Atkh44 "Bug reports") | [<img src="https://avatars0.githubusercontent.com/u/1443499?v=4" width="100px;"/><br /><sub><b>Julien Goux</b></sub>](https://github.com/jgoux)<br />[πŸ›](https://github.com/paypal/downshift/issues?q=author%3Ajgoux "Bug reports") [πŸ’»](https://github.com/paypal/downshift/commits?author=jgoux "Code") [⚠️](https://github.com/paypal/downshift/commits?author=jgoux "Tests") | [<img src="https://avatars2.githubusercontent.com/u/9586897?v=4" width="100px;"/><br /><sub><b>Joachim Seminck</b></sub>](https://github.com/jseminck)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=jseminck "Code") | [<img src="https://avatars3.githubusercontent.com/u/954596?v=4" width="100px;"/><br /><sub><b>Jesse Harlin</b></sub>](http://jesseharlin.net/)<br />[πŸ›](https://github.com/paypal/downshift/issues?q=author%3Athe-simian "Bug reports") [πŸ’‘](#example-the-simian "Examples") |
| [<img src="https://avatars0.githubusercontent.com/u/1402095?v=4" width="100px;"/><br /><sub><b>Matt Parrish</b></sub>](https://github.com/pbomb)<br />[πŸ”§](#tool-pbomb "Tools") [πŸ‘€](#review-pbomb "Reviewed Pull Requests") | [<img src="https://avatars1.githubusercontent.com/u/11661846?v=4" width="100px;"/><br /><sub><b>thom</b></sub>](http://thom.kr)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=thomhos "Code") | [<img src="https://avatars2.githubusercontent.com/u/1088312?v=4" width="100px;"/><br /><sub><b>Vu Tran</b></sub>](http://twitter.com/tranvu)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=vutran "Code") | [<img src="https://avatars1.githubusercontent.com/u/74193?v=4" width="100px;"/><br /><sub><b>Codie Mullins</b></sub>](https://github.com/codiemullins)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=codiemullins "Code") [πŸ’‘](#example-codiemullins "Examples") | [<img src="https://avatars3.githubusercontent.com/u/12202757?v=4" width="100px;"/><br /><sub><b>Mohammad Rajabifard</b></sub>](https://morajabi.me)<br />[πŸ“–](https://github.com/paypal/downshift/commits?author=morajabi "Documentation") [πŸ€”](#ideas-morajabi "Ideas, Planning, & Feedback") | [<img src="https://avatars3.githubusercontent.com/u/9488719?v=4" width="100px;"/><br /><sub><b>Frank Tan</b></sub>](https://github.com/tansongyang)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=tansongyang "Code") | [<img src="https://avatars3.githubusercontent.com/u/5093058?v=4" width="100px;"/><br /><sub><b>Kier Borromeo</b></sub>](https://kierb.com)<br />[πŸ’‘](#example-srph "Examples") |
| [<img src="https://avatars1.githubusercontent.com/u/8969456?v=4" width="100px;"/><br /><sub><b>Paul Veevers</b></sub>](https://github.com/paul-veevers)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=paul-veevers "Code") | [<img src="https://avatars2.githubusercontent.com/u/13622298?v=4" width="100px;"/><br /><sub><b>Ron Cruz</b></sub>](https://github.com/Ronolibert)<br />[πŸ“–](https://github.com/paypal/downshift/commits?author=Ronolibert "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/13605633?v=4" width="100px;"/><br /><sub><b>Rick McGavin</b></sub>](http://rickmcgavin.github.io)<br />[πŸ“–](https://github.com/paypal/downshift/commits?author=rickMcGavin "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/869669?v=4" width="100px;"/><br /><sub><b>Jelle Versele</b></sub>](http://twitter.com/vejersele)<br />[πŸ’‘](#example-vejersele "Examples") | [<img src="https://avatars1.githubusercontent.com/u/202773?v=4" width="100px;"/><br /><sub><b>Brent Ertz</b></sub>](https://github.com/brentertz)<br />[πŸ€”](#ideas-brentertz "Ideas, Planning, & Feedback") | [<img src="https://avatars3.githubusercontent.com/u/8015514?v=4" width="100px;"/><br /><sub><b>Justice Mba </b></sub>](https://github.com/Dajust)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=Dajust "Code") [πŸ“–](https://github.com/paypal/downshift/commits?author=Dajust "Documentation") [πŸ€”](#ideas-Dajust "Ideas, Planning, & Feedback") | [<img src="https://avatars2.githubusercontent.com/u/3925281?v=4" width="100px;"/><br /><sub><b>Mark Ellis</b></sub>](http://mfellis.com)<br />[πŸ€”](#ideas-ellismarkf "Ideas, Planning, & Feedback") |
| [<img src="https://avatars1.githubusercontent.com/u/3241922?v=4" width="100px;"/><br /><sub><b>usΝ‘anΜΈdf͘rien͜dsΝ </b></sub>](http://ronak.io/)<br />[πŸ›](https://github.com/paypal/downshift/issues?q=author%3Ausandfriends "Bug reports") [πŸ’»](https://github.com/paypal/downshift/commits?author=usandfriends "Code") [⚠️](https://github.com/paypal/downshift/commits?author=usandfriends "Tests") | [<img src="https://avatars0.githubusercontent.com/u/474248?v=4" width="100px;"/><br /><sub><b>Robin Drexler</b></sub>](https://www.robin-drexler.com/)<br />[πŸ›](https://github.com/paypal/downshift/issues?q=author%3Arobin-drexler "Bug reports") [πŸ’»](https://github.com/paypal/downshift/commits?author=robin-drexler "Code") | [<img src="https://avatars0.githubusercontent.com/u/7406639?v=4" width="100px;"/><br /><sub><b>Arturo Romero</b></sub>](http://arturoromero.info/)<br />[πŸ’‘](#example-arturoromeroslc "Examples") | [<img src="https://avatars0.githubusercontent.com/u/3998604?v=4" width="100px;"/><br /><sub><b>Dave Garwacke</b></sub>](http://www.warbyparker.com)<br />[πŸ“–](https://github.com/paypal/downshift/commits?author=ifyoumakeit "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/11758660?v=4" width="100px;"/><br /><sub><b>Ivan Pazhitnykh</b></sub>](http://linkedin.com/in/drapegnik)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=Drapegnik "Code") [⚠️](https://github.com/paypal/downshift/commits?author=Drapegnik "Tests") | [<img src="https://avatars0.githubusercontent.com/u/61776?v=4" width="100px;"/><br /><sub><b>Luis Merino</b></sub>](https://github.com/Rendez)<br />[πŸ“–](https://github.com/paypal/downshift/commits?author=Rendez "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/8746094?v=4" width="100px;"/><br /><sub><b>Andrew Hansen</b></sub>](http://twitter.com/arahansen)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=arahansen "Code") [⚠️](https://github.com/paypal/downshift/commits?author=arahansen "Tests") |
| [<img src="https://avatars3.githubusercontent.com/u/20307225?v=4" width="100px;"/><br /><sub><b>John Whiles</b></sub>](http://www.johnwhiles.com)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=Jwhiles "Code") |
| [<img src="https://avatars3.githubusercontent.com/u/6270048?v=4" width="100px;"/><br /><sub>Haroen Viaene</sub>](https://haroen.me)<br />[πŸ’‘](#example-Haroenv "Examples") | [<img src="https://avatars2.githubusercontent.com/u/15073300?v=4" width="100px;"/><br /><sub>monssef</sub>](https://github.com/rezof)<br />[πŸ’‘](#example-rezof "Examples") | [<img src="https://avatars2.githubusercontent.com/u/5382443?v=4" width="100px;"/><br /><sub>Federico Zivolo</sub>](https://fezvrasta.github.io)<br />[πŸ“–](https://github.com/paypal/downshift/commits?author=FezVrasta "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/746482?v=4" width="100px;"/><br /><sub>Divyendu Singh</sub>](https://divyendusingh.com)<br />[πŸ’‘](#example-divyenduz "Examples") [πŸ’»](https://github.com/paypal/downshift/commits?author=divyenduz "Code") [πŸ“–](https://github.com/paypal/downshift/commits?author=divyenduz "Documentation") [⚠️](https://github.com/paypal/downshift/commits?author=divyenduz "Tests") | [<img src="https://avatars1.githubusercontent.com/u/841955?v=4" width="100px;"/><br /><sub>Muhammad Salman</sub>](https://github.com/salmanmanekia)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=salmanmanekia "Code") | [<img src="https://avatars3.githubusercontent.com/u/10820159?v=4" width="100px;"/><br /><sub>JoΓ£o Alberto</sub>](https://twitter.com/psicotropidev)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=psicotropicos "Code") | [<img src="https://avatars0.githubusercontent.com/u/16327281?v=4" width="100px;"/><br /><sub>Bernard Lin</sub>](https://github.com/bernard-lin)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=bernard-lin "Code") [πŸ“–](https://github.com/paypal/downshift/commits?author=bernard-lin "Documentation") |
| [<img src="https://avatars1.githubusercontent.com/u/7330124?v=4" width="100px;"/><br /><sub>Geoff Davis</sub>](https://geoffdavis.info)<br />[πŸ’‘](#example-geoffdavis92 "Examples") | [<img src="https://avatars0.githubusercontent.com/u/3415488?v=4" width="100px;"/><br /><sub>Anup</sub>](https://github.com/reznord)<br />[πŸ“–](https://github.com/paypal/downshift/commits?author=reznord "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/340520?v=4" width="100px;"/><br /><sub>Ferdinand Salis</sub>](http://ferdinandsalis.com)<br />[πŸ›](https://github.com/paypal/downshift/issues?q=author%3Aferdinandsalis "Bug reports") [πŸ’»](https://github.com/paypal/downshift/commits?author=ferdinandsalis "Code") | [<img src="https://avatars2.githubusercontent.com/u/662750?v=4" width="100px;"/><br /><sub>Kye Hohenberger</sub>](https://github.com/tkh44)<br />[πŸ›](https://github.com/paypal/downshift/issues?q=author%3Atkh44 "Bug reports") | [<img src="https://avatars0.githubusercontent.com/u/1443499?v=4" width="100px;"/><br /><sub>Julien Goux</sub>](https://github.com/jgoux)<br />[πŸ›](https://github.com/paypal/downshift/issues?q=author%3Ajgoux "Bug reports") [πŸ’»](https://github.com/paypal/downshift/commits?author=jgoux "Code") [⚠️](https://github.com/paypal/downshift/commits?author=jgoux "Tests") | [<img src="https://avatars2.githubusercontent.com/u/9586897?v=4" width="100px;"/><br /><sub>Joachim Seminck</sub>](https://github.com/jseminck)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=jseminck "Code") | [<img src="https://avatars3.githubusercontent.com/u/954596?v=4" width="100px;"/><br /><sub>Jesse Harlin</sub>](http://jesseharlin.net/)<br />[πŸ›](https://github.com/paypal/downshift/issues?q=author%3Athe-simian "Bug reports") [πŸ’‘](#example-the-simian "Examples") |
| [<img src="https://avatars0.githubusercontent.com/u/1402095?v=4" width="100px;"/><br /><sub>Matt Parrish</sub>](https://github.com/pbomb)<br />[πŸ”§](#tool-pbomb "Tools") [πŸ‘€](#review-pbomb "Reviewed Pull Requests") | [<img src="https://avatars1.githubusercontent.com/u/11661846?v=4" width="100px;"/><br /><sub>thom</sub>](http://thom.kr)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=thomhos "Code") | [<img src="https://avatars2.githubusercontent.com/u/1088312?v=4" width="100px;"/><br /><sub>Vu Tran</sub>](http://twitter.com/tranvu)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=vutran "Code") | [<img src="https://avatars1.githubusercontent.com/u/74193?v=4" width="100px;"/><br /><sub>Codie Mullins</sub>](https://github.com/codiemullins)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=codiemullins "Code") [πŸ’‘](#example-codiemullins "Examples") | [<img src="https://avatars3.githubusercontent.com/u/12202757?v=4" width="100px;"/><br /><sub>Mohammad Rajabifard</sub>](https://morajabi.me)<br />[πŸ“–](https://github.com/paypal/downshift/commits?author=morajabi "Documentation") [πŸ€”](#ideas-morajabi "Ideas, Planning, & Feedback") | [<img src="https://avatars3.githubusercontent.com/u/9488719?v=4" width="100px;"/><br /><sub>Frank Tan</sub>](https://github.com/tansongyang)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=tansongyang "Code") | [<img src="https://avatars3.githubusercontent.com/u/5093058?v=4" width="100px;"/><br /><sub>Kier Borromeo</sub>](https://kierb.com)<br />[πŸ’‘](#example-srph "Examples") |
| [<img src="https://avatars1.githubusercontent.com/u/8969456?v=4" width="100px;"/><br /><sub>Paul Veevers</sub>](https://github.com/paul-veevers)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=paul-veevers "Code") | [<img src="https://avatars2.githubusercontent.com/u/13622298?v=4" width="100px;"/><br /><sub>Ron Cruz</sub>](https://github.com/Ronolibert)<br />[πŸ“–](https://github.com/paypal/downshift/commits?author=Ronolibert "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/13605633?v=4" width="100px;"/><br /><sub>Rick McGavin</sub>](http://rickmcgavin.github.io)<br />[πŸ“–](https://github.com/paypal/downshift/commits?author=rickMcGavin "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/869669?v=4" width="100px;"/><br /><sub>Jelle Versele</sub>](http://twitter.com/vejersele)<br />[πŸ’‘](#example-vejersele "Examples") | [<img src="https://avatars1.githubusercontent.com/u/202773?v=4" width="100px;"/><br /><sub>Brent Ertz</sub>](https://github.com/brentertz)<br />[πŸ€”](#ideas-brentertz "Ideas, Planning, & Feedback") | [<img src="https://avatars3.githubusercontent.com/u/8015514?v=4" width="100px;"/><br /><sub>Justice Mba </sub>](https://github.com/Dajust)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=Dajust "Code") [πŸ“–](https://github.com/paypal/downshift/commits?author=Dajust "Documentation") [πŸ€”](#ideas-Dajust "Ideas, Planning, & Feedback") | [<img src="https://avatars2.githubusercontent.com/u/3925281?v=4" width="100px;"/><br /><sub>Mark Ellis</sub>](http://mfellis.com)<br />[πŸ€”](#ideas-ellismarkf "Ideas, Planning, & Feedback") |
| [<img src="https://avatars1.githubusercontent.com/u/3241922?v=4" width="100px;"/><br /><sub>usΝ‘anΜΈdf͘rien͜dsΝ </sub>](http://ronak.io/)<br />[πŸ›](https://github.com/paypal/downshift/issues?q=author%3Ausandfriends "Bug reports") [πŸ’»](https://github.com/paypal/downshift/commits?author=usandfriends "Code") [⚠️](https://github.com/paypal/downshift/commits?author=usandfriends "Tests") | [<img src="https://avatars0.githubusercontent.com/u/474248?v=4" width="100px;"/><br /><sub>Robin Drexler</sub>](https://www.robin-drexler.com/)<br />[πŸ›](https://github.com/paypal/downshift/issues?q=author%3Arobin-drexler "Bug reports") [πŸ’»](https://github.com/paypal/downshift/commits?author=robin-drexler "Code") | [<img src="https://avatars0.githubusercontent.com/u/7406639?v=4" width="100px;"/><br /><sub>Arturo Romero</sub>](http://arturoromero.info/)<br />[πŸ’‘](#example-arturoromeroslc "Examples") | [<img src="https://avatars1.githubusercontent.com/u/275483?v=4" width="100px;"/><br /><sub>yp</sub>](http://algolab.eu/pirola)<br />[πŸ›](https://github.com/paypal/downshift/issues?q=author%3Ayp "Bug reports") [πŸ’»](https://github.com/paypal/downshift/commits?author=yp "Code") [⚠️](https://github.com/paypal/downshift/commits?author=yp "Tests") | [<img src="https://avatars0.githubusercontent.com/u/3998604?v=4" width="100px;"/><br /><sub>Dave Garwacke</sub>](http://www.warbyparker.com)<br />[πŸ“–](https://github.com/paypal/downshift/commits?author=ifyoumakeit "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/11758660?v=4" width="100px;"/><br /><sub>Ivan Pazhitnykh</sub>](http://linkedin.com/in/drapegnik)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=Drapegnik "Code") [⚠️](https://github.com/paypal/downshift/commits?author=Drapegnik "Tests") | [<img src="https://avatars0.githubusercontent.com/u/61776?v=4" width="100px;"/><br /><sub>Luis Merino</sub>](https://github.com/Rendez)<br />[πŸ“–](https://github.com/paypal/downshift/commits?author=Rendez "Documentation") |
| [<img src="https://avatars0.githubusercontent.com/u/8746094?v=4" width="100px;"/><br /><sub>Andrew Hansen</sub>](http://twitter.com/arahansen)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=arahansen "Code") [⚠️](https://github.com/paypal/downshift/commits?author=arahansen "Tests") | [<img src="https://avatars3.githubusercontent.com/u/20307225?v=4" width="100px;"/><br /><sub>John Whiles</sub>](http://www.johnwhiles.com)<br />[πŸ’»](https://github.com/paypal/downshift/commits?author=Jwhiles "Code") | [<img src="https://avatars1.githubusercontent.com/u/1288694?v=4" width="100px;"/><br /><sub>Justin Hall</sub>](https://github.com/wKovacs64)<br />[πŸš‡](#infra-wKovacs64 "Infrastructure (Hosting, Build-Tools, etc)") |
<!-- ALL-CONTRIBUTORS-LIST:END -->

@@ -668,0 +679,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc