11import { Component } from 'react' ;
2- < << << << 1 d6ac39c2109b8271f6e20f4ad9e6d87ade3a5ef
32import {
43 arrayOf ,
54 shape ,
98 oneOfType ,
109 object ,
1110} from 'prop-types' ;
12- = === ===
13- import { arrayOf , shape , number , string , func , oneOfType , object } from 'prop-types' ;
14- > >>> >>> add node jd
1511import classNames from 'classnames' ;
1612import { prop } from 'ramda' ;
1713import memoize from 'fast-memoize' ;
@@ -27,12 +23,8 @@ const pickClassName = prop('className');
2723const tree = {
2824 // The node value.
2925 value : string . isRequired ,
30- << < << << 1 d6ac39c2109b8271f6e20f4ad9e6d87ade3a5ef
3126 // Optional node ID. Useful for when the node value is not unique.
3227 id : oneOfType ( [ string , number ] ) ,
33- = === ===
34- id : oneOfType [ string , number ] ,
35- > >>> >>> add node jd
3628} ;
3729
3830Object . assign ( tree , {
@@ -72,7 +64,7 @@ const styles = theme => ({
7264 } ,
7365 expandIcon : { } ,
7466 highlightItem : {
75- backgroundColor : 'rgb(220, 227, 239 )' ,
67+ backgroundColor : 'rgb(138, 138, 138 )' ,
7668 } ,
7769} ) ;
7870
@@ -94,7 +86,7 @@ class MuiTreeView extends Component {
9486 /** Properties applied to the ListItem element. */
9587 listItemProps : object ,
9688 /** Id of a leaf which will be highlighted by adding the class */
97- highlightId : oneOfType [ string , number ] ,
89+ highlightId : oneOfType [ ( string , number ) ] ,
9890 } ;
9991
10092 static defaultProps = {
@@ -114,11 +106,7 @@ class MuiTreeView extends Component {
114106 }
115107 ) ;
116108
117- < << << << 1 d6ac39c2109b8271f6e20f4ad9e6d87ade3a5ef
118109 handleLeafClick = leaf => {
119- === === =
120- handleLeafClick = ( leaf ) => {
121- >>> >>> > add node jd
122110 if ( this . props . onLeafClick ) {
123111 this . props . onLeafClick ( leaf ) ;
124112 }
@@ -193,9 +181,7 @@ class MuiTreeView extends Component {
193181 { ...expansionPanelDetailsProps }
194182 classes = { { root : classes . panelDetails } }
195183 className = { classNames ( pickClassName ( expansionPanelDetailsProps ) ) } >
196- { node . nodes . map ( l =>
197- this . renderNode ( l , node , depth + 1 )
198- ) }
184+ { node . nodes . map ( l => this . renderNode ( l , node , depth + 1 ) ) }
199185 </ ExpansionPanelDetails >
200186 </ ExpansionPanel >
201187 ) ;
0 commit comments