@@ -9,7 +9,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
99
1010'use strict' ;
1111
12- import React from 'react' ;
12+ import React , { PropTypes } from 'react' ;
1313import SLDSPopover from '../SLDSPopover' ;
1414import List from './list' ;
1515
@@ -21,6 +21,12 @@ import {KEYS,EventUtil} from '../utils';
2121
2222module . exports = React . createClass ( {
2323
24+ propTypes : {
25+ onClick : PropTypes . func ,
26+ onSelect : PropTypes . func . isRequired ,
27+ onUpdateHighlighted : PropTypes . func
28+ } ,
29+
2430 getDefaultProps ( ) {
2531 return {
2632 placeholder : 'Select an Option' ,
@@ -32,15 +38,7 @@ module.exports = React.createClass( {
3238 initialFocus : false ,
3339 modal : false ,
3440 className :'' ,
35- listClassName :'' ,
36- onClick ( ) {
37- } ,
38- onSelect ( value ) {
39- console . log ( 'onItemSelect should be defined' ) ;
40- } ,
41- onUpdateHighlighted ( nextIndex ) {
42- console . log ( 'onUpdateHighlighted should be defined' ) ;
43- }
41+ listClassName :''
4442 }
4543 } ,
4644
@@ -130,9 +128,9 @@ module.exports = React.createClass( {
130128
131129 handleKeyDown ( event ) {
132130 if ( event . keyCode ) {
133- if ( event . keyCode === KEYS . ENTER ||
134- event . keyCode === KEYS . SPACE ||
135- event . keyCode === KEYS . DOWN ||
131+ if ( event . keyCode === KEYS . ENTER ||
132+ event . keyCode === KEYS . SPACE ||
133+ event . keyCode === KEYS . DOWN ||
136134 event . keyCode === KEYS . UP ) {
137135 EventUtil . trapEvent ( event ) ;
138136
@@ -165,8 +163,8 @@ module.exports = React.createClass( {
165163 className = { this . props . listClassName }
166164 highlightedIndex = { this . state . highlightedIndex }
167165 selectedIndex = { this . state . selectedIndex }
168- onSelect = { this . handleSelect }
169- onUpdateHighlighted = { this . handleUpdateHighlighted }
166+ onSelect = { this . handleSelect }
167+ onUpdateHighlighted = { this . handleUpdateHighlighted }
170168 onListBlur = { this . handleListBlur }
171169 onListItemBlur = { this . handleListItemBlur }
172170 onCancel = { this . handleCancel }
@@ -176,9 +174,9 @@ module.exports = React.createClass( {
176174 getSimplePopover ( ) {
177175 return (
178176 ! this . props . disabled && this . state . isOpen ?
179- < div
180- className = "slds-dropdown slds-dropdown--left slds-dropdown--small slds-dropdown--menu"
181- targetElement = { this . refs . button }
177+ < div
178+ className = "slds-dropdown slds-dropdown--left slds-dropdown--small slds-dropdown--menu"
179+ targetElement = { this . refs . button }
182180 style = { { maxHeight :'20em' } } >
183181 { this . getPopoverContent ( ) }
184182 </ div > :null
@@ -188,9 +186,9 @@ module.exports = React.createClass( {
188186 getModalPopover ( ) {
189187 return (
190188 ! this . props . disabled && this . state . isOpen ?
191- < SLDSPopover
192- className = 'slds-dropdown slds-dropdown--left slds-dropdown--small slds-dropdown--menu'
193- targetElement = { this . refs . date }
189+ < SLDSPopover
190+ className = 'slds-dropdown slds-dropdown--left slds-dropdown--small slds-dropdown--menu'
191+ targetElement = { this . refs . date }
194192 closeOnTabKey = { true }
195193 onClose = { this . handleCancel } >
196194 { this . getPopoverContent ( ) }
@@ -217,7 +215,7 @@ module.exports = React.createClass( {
217215 < div className = { "slds-form-element slds-theme--" + this . props . theme } >
218216 < div className = { "slds-picklist slds-theme--" + this . props . theme } >
219217 < form >
220- < button
218+ < button
221219 id = { this . props . id }
222220 ref = "button"
223221 className = { 'slds-button slds-button--neutral slds-picklist__label ' + this . props . className }
0 commit comments