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

react-autowhatever

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-autowhatever - npm Package Compare versions

Comparing version 7.0.0 to 8.0.0

279

dist/Autowhatever.js

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

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();

@@ -14,2 +12,4 @@

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = require('react');

@@ -50,4 +50,6 @@

};
var defaultRenderItemsContainer = function defaultRenderItemsContainer(props) {
return _react2.default.createElement('div', props);
var defaultRenderItemsContainer = function defaultRenderItemsContainer(_ref) {
var children = _ref.children,
containerProps = _ref.containerProps;
return _react2.default.createElement('div', _extends({ children: children }, containerProps));
};

@@ -58,7 +60,11 @@ var defaultTheme = {

input: 'react-autowhatever__input',
inputOpen: 'react-autowhatever__input--open',
inputFocus: 'react-autowhatever__input--focus',
itemsContainer: 'react-autowhatever__items-container',
itemsContainerOpen: 'react-autowhatever__items-container--open',
itemsList: 'react-autowhatever__items-list',
item: 'react-autowhatever__item',
itemFocused: 'react-autowhatever__item--focused',
itemHighlight: 'react-autowhatever__item--highlight',
sectionContainer: 'react-autowhatever__section-container',
sectionContainerFirst: 'react-autowhatever__section-container--first',
sectionTitle: 'react-autowhatever__section-title'

@@ -75,13 +81,88 @@ };

_this.focusedItem = null;
_this.storeInputReference = function (input) {
if (input !== null) {
_this.input = input;
}
};
_this.storeItemsContainerReference = function (itemsContainer) {
if (itemsContainer !== null) {
_this.itemsContainer = itemsContainer;
}
};
_this.onHighlightedItemChange = function (highlightedItem) {
_this.highlightedItem = highlightedItem;
};
_this.getItemId = function (sectionIndex, itemIndex) {
if (itemIndex === null) {
return null;
}
var id = _this.props.id;
var section = sectionIndex === null ? '' : 'section-' + sectionIndex;
return 'react-autowhatever-' + id + '-' + section + '-item-' + itemIndex;
};
_this.onFocus = function (event) {
var inputProps = _this.props.inputProps;
_this.setState({
isInputFocused: true
});
inputProps.onFocus && inputProps.onFocus(event);
};
_this.onBlur = function (event) {
var inputProps = _this.props.inputProps;
_this.setState({
isInputFocused: false
});
inputProps.onBlur && inputProps.onBlur(event);
};
_this.onKeyDown = function (event) {
var _this$props = _this.props,
inputProps = _this$props.inputProps,
highlightedSectionIndex = _this$props.highlightedSectionIndex,
highlightedItemIndex = _this$props.highlightedItemIndex;
switch (event.key) {
case 'ArrowDown':
case 'ArrowUp':
{
var nextPrev = event.key === 'ArrowDown' ? 'next' : 'prev';
var _this$sectionIterator = _this.sectionIterator[nextPrev]([highlightedSectionIndex, highlightedItemIndex]),
_this$sectionIterator2 = _slicedToArray(_this$sectionIterator, 2),
newHighlightedSectionIndex = _this$sectionIterator2[0],
newHighlightedItemIndex = _this$sectionIterator2[1];
inputProps.onKeyDown(event, { newHighlightedSectionIndex: newHighlightedSectionIndex, newHighlightedItemIndex: newHighlightedItemIndex });
break;
}
default:
inputProps.onKeyDown(event, { highlightedSectionIndex: highlightedSectionIndex, highlightedItemIndex: highlightedItemIndex });
}
};
_this.highlightedItem = null;
_this.state = {
isInputFocused: false
};
_this.setSectionsItems(props);
_this.setSectionIterator(props);
_this.setTheme(props);
_this.onKeyDown = _this.onKeyDown.bind(_this);
_this.storeInputReference = _this.storeInputReference.bind(_this);
_this.storeItemsContainerReference = _this.storeItemsContainerReference.bind(_this);
_this.onFocusedItemChange = _this.onFocusedItemChange.bind(_this);
_this.getItemId = _this.getItemId.bind(_this);
return _this;

@@ -93,3 +174,3 @@ }

value: function componentDidMount() {
this.ensureFocusedItemIsVisible();
this.ensureHighlightedItemIsVisible();
}

@@ -114,3 +195,3 @@ }, {

value: function componentDidUpdate() {
this.ensureFocusedItemIsVisible();
this.ensureHighlightedItemIsVisible();
}

@@ -146,34 +227,2 @@ }, {

}, {
key: 'storeInputReference',
value: function storeInputReference(input) {
if (input !== null) {
this.input = input;
}
}
}, {
key: 'storeItemsContainerReference',
value: function storeItemsContainerReference(itemsContainer) {
if (itemsContainer !== null) {
this.itemsContainer = itemsContainer;
}
}
}, {
key: 'onFocusedItemChange',
value: function onFocusedItemChange(focusedItem) {
this.focusedItem = focusedItem;
}
}, {
key: 'getItemId',
value: function getItemId(sectionIndex, itemIndex) {
if (itemIndex === null) {
return null;
}
var id = this.props.id;
var section = sectionIndex === null ? '' : 'section-' + sectionIndex;
return 'react-autowhatever-' + id + '-' + section + '-item-' + itemIndex;
}
}, {
key: 'renderSections',

@@ -188,12 +237,12 @@ value: function renderSections() {

var theme = this.theme;
var _props = this.props;
var id = _props.id;
var items = _props.items;
var renderItem = _props.renderItem;
var renderItemData = _props.renderItemData;
var shouldRenderSection = _props.shouldRenderSection;
var renderSectionTitle = _props.renderSectionTitle;
var focusedSectionIndex = _props.focusedSectionIndex;
var focusedItemIndex = _props.focusedItemIndex;
var itemProps = _props.itemProps;
var _props = this.props,
id = _props.id,
items = _props.items,
renderItem = _props.renderItem,
renderItemData = _props.renderItemData,
shouldRenderSection = _props.shouldRenderSection,
renderSectionTitle = _props.renderSectionTitle,
highlightedSectionIndex = _props.highlightedSectionIndex,
highlightedItemIndex = _props.highlightedItemIndex,
itemProps = _props.itemProps;

@@ -208,2 +257,3 @@

var sectionKeyPrefix = keyPrefix + 'section-' + sectionIndex + '-';
var isFirstSection = sectionIndex === 0;

@@ -214,3 +264,3 @@ // `key` is provided by theme()

'div',
theme(sectionKeyPrefix + 'container', 'sectionContainer'),
theme(sectionKeyPrefix + 'container', 'sectionContainer', isFirstSection && 'sectionContainerFirst'),
_react2.default.createElement(_SectionTitle2.default, {

@@ -228,4 +278,4 @@ section: section,

sectionIndex: sectionIndex,
focusedItemIndex: focusedSectionIndex === sectionIndex ? focusedItemIndex : null,
onFocusedItemChange: _this2.onFocusedItemChange,
highlightedItemIndex: highlightedSectionIndex === sectionIndex ? highlightedItemIndex : null,
onHighlightedItemChange: _this2.onHighlightedItemChange,
getItemId: _this2.getItemId,

@@ -251,9 +301,9 @@ theme: theme,

var theme = this.theme;
var _props2 = this.props;
var id = _props2.id;
var renderItem = _props2.renderItem;
var renderItemData = _props2.renderItemData;
var focusedSectionIndex = _props2.focusedSectionIndex;
var focusedItemIndex = _props2.focusedItemIndex;
var itemProps = _props2.itemProps;
var _props2 = this.props,
id = _props2.id,
renderItem = _props2.renderItem,
renderItemData = _props2.renderItemData,
highlightedSectionIndex = _props2.highlightedSectionIndex,
highlightedItemIndex = _props2.highlightedItemIndex,
itemProps = _props2.itemProps;

@@ -266,4 +316,4 @@

renderItemData: renderItemData,
focusedItemIndex: focusedSectionIndex === null ? focusedItemIndex : null,
onFocusedItemChange: this.onFocusedItemChange,
highlightedItemIndex: highlightedSectionIndex === null ? highlightedItemIndex : null,
onHighlightedItemChange: this.onHighlightedItemChange,
getItemId: this.getItemId,

@@ -275,39 +325,8 @@ theme: theme,

}, {
key: 'onKeyDown',
value: function onKeyDown(event) {
var _props3 = this.props;
var inputProps = _props3.inputProps;
var focusedSectionIndex = _props3.focusedSectionIndex;
var focusedItemIndex = _props3.focusedItemIndex;
key: 'ensureHighlightedItemIsVisible',
value: function ensureHighlightedItemIsVisible() {
var highlightedItem = this.highlightedItem;
switch (event.key) {
case 'ArrowDown':
case 'ArrowUp':
{
var nextPrev = event.key === 'ArrowDown' ? 'next' : 'prev';
var _sectionIterator$next = this.sectionIterator[nextPrev]([focusedSectionIndex, focusedItemIndex]);
var _sectionIterator$next2 = _slicedToArray(_sectionIterator$next, 2);
var newFocusedSectionIndex = _sectionIterator$next2[0];
var newFocusedItemIndex = _sectionIterator$next2[1];
inputProps.onKeyDown(event, { newFocusedSectionIndex: newFocusedSectionIndex, newFocusedItemIndex: newFocusedItemIndex });
break;
}
default:
inputProps.onKeyDown(event, { focusedSectionIndex: focusedSectionIndex, focusedItemIndex: focusedItemIndex });
}
}
}, {
key: 'ensureFocusedItemIsVisible',
value: function ensureFocusedItemIsVisible() {
var focusedItem = this.focusedItem;
if (!focusedItem) {
if (!highlightedItem) {
return;

@@ -318,3 +337,3 @@ }

var itemOffsetRelativeToContainer = focusedItem.offsetParent === itemsContainer ? focusedItem.offsetTop : focusedItem.offsetTop - itemsContainer.offsetTop;
var itemOffsetRelativeToContainer = highlightedItem.offsetParent === itemsContainer ? highlightedItem.offsetTop : highlightedItem.offsetTop - itemsContainer.offsetTop;

@@ -326,5 +345,5 @@ var scrollTop = itemsContainer.scrollTop; // Top of the visible area

scrollTop = itemOffsetRelativeToContainer;
} else if (itemOffsetRelativeToContainer + focusedItem.offsetHeight > scrollTop + itemsContainer.offsetHeight) {
} else if (itemOffsetRelativeToContainer + highlightedItem.offsetHeight > scrollTop + itemsContainer.offsetHeight) {
// Item is off the bottom of the visible area
scrollTop = itemOffsetRelativeToContainer + focusedItem.offsetHeight - itemsContainer.offsetHeight;
scrollTop = itemOffsetRelativeToContainer + highlightedItem.offsetHeight - itemsContainer.offsetHeight;
}

@@ -340,13 +359,14 @@

var theme = this.theme;
var _props4 = this.props;
var id = _props4.id;
var multiSection = _props4.multiSection;
var renderInputComponent = _props4.renderInputComponent;
var renderItemsContainer = _props4.renderItemsContainer;
var focusedSectionIndex = _props4.focusedSectionIndex;
var focusedItemIndex = _props4.focusedItemIndex;
var _props3 = this.props,
id = _props3.id,
multiSection = _props3.multiSection,
renderInputComponent = _props3.renderInputComponent,
renderItemsContainer = _props3.renderItemsContainer,
highlightedSectionIndex = _props3.highlightedSectionIndex,
highlightedItemIndex = _props3.highlightedItemIndex;
var isInputFocused = this.state.isInputFocused;
var renderedItems = multiSection ? this.renderSections() : this.renderItems();
var isOpen = renderedItems !== null;
var ariaActivedescendant = this.getItemId(focusedSectionIndex, focusedItemIndex);
var ariaActivedescendant = this.getItemId(highlightedSectionIndex, highlightedItemIndex);
var containerProps = theme('react-autowhatever-' + id + '-container', 'container', isOpen && 'containerOpen');

@@ -364,12 +384,16 @@ var itemsContainerId = 'react-autowhatever-' + id;

'aria-activedescendant': ariaActivedescendant
}, theme('react-autowhatever-' + id + '-input', 'input'), this.props.inputProps, {
}, theme('react-autowhatever-' + id + '-input', 'input', isOpen && 'inputOpen', isInputFocused && 'inputFocus'), this.props.inputProps, {
onFocus: this.onFocus,
onBlur: this.onBlur,
onKeyDown: this.props.inputProps.onKeyDown && this.onKeyDown,
ref: this.storeInputReference
}));
var itemsContainer = renderItemsContainer(_extends({
id: itemsContainerId
}, theme('react-autowhatever-' + id + '-items-container', 'itemsContainer'), {
ref: this.storeItemsContainerReference,
children: renderedItems
}));
var itemsContainer = renderItemsContainer({
children: renderedItems,
containerProps: _extends({
id: itemsContainerId
}, theme('react-autowhatever-' + id + '-items-container', 'itemsContainer', isOpen && 'itemsContainerOpen'), {
ref: this.storeItemsContainerReference
})
});

@@ -391,5 +415,5 @@ return _react2.default.createElement(

multiSection: _react.PropTypes.bool, // Indicates whether a multi section layout should be rendered.
renderInputComponent: _react.PropTypes.func, // Renders the input component.
renderInputComponent: _react.PropTypes.func, // When specified, it is used to render the input element.
renderItemsContainer: _react.PropTypes.func, // Renders the items container.
items: _react.PropTypes.array.isRequired, // Array of items or sections to render.
renderItemsContainer: _react.PropTypes.func, // Renders the items container.
renderItem: _react.PropTypes.func, // This function renders a single item.

@@ -400,8 +424,7 @@ renderItemData: _react.PropTypes.object, // Arbitrary data that will be passed to renderItem()

getSectionItems: _react.PropTypes.func, // This function gets a section and returns its items, which will be passed into `renderItem` for rendering.
inputComponent: _react.PropTypes.func, // When specified, it is used to render the input element
inputProps: _react.PropTypes.object, // Arbitrary input props
itemProps: _react.PropTypes.oneOfType([// Arbitrary item props
_react.PropTypes.object, _react.PropTypes.func]),
focusedSectionIndex: _react.PropTypes.number, // Section index of the focused item
focusedItemIndex: _react.PropTypes.number, // Focused item index (within a section)
highlightedSectionIndex: _react.PropTypes.number, // Section index of the highlighted item
highlightedItemIndex: _react.PropTypes.number, // Highlighted item index (within a section)
theme: _react.PropTypes.oneOfType([// Styles. See: https://github.com/markdalgleish/react-themeable

@@ -428,6 +451,6 @@ _react.PropTypes.object, _react.PropTypes.array])

itemProps: emptyObject,
focusedSectionIndex: null,
focusedItemIndex: null,
highlightedSectionIndex: null,
highlightedItemIndex: null,
theme: defaultTheme
};
exports.default = Autowhatever;

@@ -33,65 +33,51 @@ 'use strict';

function Item() {
_classCallCheck(this, Item);
var _ref;
var _this = _possibleConstructorReturn(this, (Item.__proto__ || Object.getPrototypeOf(Item)).call(this));
var _temp, _this, _ret;
_this.storeItemReference = _this.storeItemReference.bind(_this);
_this.onMouseEnter = _this.onMouseEnter.bind(_this);
_this.onMouseLeave = _this.onMouseLeave.bind(_this);
_this.onMouseDown = _this.onMouseDown.bind(_this);
_this.onClick = _this.onClick.bind(_this);
return _this;
}
_classCallCheck(this, Item);
_createClass(Item, [{
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps) {
return (0, _compareObjects2.default)(nextProps, this.props, ['renderItemData']);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
}, {
key: 'storeItemReference',
value: function storeItemReference(item) {
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Item.__proto__ || Object.getPrototypeOf(Item)).call.apply(_ref, [this].concat(args))), _this), _this.storeItemReference = function (item) {
if (item !== null) {
this.item = item;
_this.item = item;
}
}
}, {
key: 'onMouseEnter',
value: function onMouseEnter(event) {
var _props = this.props;
var sectionIndex = _props.sectionIndex;
var itemIndex = _props.itemIndex;
}, _this.onMouseEnter = function (event) {
var _this$props = _this.props,
sectionIndex = _this$props.sectionIndex,
itemIndex = _this$props.itemIndex;
this.props.onMouseEnter(event, { sectionIndex: sectionIndex, itemIndex: itemIndex });
}
}, {
key: 'onMouseLeave',
value: function onMouseLeave(event) {
var _props2 = this.props;
var sectionIndex = _props2.sectionIndex;
var itemIndex = _props2.itemIndex;
_this.props.onMouseEnter(event, { sectionIndex: sectionIndex, itemIndex: itemIndex });
}, _this.onMouseLeave = function (event) {
var _this$props2 = _this.props,
sectionIndex = _this$props2.sectionIndex,
itemIndex = _this$props2.itemIndex;
this.props.onMouseLeave(event, { sectionIndex: sectionIndex, itemIndex: itemIndex });
}
}, {
key: 'onMouseDown',
value: function onMouseDown(event) {
var _props3 = this.props;
var sectionIndex = _props3.sectionIndex;
var itemIndex = _props3.itemIndex;
_this.props.onMouseLeave(event, { sectionIndex: sectionIndex, itemIndex: itemIndex });
}, _this.onMouseDown = function (event) {
var _this$props3 = _this.props,
sectionIndex = _this$props3.sectionIndex,
itemIndex = _this$props3.itemIndex;
this.props.onMouseDown(event, { sectionIndex: sectionIndex, itemIndex: itemIndex });
}
}, {
key: 'onClick',
value: function onClick(event) {
var _props4 = this.props;
var sectionIndex = _props4.sectionIndex;
var itemIndex = _props4.itemIndex;
_this.props.onMouseDown(event, { sectionIndex: sectionIndex, itemIndex: itemIndex });
}, _this.onClick = function (event) {
var _this$props4 = _this.props,
sectionIndex = _this$props4.sectionIndex,
itemIndex = _this$props4.itemIndex;
this.props.onClick(event, { sectionIndex: sectionIndex, itemIndex: itemIndex });
_this.props.onClick(event, { sectionIndex: sectionIndex, itemIndex: itemIndex });
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Item, [{
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps) {
return (0, _compareObjects2.default)(nextProps, this.props, ['renderItemData']);
}

@@ -101,9 +87,8 @@ }, {

value: function render() {
var _props5 = this.props;
var item = _props5.item;
var renderItem = _props5.renderItem;
var renderItemData = _props5.renderItemData;
var _props = this.props,
item = _props.item,
renderItem = _props.renderItem,
renderItemData = _props.renderItemData,
restProps = _objectWithoutProperties(_props, ['item', 'renderItem', 'renderItemData']);
var restProps = _objectWithoutProperties(_props5, ['item', 'renderItem', 'renderItemData']);
delete restProps.sectionIndex;

@@ -110,0 +95,0 @@ delete restProps.itemIndex;

@@ -35,8 +35,15 @@ 'use strict';

function ItemsList() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, ItemsList);
var _this = _possibleConstructorReturn(this, (ItemsList.__proto__ || Object.getPrototypeOf(ItemsList)).call(this));
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this.storeFocusedItemReference = _this.storeFocusedItemReference.bind(_this);
return _this;
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ItemsList.__proto__ || Object.getPrototypeOf(ItemsList)).call.apply(_ref, [this].concat(args))), _this), _this.storeHighlightedItemReference = function (highlightedItem) {
_this.props.onHighlightedItemChange(highlightedItem === null ? null : highlightedItem.item);
}, _temp), _possibleConstructorReturn(_this, _ret);
}

@@ -50,7 +57,2 @@

}, {
key: 'storeFocusedItemReference',
value: function storeFocusedItemReference(focusedItem) {
this.props.onFocusedItemChange(focusedItem === null ? null : focusedItem.item);
}
}, {
key: 'render',

@@ -60,12 +62,12 @@ value: function render() {

var _props = this.props;
var items = _props.items;
var itemProps = _props.itemProps;
var renderItem = _props.renderItem;
var renderItemData = _props.renderItemData;
var sectionIndex = _props.sectionIndex;
var focusedItemIndex = _props.focusedItemIndex;
var getItemId = _props.getItemId;
var theme = _props.theme;
var keyPrefix = _props.keyPrefix;
var _props = this.props,
items = _props.items,
itemProps = _props.itemProps,
renderItem = _props.renderItem,
renderItemData = _props.renderItemData,
sectionIndex = _props.sectionIndex,
highlightedItemIndex = _props.highlightedItemIndex,
getItemId = _props.getItemId,
theme = _props.theme,
keyPrefix = _props.keyPrefix;

@@ -79,3 +81,3 @@ var sectionPrefix = sectionIndex === null ? keyPrefix : keyPrefix + 'section-' + sectionIndex + '-';

items.map(function (item, itemIndex) {
var isFocused = itemIndex === focusedItemIndex;
var isHighlighted = itemIndex === highlightedItemIndex;
var itemKey = sectionPrefix + 'item-' + itemIndex;

@@ -85,6 +87,6 @@ var itemPropsObj = isItemPropsFunction ? itemProps({ sectionIndex: sectionIndex, itemIndex: itemIndex }) : itemProps;

id: getItemId(sectionIndex, itemIndex)
}, theme(itemKey, 'item', isFocused && 'itemFocused'), itemPropsObj);
}, theme(itemKey, 'item', isHighlighted && 'itemHighlight'), itemPropsObj);
if (isFocused) {
allItemProps.ref = _this2.storeFocusedItemReference;
if (isHighlighted) {
allItemProps.ref = _this2.storeHighlightedItemReference;
}

@@ -116,4 +118,4 @@

sectionIndex: _react.PropTypes.number,
focusedItemIndex: _react.PropTypes.number,
onFocusedItemChange: _react.PropTypes.func.isRequired,
highlightedItemIndex: _react.PropTypes.number,
onHighlightedItemChange: _react.PropTypes.func.isRequired,
getItemId: _react.PropTypes.func.isRequired,

@@ -120,0 +122,0 @@ theme: _react.PropTypes.func.isRequired,

@@ -42,7 +42,7 @@ 'use strict';

value: function render() {
var _props = this.props;
var section = _props.section;
var renderSectionTitle = _props.renderSectionTitle;
var theme = _props.theme;
var sectionKeyPrefix = _props.sectionKeyPrefix;
var _props = this.props,
section = _props.section,
renderSectionTitle = _props.renderSectionTitle,
theme = _props.theme,
sectionKeyPrefix = _props.sectionKeyPrefix;

@@ -49,0 +49,0 @@ var sectionTitle = renderSectionTitle(section);

@@ -71,4 +71,2 @@ (function webpackUniversalModuleDefinition(root, factory) {

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();

@@ -78,2 +76,4 @@

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(2);

@@ -114,4 +114,6 @@

};
var defaultRenderItemsContainer = function defaultRenderItemsContainer(props) {
return _react2.default.createElement('div', props);
var defaultRenderItemsContainer = function defaultRenderItemsContainer(_ref) {
var children = _ref.children,
containerProps = _ref.containerProps;
return _react2.default.createElement('div', _extends({ children: children }, containerProps));
};

@@ -122,7 +124,11 @@ var defaultTheme = {

input: 'react-autowhatever__input',
inputOpen: 'react-autowhatever__input--open',
inputFocus: 'react-autowhatever__input--focus',
itemsContainer: 'react-autowhatever__items-container',
itemsContainerOpen: 'react-autowhatever__items-container--open',
itemsList: 'react-autowhatever__items-list',
item: 'react-autowhatever__item',
itemFocused: 'react-autowhatever__item--focused',
itemHighlight: 'react-autowhatever__item--highlight',
sectionContainer: 'react-autowhatever__section-container',
sectionContainerFirst: 'react-autowhatever__section-container--first',
sectionTitle: 'react-autowhatever__section-title'

@@ -139,13 +145,88 @@ };

_this.focusedItem = null;
_this.storeInputReference = function (input) {
if (input !== null) {
_this.input = input;
}
};
_this.storeItemsContainerReference = function (itemsContainer) {
if (itemsContainer !== null) {
_this.itemsContainer = itemsContainer;
}
};
_this.onHighlightedItemChange = function (highlightedItem) {
_this.highlightedItem = highlightedItem;
};
_this.getItemId = function (sectionIndex, itemIndex) {
if (itemIndex === null) {
return null;
}
var id = _this.props.id;
var section = sectionIndex === null ? '' : 'section-' + sectionIndex;
return 'react-autowhatever-' + id + '-' + section + '-item-' + itemIndex;
};
_this.onFocus = function (event) {
var inputProps = _this.props.inputProps;
_this.setState({
isInputFocused: true
});
inputProps.onFocus && inputProps.onFocus(event);
};
_this.onBlur = function (event) {
var inputProps = _this.props.inputProps;
_this.setState({
isInputFocused: false
});
inputProps.onBlur && inputProps.onBlur(event);
};
_this.onKeyDown = function (event) {
var _this$props = _this.props,
inputProps = _this$props.inputProps,
highlightedSectionIndex = _this$props.highlightedSectionIndex,
highlightedItemIndex = _this$props.highlightedItemIndex;
switch (event.key) {
case 'ArrowDown':
case 'ArrowUp':
{
var nextPrev = event.key === 'ArrowDown' ? 'next' : 'prev';
var _this$sectionIterator = _this.sectionIterator[nextPrev]([highlightedSectionIndex, highlightedItemIndex]),
_this$sectionIterator2 = _slicedToArray(_this$sectionIterator, 2),
newHighlightedSectionIndex = _this$sectionIterator2[0],
newHighlightedItemIndex = _this$sectionIterator2[1];
inputProps.onKeyDown(event, { newHighlightedSectionIndex: newHighlightedSectionIndex, newHighlightedItemIndex: newHighlightedItemIndex });
break;
}
default:
inputProps.onKeyDown(event, { highlightedSectionIndex: highlightedSectionIndex, highlightedItemIndex: highlightedItemIndex });
}
};
_this.highlightedItem = null;
_this.state = {
isInputFocused: false
};
_this.setSectionsItems(props);
_this.setSectionIterator(props);
_this.setTheme(props);
_this.onKeyDown = _this.onKeyDown.bind(_this);
_this.storeInputReference = _this.storeInputReference.bind(_this);
_this.storeItemsContainerReference = _this.storeItemsContainerReference.bind(_this);
_this.onFocusedItemChange = _this.onFocusedItemChange.bind(_this);
_this.getItemId = _this.getItemId.bind(_this);
return _this;

@@ -157,3 +238,3 @@ }

value: function componentDidMount() {
this.ensureFocusedItemIsVisible();
this.ensureHighlightedItemIsVisible();
}

@@ -178,3 +259,3 @@ }, {

value: function componentDidUpdate() {
this.ensureFocusedItemIsVisible();
this.ensureHighlightedItemIsVisible();
}

@@ -210,34 +291,2 @@ }, {

}, {
key: 'storeInputReference',
value: function storeInputReference(input) {
if (input !== null) {
this.input = input;
}
}
}, {
key: 'storeItemsContainerReference',
value: function storeItemsContainerReference(itemsContainer) {
if (itemsContainer !== null) {
this.itemsContainer = itemsContainer;
}
}
}, {
key: 'onFocusedItemChange',
value: function onFocusedItemChange(focusedItem) {
this.focusedItem = focusedItem;
}
}, {
key: 'getItemId',
value: function getItemId(sectionIndex, itemIndex) {
if (itemIndex === null) {
return null;
}
var id = this.props.id;
var section = sectionIndex === null ? '' : 'section-' + sectionIndex;
return 'react-autowhatever-' + id + '-' + section + '-item-' + itemIndex;
}
}, {
key: 'renderSections',

@@ -252,12 +301,12 @@ value: function renderSections() {

var theme = this.theme;
var _props = this.props;
var id = _props.id;
var items = _props.items;
var renderItem = _props.renderItem;
var renderItemData = _props.renderItemData;
var shouldRenderSection = _props.shouldRenderSection;
var renderSectionTitle = _props.renderSectionTitle;
var focusedSectionIndex = _props.focusedSectionIndex;
var focusedItemIndex = _props.focusedItemIndex;
var itemProps = _props.itemProps;
var _props = this.props,
id = _props.id,
items = _props.items,
renderItem = _props.renderItem,
renderItemData = _props.renderItemData,
shouldRenderSection = _props.shouldRenderSection,
renderSectionTitle = _props.renderSectionTitle,
highlightedSectionIndex = _props.highlightedSectionIndex,
highlightedItemIndex = _props.highlightedItemIndex,
itemProps = _props.itemProps;

@@ -272,2 +321,3 @@

var sectionKeyPrefix = keyPrefix + 'section-' + sectionIndex + '-';
var isFirstSection = sectionIndex === 0;

@@ -278,3 +328,3 @@ // `key` is provided by theme()

'div',
theme(sectionKeyPrefix + 'container', 'sectionContainer'),
theme(sectionKeyPrefix + 'container', 'sectionContainer', isFirstSection && 'sectionContainerFirst'),
_react2.default.createElement(_SectionTitle2.default, {

@@ -292,4 +342,4 @@ section: section,

sectionIndex: sectionIndex,
focusedItemIndex: focusedSectionIndex === sectionIndex ? focusedItemIndex : null,
onFocusedItemChange: _this2.onFocusedItemChange,
highlightedItemIndex: highlightedSectionIndex === sectionIndex ? highlightedItemIndex : null,
onHighlightedItemChange: _this2.onHighlightedItemChange,
getItemId: _this2.getItemId,

@@ -315,9 +365,9 @@ theme: theme,

var theme = this.theme;
var _props2 = this.props;
var id = _props2.id;
var renderItem = _props2.renderItem;
var renderItemData = _props2.renderItemData;
var focusedSectionIndex = _props2.focusedSectionIndex;
var focusedItemIndex = _props2.focusedItemIndex;
var itemProps = _props2.itemProps;
var _props2 = this.props,
id = _props2.id,
renderItem = _props2.renderItem,
renderItemData = _props2.renderItemData,
highlightedSectionIndex = _props2.highlightedSectionIndex,
highlightedItemIndex = _props2.highlightedItemIndex,
itemProps = _props2.itemProps;

@@ -330,4 +380,4 @@

renderItemData: renderItemData,
focusedItemIndex: focusedSectionIndex === null ? focusedItemIndex : null,
onFocusedItemChange: this.onFocusedItemChange,
highlightedItemIndex: highlightedSectionIndex === null ? highlightedItemIndex : null,
onHighlightedItemChange: this.onHighlightedItemChange,
getItemId: this.getItemId,

@@ -339,39 +389,8 @@ theme: theme,

}, {
key: 'onKeyDown',
value: function onKeyDown(event) {
var _props3 = this.props;
var inputProps = _props3.inputProps;
var focusedSectionIndex = _props3.focusedSectionIndex;
var focusedItemIndex = _props3.focusedItemIndex;
key: 'ensureHighlightedItemIsVisible',
value: function ensureHighlightedItemIsVisible() {
var highlightedItem = this.highlightedItem;
switch (event.key) {
case 'ArrowDown':
case 'ArrowUp':
{
var nextPrev = event.key === 'ArrowDown' ? 'next' : 'prev';
var _sectionIterator$next = this.sectionIterator[nextPrev]([focusedSectionIndex, focusedItemIndex]);
var _sectionIterator$next2 = _slicedToArray(_sectionIterator$next, 2);
var newFocusedSectionIndex = _sectionIterator$next2[0];
var newFocusedItemIndex = _sectionIterator$next2[1];
inputProps.onKeyDown(event, { newFocusedSectionIndex: newFocusedSectionIndex, newFocusedItemIndex: newFocusedItemIndex });
break;
}
default:
inputProps.onKeyDown(event, { focusedSectionIndex: focusedSectionIndex, focusedItemIndex: focusedItemIndex });
}
}
}, {
key: 'ensureFocusedItemIsVisible',
value: function ensureFocusedItemIsVisible() {
var focusedItem = this.focusedItem;
if (!focusedItem) {
if (!highlightedItem) {
return;

@@ -382,3 +401,3 @@ }

var itemOffsetRelativeToContainer = focusedItem.offsetParent === itemsContainer ? focusedItem.offsetTop : focusedItem.offsetTop - itemsContainer.offsetTop;
var itemOffsetRelativeToContainer = highlightedItem.offsetParent === itemsContainer ? highlightedItem.offsetTop : highlightedItem.offsetTop - itemsContainer.offsetTop;

@@ -390,5 +409,5 @@ var scrollTop = itemsContainer.scrollTop; // Top of the visible area

scrollTop = itemOffsetRelativeToContainer;
} else if (itemOffsetRelativeToContainer + focusedItem.offsetHeight > scrollTop + itemsContainer.offsetHeight) {
} else if (itemOffsetRelativeToContainer + highlightedItem.offsetHeight > scrollTop + itemsContainer.offsetHeight) {
// Item is off the bottom of the visible area
scrollTop = itemOffsetRelativeToContainer + focusedItem.offsetHeight - itemsContainer.offsetHeight;
scrollTop = itemOffsetRelativeToContainer + highlightedItem.offsetHeight - itemsContainer.offsetHeight;
}

@@ -404,13 +423,14 @@

var theme = this.theme;
var _props4 = this.props;
var id = _props4.id;
var multiSection = _props4.multiSection;
var renderInputComponent = _props4.renderInputComponent;
var renderItemsContainer = _props4.renderItemsContainer;
var focusedSectionIndex = _props4.focusedSectionIndex;
var focusedItemIndex = _props4.focusedItemIndex;
var _props3 = this.props,
id = _props3.id,
multiSection = _props3.multiSection,
renderInputComponent = _props3.renderInputComponent,
renderItemsContainer = _props3.renderItemsContainer,
highlightedSectionIndex = _props3.highlightedSectionIndex,
highlightedItemIndex = _props3.highlightedItemIndex;
var isInputFocused = this.state.isInputFocused;
var renderedItems = multiSection ? this.renderSections() : this.renderItems();
var isOpen = renderedItems !== null;
var ariaActivedescendant = this.getItemId(focusedSectionIndex, focusedItemIndex);
var ariaActivedescendant = this.getItemId(highlightedSectionIndex, highlightedItemIndex);
var containerProps = theme('react-autowhatever-' + id + '-container', 'container', isOpen && 'containerOpen');

@@ -428,12 +448,16 @@ var itemsContainerId = 'react-autowhatever-' + id;

'aria-activedescendant': ariaActivedescendant
}, theme('react-autowhatever-' + id + '-input', 'input'), this.props.inputProps, {
}, theme('react-autowhatever-' + id + '-input', 'input', isOpen && 'inputOpen', isInputFocused && 'inputFocus'), this.props.inputProps, {
onFocus: this.onFocus,
onBlur: this.onBlur,
onKeyDown: this.props.inputProps.onKeyDown && this.onKeyDown,
ref: this.storeInputReference
}));
var itemsContainer = renderItemsContainer(_extends({
id: itemsContainerId
}, theme('react-autowhatever-' + id + '-items-container', 'itemsContainer'), {
ref: this.storeItemsContainerReference,
children: renderedItems
}));
var itemsContainer = renderItemsContainer({
children: renderedItems,
containerProps: _extends({
id: itemsContainerId
}, theme('react-autowhatever-' + id + '-items-container', 'itemsContainer', isOpen && 'itemsContainerOpen'), {
ref: this.storeItemsContainerReference
})
});

@@ -455,5 +479,5 @@ return _react2.default.createElement(

multiSection: _react.PropTypes.bool, // Indicates whether a multi section layout should be rendered.
renderInputComponent: _react.PropTypes.func, // Renders the input component.
renderInputComponent: _react.PropTypes.func, // When specified, it is used to render the input element.
renderItemsContainer: _react.PropTypes.func, // Renders the items container.
items: _react.PropTypes.array.isRequired, // Array of items or sections to render.
renderItemsContainer: _react.PropTypes.func, // Renders the items container.
renderItem: _react.PropTypes.func, // This function renders a single item.

@@ -464,8 +488,7 @@ renderItemData: _react.PropTypes.object, // Arbitrary data that will be passed to renderItem()

getSectionItems: _react.PropTypes.func, // This function gets a section and returns its items, which will be passed into `renderItem` for rendering.
inputComponent: _react.PropTypes.func, // When specified, it is used to render the input element
inputProps: _react.PropTypes.object, // Arbitrary input props
itemProps: _react.PropTypes.oneOfType([// Arbitrary item props
_react.PropTypes.object, _react.PropTypes.func]),
focusedSectionIndex: _react.PropTypes.number, // Section index of the focused item
focusedItemIndex: _react.PropTypes.number, // Focused item index (within a section)
highlightedSectionIndex: _react.PropTypes.number, // Section index of the highlighted item
highlightedItemIndex: _react.PropTypes.number, // Highlighted item index (within a section)
theme: _react.PropTypes.oneOfType([// Styles. See: https://github.com/markdalgleish/react-themeable

@@ -492,4 +515,4 @@ _react.PropTypes.object, _react.PropTypes.array])

itemProps: emptyObject,
focusedSectionIndex: null,
focusedItemIndex: null,
highlightedSectionIndex: null,
highlightedItemIndex: null,
theme: defaultTheme

@@ -758,7 +781,7 @@ };

value: function render() {
var _props = this.props;
var section = _props.section;
var renderSectionTitle = _props.renderSectionTitle;
var theme = _props.theme;
var sectionKeyPrefix = _props.sectionKeyPrefix;
var _props = this.props,
section = _props.section,
renderSectionTitle = _props.renderSectionTitle,
theme = _props.theme,
sectionKeyPrefix = _props.sectionKeyPrefix;

@@ -895,8 +918,15 @@ var sectionTitle = renderSectionTitle(section);

function ItemsList() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, ItemsList);
var _this = _possibleConstructorReturn(this, (ItemsList.__proto__ || Object.getPrototypeOf(ItemsList)).call(this));
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this.storeFocusedItemReference = _this.storeFocusedItemReference.bind(_this);
return _this;
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ItemsList.__proto__ || Object.getPrototypeOf(ItemsList)).call.apply(_ref, [this].concat(args))), _this), _this.storeHighlightedItemReference = function (highlightedItem) {
_this.props.onHighlightedItemChange(highlightedItem === null ? null : highlightedItem.item);
}, _temp), _possibleConstructorReturn(_this, _ret);
}

@@ -910,7 +940,2 @@

}, {
key: 'storeFocusedItemReference',
value: function storeFocusedItemReference(focusedItem) {
this.props.onFocusedItemChange(focusedItem === null ? null : focusedItem.item);
}
}, {
key: 'render',

@@ -920,12 +945,12 @@ value: function render() {

var _props = this.props;
var items = _props.items;
var itemProps = _props.itemProps;
var renderItem = _props.renderItem;
var renderItemData = _props.renderItemData;
var sectionIndex = _props.sectionIndex;
var focusedItemIndex = _props.focusedItemIndex;
var getItemId = _props.getItemId;
var theme = _props.theme;
var keyPrefix = _props.keyPrefix;
var _props = this.props,
items = _props.items,
itemProps = _props.itemProps,
renderItem = _props.renderItem,
renderItemData = _props.renderItemData,
sectionIndex = _props.sectionIndex,
highlightedItemIndex = _props.highlightedItemIndex,
getItemId = _props.getItemId,
theme = _props.theme,
keyPrefix = _props.keyPrefix;

@@ -939,3 +964,3 @@ var sectionPrefix = sectionIndex === null ? keyPrefix : keyPrefix + 'section-' + sectionIndex + '-';

items.map(function (item, itemIndex) {
var isFocused = itemIndex === focusedItemIndex;
var isHighlighted = itemIndex === highlightedItemIndex;
var itemKey = sectionPrefix + 'item-' + itemIndex;

@@ -945,6 +970,6 @@ var itemPropsObj = isItemPropsFunction ? itemProps({ sectionIndex: sectionIndex, itemIndex: itemIndex }) : itemProps;

id: getItemId(sectionIndex, itemIndex)
}, theme(itemKey, 'item', isFocused && 'itemFocused'), itemPropsObj);
}, theme(itemKey, 'item', isHighlighted && 'itemHighlight'), itemPropsObj);
if (isFocused) {
allItemProps.ref = _this2.storeFocusedItemReference;
if (isHighlighted) {
allItemProps.ref = _this2.storeHighlightedItemReference;
}

@@ -976,4 +1001,4 @@

sectionIndex: _react.PropTypes.number,
focusedItemIndex: _react.PropTypes.number,
onFocusedItemChange: _react.PropTypes.func.isRequired,
highlightedItemIndex: _react.PropTypes.number,
onHighlightedItemChange: _react.PropTypes.func.isRequired,
getItemId: _react.PropTypes.func.isRequired,

@@ -1024,65 +1049,51 @@ theme: _react.PropTypes.func.isRequired,

function Item() {
_classCallCheck(this, Item);
var _ref;
var _this = _possibleConstructorReturn(this, (Item.__proto__ || Object.getPrototypeOf(Item)).call(this));
var _temp, _this, _ret;
_this.storeItemReference = _this.storeItemReference.bind(_this);
_this.onMouseEnter = _this.onMouseEnter.bind(_this);
_this.onMouseLeave = _this.onMouseLeave.bind(_this);
_this.onMouseDown = _this.onMouseDown.bind(_this);
_this.onClick = _this.onClick.bind(_this);
return _this;
}
_classCallCheck(this, Item);
_createClass(Item, [{
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps) {
return (0, _compareObjects2.default)(nextProps, this.props, ['renderItemData']);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
}, {
key: 'storeItemReference',
value: function storeItemReference(item) {
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Item.__proto__ || Object.getPrototypeOf(Item)).call.apply(_ref, [this].concat(args))), _this), _this.storeItemReference = function (item) {
if (item !== null) {
this.item = item;
_this.item = item;
}
}
}, {
key: 'onMouseEnter',
value: function onMouseEnter(event) {
var _props = this.props;
var sectionIndex = _props.sectionIndex;
var itemIndex = _props.itemIndex;
}, _this.onMouseEnter = function (event) {
var _this$props = _this.props,
sectionIndex = _this$props.sectionIndex,
itemIndex = _this$props.itemIndex;
this.props.onMouseEnter(event, { sectionIndex: sectionIndex, itemIndex: itemIndex });
}
}, {
key: 'onMouseLeave',
value: function onMouseLeave(event) {
var _props2 = this.props;
var sectionIndex = _props2.sectionIndex;
var itemIndex = _props2.itemIndex;
_this.props.onMouseEnter(event, { sectionIndex: sectionIndex, itemIndex: itemIndex });
}, _this.onMouseLeave = function (event) {
var _this$props2 = _this.props,
sectionIndex = _this$props2.sectionIndex,
itemIndex = _this$props2.itemIndex;
this.props.onMouseLeave(event, { sectionIndex: sectionIndex, itemIndex: itemIndex });
}
}, {
key: 'onMouseDown',
value: function onMouseDown(event) {
var _props3 = this.props;
var sectionIndex = _props3.sectionIndex;
var itemIndex = _props3.itemIndex;
_this.props.onMouseLeave(event, { sectionIndex: sectionIndex, itemIndex: itemIndex });
}, _this.onMouseDown = function (event) {
var _this$props3 = _this.props,
sectionIndex = _this$props3.sectionIndex,
itemIndex = _this$props3.itemIndex;
this.props.onMouseDown(event, { sectionIndex: sectionIndex, itemIndex: itemIndex });
}
}, {
key: 'onClick',
value: function onClick(event) {
var _props4 = this.props;
var sectionIndex = _props4.sectionIndex;
var itemIndex = _props4.itemIndex;
_this.props.onMouseDown(event, { sectionIndex: sectionIndex, itemIndex: itemIndex });
}, _this.onClick = function (event) {
var _this$props4 = _this.props,
sectionIndex = _this$props4.sectionIndex,
itemIndex = _this$props4.itemIndex;
this.props.onClick(event, { sectionIndex: sectionIndex, itemIndex: itemIndex });
_this.props.onClick(event, { sectionIndex: sectionIndex, itemIndex: itemIndex });
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Item, [{
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps) {
return (0, _compareObjects2.default)(nextProps, this.props, ['renderItemData']);
}

@@ -1092,9 +1103,8 @@ }, {

value: function render() {
var _props5 = this.props;
var item = _props5.item;
var renderItem = _props5.renderItem;
var renderItemData = _props5.renderItemData;
var _props = this.props,
item = _props.item,
renderItem = _props.renderItem,
renderItemData = _props.renderItemData,
restProps = _objectWithoutProperties(_props, ['item', 'renderItem', 'renderItemData']);
var restProps = _objectWithoutProperties(_props5, ['item', 'renderItem', 'renderItemData']);
delete restProps.sectionIndex;

@@ -1101,0 +1111,0 @@ delete restProps.itemIndex;

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

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React")):"function"==typeof define&&define.amd?define(["React"],t):"object"==typeof exports?exports.Autowhatever=t(require("React")):e.Autowhatever=t(e.React)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";e.exports=n(1)["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var u,s=e[Symbol.iterator]();!(r=(u=s.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(c){o=!0,i=c}finally{try{!r&&s["return"]&&s["return"]()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(2),f=r(l),p=n(3),d=r(p),m=n(4),y=r(m),h=n(6),v=r(h),I=n(8),b=r(I),w=function(){return!0},P={},g=function(e){return f["default"].createElement("input",e)},x=function(e){return f["default"].createElement("div",e)},T={container:"react-autowhatever__container",containerOpen:"react-autowhatever__container--open",input:"react-autowhatever__input",itemsContainer:"react-autowhatever__items-container",itemsList:"react-autowhatever__items-list",item:"react-autowhatever__item",itemFocused:"react-autowhatever__item--focused",sectionContainer:"react-autowhatever__section-container",sectionTitle:"react-autowhatever__section-title"},O=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.focusedItem=null,n.setSectionsItems(e),n.setSectionIterator(e),n.setTheme(e),n.onKeyDown=n.onKeyDown.bind(n),n.storeInputReference=n.storeInputReference.bind(n),n.storeItemsContainerReference=n.storeItemsContainerReference.bind(n),n.onFocusedItemChange=n.onFocusedItemChange.bind(n),n.getItemId=n.getItemId.bind(n),n}return u(t,e),a(t,[{key:"componentDidMount",value:function(){this.ensureFocusedItemIsVisible()}},{key:"componentWillReceiveProps",value:function(e){e.items!==this.props.items&&this.setSectionsItems(e),e.items===this.props.items&&e.multiSection===this.props.multiSection||this.setSectionIterator(e),e.theme!==this.props.theme&&this.setTheme(e)}},{key:"componentDidUpdate",value:function(){this.ensureFocusedItemIsVisible()}},{key:"setSectionsItems",value:function(e){e.multiSection&&(this.sectionsItems=e.items.map(function(t){return e.getSectionItems(t)}),this.sectionsLengths=this.sectionsItems.map(function(e){return e.length}),this.allSectionsAreEmpty=this.sectionsLengths.every(function(e){return 0===e}))}},{key:"setSectionIterator",value:function(e){this.sectionIterator=(0,d["default"])({multiSection:e.multiSection,data:e.multiSection?this.sectionsLengths:e.items.length})}},{key:"setTheme",value:function(e){this.theme=(0,y["default"])(e.theme)}},{key:"storeInputReference",value:function(e){null!==e&&(this.input=e)}},{key:"storeItemsContainerReference",value:function(e){null!==e&&(this.itemsContainer=e)}},{key:"onFocusedItemChange",value:function(e){this.focusedItem=e}},{key:"getItemId",value:function(e,t){if(null===t)return null;var n=this.props.id,r=null===e?"":"section-"+e;return"react-autowhatever-"+n+"-"+r+"-item-"+t}},{key:"renderSections",value:function(){var e=this;if(this.allSectionsAreEmpty)return null;var t=this.theme,n=this.props,r=n.id,o=n.items,i=n.renderItem,u=n.renderItemData,s=n.shouldRenderSection,c=n.renderSectionTitle,a=n.focusedSectionIndex,l=n.focusedItemIndex,p=n.itemProps;return o.map(function(n,o){if(!s(n))return null;var d="react-autowhatever-"+r+"-",m=d+"section-"+o+"-";return f["default"].createElement("div",t(m+"container","sectionContainer"),f["default"].createElement(v["default"],{section:n,renderSectionTitle:c,theme:t,sectionKeyPrefix:m}),f["default"].createElement(b["default"],{items:e.sectionsItems[o],itemProps:p,renderItem:i,renderItemData:u,sectionIndex:o,focusedItemIndex:a===o?l:null,onFocusedItemChange:e.onFocusedItemChange,getItemId:e.getItemId,theme:t,keyPrefix:d,ref:e.storeItemsListReference}))})}},{key:"renderItems",value:function(){var e=this.props.items;if(0===e.length)return null;var t=this.theme,n=this.props,r=n.id,o=n.renderItem,i=n.renderItemData,u=n.focusedSectionIndex,s=n.focusedItemIndex,c=n.itemProps;return f["default"].createElement(b["default"],{items:e,itemProps:c,renderItem:o,renderItemData:i,focusedItemIndex:null===u?s:null,onFocusedItemChange:this.onFocusedItemChange,getItemId:this.getItemId,theme:t,keyPrefix:"react-autowhatever-"+r+"-"})}},{key:"onKeyDown",value:function(e){var t=this.props,n=t.inputProps,r=t.focusedSectionIndex,o=t.focusedItemIndex;switch(e.key){case"ArrowDown":case"ArrowUp":var i="ArrowDown"===e.key?"next":"prev",u=this.sectionIterator[i]([r,o]),s=c(u,2),a=s[0],l=s[1];n.onKeyDown(e,{newFocusedSectionIndex:a,newFocusedItemIndex:l});break;default:n.onKeyDown(e,{focusedSectionIndex:r,focusedItemIndex:o})}}},{key:"ensureFocusedItemIsVisible",value:function(){var e=this.focusedItem;if(e){var t=this.itemsContainer,n=e.offsetParent===t?e.offsetTop:e.offsetTop-t.offsetTop,r=t.scrollTop;n<r?r=n:n+e.offsetHeight>r+t.offsetHeight&&(r=n+e.offsetHeight-t.offsetHeight),r!==t.scrollTop&&(t.scrollTop=r)}}},{key:"render",value:function(){var e=this.theme,t=this.props,n=t.id,r=t.multiSection,o=t.renderInputComponent,i=t.renderItemsContainer,u=t.focusedSectionIndex,c=t.focusedItemIndex,a=r?this.renderSections():this.renderItems(),l=null!==a,p=this.getItemId(u,c),d=e("react-autowhatever-"+n+"-container","container",l&&"containerOpen"),m="react-autowhatever-"+n,y=o(s({type:"text",value:"",autoComplete:"off",role:"combobox","aria-autocomplete":"list","aria-owns":m,"aria-expanded":l,"aria-haspopup":l,"aria-activedescendant":p},e("react-autowhatever-"+n+"-input","input"),this.props.inputProps,{onKeyDown:this.props.inputProps.onKeyDown&&this.onKeyDown,ref:this.storeInputReference})),h=i(s({id:m},e("react-autowhatever-"+n+"-items-container","itemsContainer"),{ref:this.storeItemsContainerReference,children:a}));return f["default"].createElement("div",d,y,h)}}]),t}(l.Component);O.propTypes={id:l.PropTypes.string,multiSection:l.PropTypes.bool,renderInputComponent:l.PropTypes.func,items:l.PropTypes.array.isRequired,renderItemsContainer:l.PropTypes.func,renderItem:l.PropTypes.func,renderItemData:l.PropTypes.object,shouldRenderSection:l.PropTypes.func,renderSectionTitle:l.PropTypes.func,getSectionItems:l.PropTypes.func,inputComponent:l.PropTypes.func,inputProps:l.PropTypes.object,itemProps:l.PropTypes.oneOfType([l.PropTypes.object,l.PropTypes.func]),focusedSectionIndex:l.PropTypes.number,focusedItemIndex:l.PropTypes.number,theme:l.PropTypes.oneOfType([l.PropTypes.object,l.PropTypes.array])},O.defaultProps={id:"1",multiSection:!1,renderInputComponent:g,renderItemsContainer:x,shouldRenderSection:w,renderItem:function(){throw new Error("`renderItem` must be provided")},renderItemData:P,renderSectionTitle:function(){throw new Error("`renderSectionTitle` must be provided")},getSectionItems:function(){throw new Error("`getSectionItems` must be provided")},inputProps:P,itemProps:P,focusedSectionIndex:null,focusedItemIndex:null,theme:T},t["default"]=O},function(t,n){t.exports=e},function(e,t){"use strict";var n=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var u,s=e[Symbol.iterator]();!(r=(u=s.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(c){o=!0,i=c}finally{try{!r&&s["return"]&&s["return"]()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.exports=function(e){function t(e){for(null===e?e=0:e++;e<s.length&&0===s[e];)e++;return e===s.length?null:e}function r(e){for(null===e?e=s.length-1:e--;e>=0&&0===s[e];)e--;return e===-1?null:e}function o(e){var r=n(e,2),o=r[0],i=r[1];return c?null===i||i===s[o]-1?(o=t(o),null===o?[null,null]:[o,0]):[o,i+1]:0===s||i===s-1?[null,null]:null===i?[null,0]:[null,i+1]}function i(e){var t=n(e,2),o=t[0],i=t[1];return c?null===i||0===i?(o=r(o),null===o?[null,null]:[o,s[o]-1]):[o,i-1]:0===s||0===i?[null,null]:null===i?[null,s-1]:[null,i-1]}function u(e){return null===o(e)[1]}var s=e.data,c=e.multiSection;return{next:o,prev:i,isLast:u}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var u,s=e[Symbol.iterator]();!(r=(u=s.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(c){o=!0,i=c}finally{try{!r&&s["return"]&&s["return"]()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=n(5),s=r(u),c=function(e){return e};t["default"]=function(e){var t=Array.isArray(e)&&2===e.length?e:[e,null],n=i(t,2),r=n[0],u=n[1];return function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var a=n.map(function(e){return r[e]}).filter(c);return"string"==typeof a[0]||"function"==typeof u?{key:e,className:u?u.apply(void 0,o(a)):a.join(" ")}:{key:e,style:s["default"].apply(void 0,[{}].concat(o(a)))}}},e.exports=t["default"]},function(e,t){"use strict";function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function r(e){var t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e))),t.filter(function(t){return o.call(e,t)})}var o=Object.prototype.propertyIsEnumerable;e.exports=Object.assign||function(e,t){for(var o,i,u=n(e),s=1;s<arguments.length;s++){o=arguments[s],i=r(Object(o));for(var c=0;c<i.length;c++)u[i[c]]=o[i[c]]}return u}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(2),a=r(c),l=n(7),f=r(l),p=function(e){function t(){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,e),s(t,[{key:"shouldComponentUpdate",value:function(e){return(0,f["default"])(e,this.props)}},{key:"render",value:function(){var e=this.props,t=e.section,n=e.renderSectionTitle,r=e.theme,o=e.sectionKeyPrefix,i=n(t);return i?a["default"].createElement("div",r(o+"title","sectionTitle"),i):null}}]),t}(c.Component);p.propTypes={section:c.PropTypes.any.isRequired,renderSectionTitle:c.PropTypes.func.isRequired,theme:c.PropTypes.func.isRequired,sectionKeyPrefix:c.PropTypes.string.isRequired},t["default"]=p},function(e,t){"use strict";function n(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e===t)return!1;var o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!0;var u={},s=void 0,c=void 0;for(s=0,c=n.length;s<c;s++)u[n[s]]=!0;for(s=0,c=o.length;s<c;s++){var a=o[s],l=e[a],f=t[a];if(l!==f){if(!u[a]||null===l||null===f||"object"!==("undefined"==typeof l?"undefined":r(l))||"object"!==("undefined"==typeof f?"undefined":r(f)))return!0;var p=Object.keys(l),d=Object.keys(f);if(p.length!==d.length)return!0;for(var m=0,y=p.length;m<y;m++){var h=p[m];if(l[h]!==f[h])return!0}}}return!1}Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t["default"]=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(2),l=r(a),f=n(9),p=r(f),d=n(7),m=r(d),y=function(e){function t(){o(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.storeFocusedItemReference=e.storeFocusedItemReference.bind(e),e}return u(t,e),c(t,[{key:"shouldComponentUpdate",value:function(e){return(0,m["default"])(e,this.props,["itemProps"])}},{key:"storeFocusedItemReference",value:function(e){this.props.onFocusedItemChange(null===e?null:e.item)}},{key:"render",value:function(){var e=this,t=this.props,n=t.items,r=t.itemProps,o=t.renderItem,i=t.renderItemData,u=t.sectionIndex,c=t.focusedItemIndex,a=t.getItemId,f=t.theme,d=t.keyPrefix,m=null===u?d:d+"section-"+u+"-",y="function"==typeof r;return l["default"].createElement("ul",s({role:"listbox"},f(m+"items-list","itemsList")),n.map(function(t,n){var d=n===c,h=m+"item-"+n,v=y?r({sectionIndex:u,itemIndex:n}):r,I=s({id:a(u,n)},f(h,"item",d&&"itemFocused"),v);return d&&(I.ref=e.storeFocusedItemReference),l["default"].createElement(p["default"],s({},I,{sectionIndex:u,itemIndex:n,item:t,renderItem:o,renderItemData:i}))}))}}]),t}(a.Component);y.propTypes={items:a.PropTypes.array.isRequired,itemProps:a.PropTypes.oneOfType([a.PropTypes.object,a.PropTypes.func]),renderItem:a.PropTypes.func.isRequired,renderItemData:a.PropTypes.object.isRequired,sectionIndex:a.PropTypes.number,focusedItemIndex:a.PropTypes.number,onFocusedItemChange:a.PropTypes.func.isRequired,getItemId:a.PropTypes.func.isRequired,theme:a.PropTypes.func.isRequired,keyPrefix:a.PropTypes.string.isRequired},y.defaultProps={sectionIndex:null},t["default"]=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(2),f=r(l),p=n(7),d=r(p),m=function(e){function t(){i(this,t);var e=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.storeItemReference=e.storeItemReference.bind(e),e.onMouseEnter=e.onMouseEnter.bind(e),e.onMouseLeave=e.onMouseLeave.bind(e),e.onMouseDown=e.onMouseDown.bind(e),e.onClick=e.onClick.bind(e),e}return s(t,e),a(t,[{key:"shouldComponentUpdate",value:function(e){return(0,d["default"])(e,this.props,["renderItemData"])}},{key:"storeItemReference",value:function(e){null!==e&&(this.item=e)}},{key:"onMouseEnter",value:function(e){var t=this.props,n=t.sectionIndex,r=t.itemIndex;this.props.onMouseEnter(e,{sectionIndex:n,itemIndex:r})}},{key:"onMouseLeave",value:function(e){var t=this.props,n=t.sectionIndex,r=t.itemIndex;this.props.onMouseLeave(e,{sectionIndex:n,itemIndex:r})}},{key:"onMouseDown",value:function(e){var t=this.props,n=t.sectionIndex,r=t.itemIndex;this.props.onMouseDown(e,{sectionIndex:n,itemIndex:r})}},{key:"onClick",value:function(e){var t=this.props,n=t.sectionIndex,r=t.itemIndex;this.props.onClick(e,{sectionIndex:n,itemIndex:r})}},{key:"render",value:function(){var e=this.props,t=e.item,n=e.renderItem,r=e.renderItemData,i=o(e,["item","renderItem","renderItemData"]);return delete i.sectionIndex,delete i.itemIndex,"function"==typeof i.onMouseEnter&&(i.onMouseEnter=this.onMouseEnter),"function"==typeof i.onMouseLeave&&(i.onMouseLeave=this.onMouseLeave),"function"==typeof i.onMouseDown&&(i.onMouseDown=this.onMouseDown),"function"==typeof i.onClick&&(i.onClick=this.onClick),f["default"].createElement("li",c({role:"option"},i,{ref:this.storeItemReference}),n(t,r))}}]),t}(l.Component);m.propTypes={sectionIndex:l.PropTypes.number,itemIndex:l.PropTypes.number.isRequired,item:l.PropTypes.any.isRequired,renderItem:l.PropTypes.func.isRequired,renderItemData:l.PropTypes.object.isRequired,onMouseEnter:l.PropTypes.func,onMouseLeave:l.PropTypes.func,onMouseDown:l.PropTypes.func,onClick:l.PropTypes.func},t["default"]=m}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React")):"function"==typeof define&&define.amd?define(["React"],t):"object"==typeof exports?exports.Autowhatever=t(require("React")):e.Autowhatever=t(e.React)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";e.exports=n(1).default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var u,s=e[Symbol.iterator]();!(r=(u=s.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=n(2),p=r(l),f=n(3),h=r(f),d=n(4),m=r(d),y=n(6),v=r(y),g=n(8),I=r(g),b=function(){return!0},P={},w=function(e){return p.default.createElement("input",e)},x=function(e){var t=e.children,n=e.containerProps;return p.default.createElement("div",c({children:t},n))},T={container:"react-autowhatever__container",containerOpen:"react-autowhatever__container--open",input:"react-autowhatever__input",inputOpen:"react-autowhatever__input--open",inputFocus:"react-autowhatever__input--focus",itemsContainer:"react-autowhatever__items-container",itemsContainerOpen:"react-autowhatever__items-container--open",itemsList:"react-autowhatever__items-list",item:"react-autowhatever__item",itemHighlight:"react-autowhatever__item--highlight",sectionContainer:"react-autowhatever__section-container",sectionContainerFirst:"react-autowhatever__section-container--first",sectionTitle:"react-autowhatever__section-title"},_=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.storeInputReference=function(e){null!==e&&(n.input=e)},n.storeItemsContainerReference=function(e){null!==e&&(n.itemsContainer=e)},n.onHighlightedItemChange=function(e){n.highlightedItem=e},n.getItemId=function(e,t){if(null===t)return null;var r=n.props.id,o=null===e?"":"section-"+e;return"react-autowhatever-"+r+"-"+o+"-item-"+t},n.onFocus=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!0}),t.onFocus&&t.onFocus(e)},n.onBlur=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!1}),t.onBlur&&t.onBlur(e)},n.onKeyDown=function(e){var t=n.props,r=t.inputProps,o=t.highlightedSectionIndex,i=t.highlightedItemIndex;switch(e.key){case"ArrowDown":case"ArrowUp":var u="ArrowDown"===e.key?"next":"prev",a=n.sectionIterator[u]([o,i]),c=s(a,2),l=c[0],p=c[1];r.onKeyDown(e,{newHighlightedSectionIndex:l,newHighlightedItemIndex:p});break;default:r.onKeyDown(e,{highlightedSectionIndex:o,highlightedItemIndex:i})}},n.highlightedItem=null,n.state={isInputFocused:!1},n.setSectionsItems(e),n.setSectionIterator(e),n.setTheme(e),n}return u(t,e),a(t,[{key:"componentDidMount",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"componentWillReceiveProps",value:function(e){e.items!==this.props.items&&this.setSectionsItems(e),e.items===this.props.items&&e.multiSection===this.props.multiSection||this.setSectionIterator(e),e.theme!==this.props.theme&&this.setTheme(e)}},{key:"componentDidUpdate",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"setSectionsItems",value:function(e){e.multiSection&&(this.sectionsItems=e.items.map(function(t){return e.getSectionItems(t)}),this.sectionsLengths=this.sectionsItems.map(function(e){return e.length}),this.allSectionsAreEmpty=this.sectionsLengths.every(function(e){return 0===e}))}},{key:"setSectionIterator",value:function(e){this.sectionIterator=(0,h.default)({multiSection:e.multiSection,data:e.multiSection?this.sectionsLengths:e.items.length})}},{key:"setTheme",value:function(e){this.theme=(0,m.default)(e.theme)}},{key:"renderSections",value:function(){var e=this;if(this.allSectionsAreEmpty)return null;var t=this.theme,n=this.props,r=n.id,o=n.items,i=n.renderItem,u=n.renderItemData,s=n.shouldRenderSection,a=n.renderSectionTitle,c=n.highlightedSectionIndex,l=n.highlightedItemIndex,f=n.itemProps;return o.map(function(n,o){if(!s(n))return null;var h="react-autowhatever-"+r+"-",d=h+"section-"+o+"-",m=0===o;return p.default.createElement("div",t(d+"container","sectionContainer",m&&"sectionContainerFirst"),p.default.createElement(v.default,{section:n,renderSectionTitle:a,theme:t,sectionKeyPrefix:d}),p.default.createElement(I.default,{items:e.sectionsItems[o],itemProps:f,renderItem:i,renderItemData:u,sectionIndex:o,highlightedItemIndex:c===o?l:null,onHighlightedItemChange:e.onHighlightedItemChange,getItemId:e.getItemId,theme:t,keyPrefix:h,ref:e.storeItemsListReference}))})}},{key:"renderItems",value:function(){var e=this.props.items;if(0===e.length)return null;var t=this.theme,n=this.props,r=n.id,o=n.renderItem,i=n.renderItemData,u=n.highlightedSectionIndex,s=n.highlightedItemIndex,a=n.itemProps;return p.default.createElement(I.default,{items:e,itemProps:a,renderItem:o,renderItemData:i,highlightedItemIndex:null===u?s:null,onHighlightedItemChange:this.onHighlightedItemChange,getItemId:this.getItemId,theme:t,keyPrefix:"react-autowhatever-"+r+"-"})}},{key:"ensureHighlightedItemIsVisible",value:function(){var e=this.highlightedItem;if(e){var t=this.itemsContainer,n=e.offsetParent===t?e.offsetTop:e.offsetTop-t.offsetTop,r=t.scrollTop;n<r?r=n:n+e.offsetHeight>r+t.offsetHeight&&(r=n+e.offsetHeight-t.offsetHeight),r!==t.scrollTop&&(t.scrollTop=r)}}},{key:"render",value:function(){var e=this.theme,t=this.props,n=t.id,r=t.multiSection,o=t.renderInputComponent,i=t.renderItemsContainer,u=t.highlightedSectionIndex,s=t.highlightedItemIndex,a=this.state.isInputFocused,l=r?this.renderSections():this.renderItems(),f=null!==l,h=this.getItemId(u,s),d=e("react-autowhatever-"+n+"-container","container",f&&"containerOpen"),m="react-autowhatever-"+n,y=o(c({type:"text",value:"",autoComplete:"off",role:"combobox","aria-autocomplete":"list","aria-owns":m,"aria-expanded":f,"aria-haspopup":f,"aria-activedescendant":h},e("react-autowhatever-"+n+"-input","input",f&&"inputOpen",a&&"inputFocus"),this.props.inputProps,{onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.props.inputProps.onKeyDown&&this.onKeyDown,ref:this.storeInputReference})),v=i({children:l,containerProps:c({id:m},e("react-autowhatever-"+n+"-items-container","itemsContainer",f&&"itemsContainerOpen"),{ref:this.storeItemsContainerReference})});return p.default.createElement("div",d,y,v)}}]),t}(l.Component);_.propTypes={id:l.PropTypes.string,multiSection:l.PropTypes.bool,renderInputComponent:l.PropTypes.func,renderItemsContainer:l.PropTypes.func,items:l.PropTypes.array.isRequired,renderItem:l.PropTypes.func,renderItemData:l.PropTypes.object,shouldRenderSection:l.PropTypes.func,renderSectionTitle:l.PropTypes.func,getSectionItems:l.PropTypes.func,inputProps:l.PropTypes.object,itemProps:l.PropTypes.oneOfType([l.PropTypes.object,l.PropTypes.func]),highlightedSectionIndex:l.PropTypes.number,highlightedItemIndex:l.PropTypes.number,theme:l.PropTypes.oneOfType([l.PropTypes.object,l.PropTypes.array])},_.defaultProps={id:"1",multiSection:!1,renderInputComponent:w,renderItemsContainer:x,shouldRenderSection:b,renderItem:function(){throw new Error("`renderItem` must be provided")},renderItemData:P,renderSectionTitle:function(){throw new Error("`renderSectionTitle` must be provided")},getSectionItems:function(){throw new Error("`getSectionItems` must be provided")},inputProps:P,itemProps:P,highlightedSectionIndex:null,highlightedItemIndex:null,theme:T},t.default=_},function(t,n){t.exports=e},function(e,t){"use strict";var n=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var u,s=e[Symbol.iterator]();!(r=(u=s.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.exports=function(e){function t(e){for(null===e?e=0:e++;e<s.length&&0===s[e];)e++;return e===s.length?null:e}function r(e){for(null===e?e=s.length-1:e--;e>=0&&0===s[e];)e--;return e===-1?null:e}function o(e){var r=n(e,2),o=r[0],i=r[1];return a?null===i||i===s[o]-1?(o=t(o),null===o?[null,null]:[o,0]):[o,i+1]:0===s||i===s-1?[null,null]:null===i?[null,0]:[null,i+1]}function i(e){var t=n(e,2),o=t[0],i=t[1];return a?null===i||0===i?(o=r(o),null===o?[null,null]:[o,s[o]-1]):[o,i-1]:0===s||0===i?[null,null]:null===i?[null,s-1]:[null,i-1]}function u(e){return null===o(e)[1]}var s=e.data,a=e.multiSection;return{next:o,prev:i,isLast:u}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var u,s=e[Symbol.iterator]();!(r=(u=s.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=n(5),s=r(u),a=function(e){return e};t.default=function(e){var t=Array.isArray(e)&&2===e.length?e:[e,null],n=i(t,2),r=n[0],u=n[1];return function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var c=n.map(function(e){return r[e]}).filter(a);return"string"==typeof c[0]||"function"==typeof u?{key:e,className:u?u.apply(void 0,o(c)):c.join(" ")}:{key:e,style:s.default.apply(void 0,[{}].concat(o(c)))}}},e.exports=t.default},function(e,t){"use strict";function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function r(e){var t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e))),t.filter(function(t){return o.call(e,t)})}var o=Object.prototype.propertyIsEnumerable;e.exports=Object.assign||function(e,t){for(var o,i,u=n(e),s=1;s<arguments.length;s++){o=arguments[s],i=r(Object(o));for(var a=0;a<i.length;a++)u[i[a]]=o[i[a]]}return u}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(2),c=r(a),l=n(7),p=r(l),f=function(e){function t(){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,e),s(t,[{key:"shouldComponentUpdate",value:function(e){return(0,p.default)(e,this.props)}},{key:"render",value:function(){var e=this.props,t=e.section,n=e.renderSectionTitle,r=e.theme,o=e.sectionKeyPrefix,i=n(t);return i?c.default.createElement("div",r(o+"title","sectionTitle"),i):null}}]),t}(a.Component);f.propTypes={section:a.PropTypes.any.isRequired,renderSectionTitle:a.PropTypes.func.isRequired,theme:a.PropTypes.func.isRequired,sectionKeyPrefix:a.PropTypes.string.isRequired},t.default=f},function(e,t){"use strict";function n(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e===t)return!1;var o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!0;var u={},s=void 0,a=void 0;for(s=0,a=n.length;s<a;s++)u[n[s]]=!0;for(s=0,a=o.length;s<a;s++){var c=o[s],l=e[c],p=t[c];if(l!==p){if(!u[c]||null===l||null===p||"object"!==("undefined"==typeof l?"undefined":r(l))||"object"!==("undefined"==typeof p?"undefined":r(p)))return!0;var f=Object.keys(l),h=Object.keys(p);if(f.length!==h.length)return!0;for(var d=0,m=f.length;d<m;d++){var y=f[d];if(l[y]!==p[y])return!0}}}return!1}Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(2),l=r(c),p=n(9),f=r(p),h=n(7),d=r(h),m=function(e){function t(){var e,n,r,u;o(this,t);for(var s=arguments.length,a=Array(s),c=0;c<s;c++)a[c]=arguments[c];return n=r=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.storeHighlightedItemReference=function(e){r.props.onHighlightedItemChange(null===e?null:e.item)},u=n,i(r,u)}return u(t,e),a(t,[{key:"shouldComponentUpdate",value:function(e){return(0,d.default)(e,this.props,["itemProps"])}},{key:"render",value:function(){var e=this,t=this.props,n=t.items,r=t.itemProps,o=t.renderItem,i=t.renderItemData,u=t.sectionIndex,a=t.highlightedItemIndex,c=t.getItemId,p=t.theme,h=t.keyPrefix,d=null===u?h:h+"section-"+u+"-",m="function"==typeof r;return l.default.createElement("ul",s({role:"listbox"},p(d+"items-list","itemsList")),n.map(function(t,n){var h=n===a,y=d+"item-"+n,v=m?r({sectionIndex:u,itemIndex:n}):r,g=s({id:c(u,n)},p(y,"item",h&&"itemHighlight"),v);return h&&(g.ref=e.storeHighlightedItemReference),l.default.createElement(f.default,s({},g,{sectionIndex:u,itemIndex:n,item:t,renderItem:o,renderItemData:i}))}))}}]),t}(c.Component);m.propTypes={items:c.PropTypes.array.isRequired,itemProps:c.PropTypes.oneOfType([c.PropTypes.object,c.PropTypes.func]),renderItem:c.PropTypes.func.isRequired,renderItemData:c.PropTypes.object.isRequired,sectionIndex:c.PropTypes.number,highlightedItemIndex:c.PropTypes.number,onHighlightedItemChange:c.PropTypes.func.isRequired,getItemId:c.PropTypes.func.isRequired,theme:c.PropTypes.func.isRequired,keyPrefix:c.PropTypes.string.isRequired},m.defaultProps={sectionIndex:null},t.default=m},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(2),p=r(l),f=n(7),h=r(f),d=function(e){function t(){var e,n,r,o;i(this,t);for(var s=arguments.length,a=Array(s),c=0;c<s;c++)a[c]=arguments[c];return n=r=u(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.storeItemReference=function(e){null!==e&&(r.item=e)},r.onMouseEnter=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onMouseEnter(e,{sectionIndex:n,itemIndex:o})},r.onMouseLeave=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onMouseLeave(e,{sectionIndex:n,itemIndex:o})},r.onMouseDown=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onMouseDown(e,{sectionIndex:n,itemIndex:o})},r.onClick=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onClick(e,{sectionIndex:n,itemIndex:o})},o=n,u(r,o)}return s(t,e),c(t,[{key:"shouldComponentUpdate",value:function(e){return(0,h.default)(e,this.props,["renderItemData"])}},{key:"render",value:function(){var e=this.props,t=e.item,n=e.renderItem,r=e.renderItemData,i=o(e,["item","renderItem","renderItemData"]);return delete i.sectionIndex,delete i.itemIndex,"function"==typeof i.onMouseEnter&&(i.onMouseEnter=this.onMouseEnter),"function"==typeof i.onMouseLeave&&(i.onMouseLeave=this.onMouseLeave),"function"==typeof i.onMouseDown&&(i.onMouseDown=this.onMouseDown),"function"==typeof i.onClick&&(i.onClick=this.onClick),p.default.createElement("li",a({role:"option"},i,{ref:this.storeItemReference}),n(t,r))}}]),t}(l.Component);d.propTypes={sectionIndex:l.PropTypes.number,itemIndex:l.PropTypes.number.isRequired,item:l.PropTypes.any.isRequired,renderItem:l.PropTypes.func.isRequired,renderItemData:l.PropTypes.object.isRequired,onMouseEnter:l.PropTypes.func,onMouseLeave:l.PropTypes.func,onMouseDown:l.PropTypes.func,onClick:l.PropTypes.func},t.default=d}])});
{
"name": "react-autowhatever",
"version": "7.0.0",
"version": "8.0.0",
"description": "Accessible rendering layer for Autosuggest and Autocomplete components",

@@ -32,34 +32,34 @@ "main": "dist/index.js",

"peerDependencies": {
"react": "^0.14.7 || ^15.0.1"
"react": ">=0.14.7 || >=16.0.0-alpha.2"
},
"devDependencies": {
"autoprefixer": "^6.5.1",
"autosuggest-highlight": "^3.0.0",
"babel-cli": "^6.16.0",
"babel-core": "^6.17.0",
"babel-eslint": "^7.0.0",
"babel-loader": "^6.2.5",
"babel-preset-es2015": "^6.16.0",
"babel-preset-react": "^6.16.0",
"babel-preset-stage-0": "^6.16.0",
"babel-register": "^6.16.3",
"autoprefixer": "^6.7.3",
"autosuggest-highlight": "^3.1.0",
"babel-cli": "^6.23.0",
"babel-core": "^6.23.1",
"babel-eslint": "^7.1.1",
"babel-loader": "^6.3.2",
"babel-preset-es2015": "^6.22.0",
"babel-preset-react": "^6.23.0",
"babel-preset-stage-0": "^6.22.0",
"babel-register": "^6.23.0",
"chai": "^3.5.0",
"css-loader": "^0.25.0",
"eslint": "^3.8.1",
"eslint-plugin-react": "^6.4.1",
"css-loader": "^0.26.1",
"eslint": "^3.15.0",
"eslint-plugin-react": "^6.10.0",
"extract-text-webpack-plugin": "^1.0.1",
"jsdom": "^9.8.0",
"less": "^2.7.1",
"jsdom": "^9.11.0",
"less": "^2.7.2",
"less-loader": "^2.2.3",
"mocha": "^3.1.2",
"mocha": "^3.2.0",
"openurl": "^1.1.1",
"postcss-loader": "^1.0.0",
"react": "^15.3.2",
"react-addons-test-utils": "^15.3.2",
"react-dom": "^15.3.2",
"react-hot-loader": "^1.3.0",
"postcss-loader": "^1.3.1",
"react": "^16.0.0-alpha.2",
"react-addons-test-utils": "^16.0.0-alpha.2",
"react-dom": "^16.0.0-alpha.2",
"react-hot-loader": "^1.3.1",
"react-isolated-scroll": "^0.1.0",
"react-redux": "^4.4.5",
"react-redux": "^4.4.6",
"redux": "^3.6.0",
"sinon": "^1.17.6",
"sinon": "^1.17.7",
"sinon-chai": "^2.8.0",

@@ -66,0 +66,0 @@ "style-loader": "^0.13.1",

[![Build Status](https://img.shields.io/codeship/6c79f8c0-2565-0133-4af8-72f090cba113/master.svg?style=flat-square)](https://codeship.com/projects/96953)
[![bitHound Overall Score](https://www.bithound.io/github/moroshko/react-autowhatever/badges/score.svg)](https://www.bithound.io/github/moroshko/react-autowhatever)
[![Pull Requests stats](https://img.shields.io/issuestats/p/long/github/moroshko/react-autowhatever.svg?style=flat-square)](http://issuestats.com/github/moroshko/react-autowhatever)
[![Issues stats](https://img.shields.io/issuestats/i/long/github/moroshko/react-autowhatever.svg?style=flat-square)](http://issuestats.com/github/moroshko/react-autowhatever)
[![npm Downloads](https://img.shields.io/npm/dm/react-autowhatever.svg?style=flat-square)](https://npmjs.org/package/react-autowhatever)

@@ -8,0 +4,0 @@ [![npm Version](https://img.shields.io/npm/v/react-autowhatever.svg?style=flat-square)](https://npmjs.org/package/react-autowhatever)

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