@@ -22,8 +22,6 @@ var _reactLibReactWithAddons2 = _interopRequireDefault(_reactLibReactWithAddons)
2222
2323var _reactDom = require ( 'react-dom' ) ;
2424
25- var _reactDom2 = _interopRequireDefault ( _reactDom ) ;
26-
2725var _reactBootstrap = require ( 'react-bootstrap' ) ;
2826
2927var _lodashCollectionMap = require ( 'lodash/collection/map' ) ;
@@ -39,6 +37,10 @@ var _lodashFunctionDebounce = require('lodash/function/debounce');
3937var _lodashFunctionDebounce2 = _interopRequireDefault ( _lodashFunctionDebounce ) ;
4038
4139var caret = _reactLibReactWithAddons2 [ 'default' ] . createElement ( 'span' , { className : 'caret' } ) ;
40+ var _React$PropTypes = _reactLibReactWithAddons2 [ 'default' ] . PropTypes ;
41+ var func = _React$PropTypes . func ;
42+ var object = _React$PropTypes . object ;
43+ var string = _React$PropTypes . string ;
4244
4345var uid = 0 ;
4446
@@ -49,8 +51,9 @@ var uid = 0;
4951 * @param {Object } props - A props config
5052 * @example
5153 * import {Combo} from 'react-bootstrap-combobox';
54+ * import {render} from 'react-dom';
5255 *
53- * ReactDOM. render(<Combo items={{
56+ * render(<Combo items={{
5457 * // keys must be unique
5558 * a: {label: 'first item', header: true}, // any combination of props supported by MenuItem
5659 * b: 'second item', // same as {label: 'second item'}
@@ -86,16 +89,6 @@ var Combo = (function (_React$Component) {
8689 */
8790 this . viewportHeight = 0 ;
8891
89- /**
90- * Handles browser resize events, debounced by 150ms
91- *
92- * @memberof Combo
93- * @instance
94- * @private
95- * @method handleResize
96- */
97- this . handleResize = ( 0 , _lodashFunctionDebounce2 [ 'default' ] ) ( this . onResize . bind ( this ) , 150 ) ;
98-
9992 /**
10093 * Holds component state
10194 *
@@ -105,6 +98,8 @@ var Combo = (function (_React$Component) {
10598 * @type {Object }
10699 */
107100 this . state = { maxHeight : null } ;
101+
102+ this . onResize = ( 0 , _lodashFunctionDebounce2 [ 'default' ] ) ( this . onResize . bind ( this ) , 150 ) ;
108103 }
109104
110105 /**
@@ -136,8 +131,8 @@ var Combo = (function (_React$Component) {
136131 } , {
137132 key : 'componentDidMount' ,
138133 value : function componentDidMount ( ) {
139- this . handleResize ( ) ;
140- window . addEventListener ( 'resize' , this . handleResize ) ;
134+ this . onResize ( ) ;
135+ window . addEventListener ( 'resize' , this . onResize ) ;
141136 }
142137
143138 /**
@@ -151,7 +146,7 @@ var Combo = (function (_React$Component) {
151146 } , {
152147 key : 'componentWillUnmount' ,
153148 value : function componentWillUnmount ( ) {
154- window . removeEventListener ( 'resize' , this . handleResize ) ;
149+ window . removeEventListener ( 'resize' , this . onResize ) ;
155150 }
156151
157152 /**
@@ -172,7 +167,7 @@ var Combo = (function (_React$Component) {
172167 }
173168 this . viewportHeight = height ;
174169
175- this . setState ( { maxHeight : height - _reactDom2 [ 'default' ] . findDOMNode ( this ) . getBoundingClientRect ( ) . bottom - 5 } ) ;
170+ this . setState ( { maxHeight : height - ( 0 , _reactDom . findDOMNode ) ( this ) . getBoundingClientRect ( ) . bottom - 5 } ) ;
176171 }
177172
178173 /**
@@ -204,7 +199,11 @@ var Combo = (function (_React$Component) {
204199 } , {
205200 key : 'getLabel' ,
206201 value : function getLabel ( ) {
207- return this . normalize ( this . props . items [ this . props . value ] ) . label ;
202+ var _props = this . props ;
203+ var items = _props . items ;
204+ var value = _props . value ;
205+
206+ return this . normalize ( items [ value ] ) . label ;
208207 }
209208
210209 /**
@@ -305,10 +304,6 @@ var Combo = (function (_React$Component) {
305304
306305exports [ 'default' ] = Combo ;
307306
308- Combo . propTypes = {
309- onChange : _reactLibReactWithAddons2 [ 'default' ] . PropTypes . func ,
310- items : _reactLibReactWithAddons2 [ 'default' ] . PropTypes . object . isRequired ,
311- value : _reactLibReactWithAddons2 [ 'default' ] . PropTypes . string . isRequired
312- } ;
307+ Combo . propTypes = { onChange : func , items : object . isRequired , value : string . isRequired } ;
313308Combo . defaultProps = { onChange : Function . prototype } ;
314309module . exports = exports [ 'default' ] ;
0 commit comments