@@ -95,16 +95,16 @@ class FilterExample extends React.Component {
95
95
expanded : [
96
96
'/app' ,
97
97
] ,
98
- filterText : "" ,
99
- nodes : nodes ,
100
- nodesFiltered : nodes
98
+ filterText : "" ,
99
+ nodes : nodes ,
100
+ nodesFiltered : nodes
101
101
} ;
102
102
103
103
this . onCheck = this . onCheck . bind ( this ) ;
104
104
this . onExpand = this . onExpand . bind ( this ) ;
105
- this . setFilterText = this . setFilterText . bind ( this ) ;
106
- this . filterTree = this . filterTree . bind ( this ) ;
107
- this . nodeFilter = this . nodeFilter . bind ( this ) ;
105
+ this . setFilterText = this . setFilterText . bind ( this ) ;
106
+ this . filterTree = this . filterTree . bind ( this ) ;
107
+ this . nodeFilter = this . nodeFilter . bind ( this ) ;
108
108
}
109
109
110
110
onCheck ( checked ) {
@@ -114,8 +114,8 @@ class FilterExample extends React.Component {
114
114
onExpand ( expanded ) {
115
115
this . setState ( { expanded } ) ;
116
116
}
117
-
118
- nodeFilter ( node : Node ) {
117
+
118
+ nodeFilter ( node : Node ) {
119
119
const children = ( node . children || [ ] ) . map ( this . nodeFilter ) . filter ( c => c !== null ) ;
120
120
121
121
return node . label . indexOf ( this . state . filterText ) !== - 1 || children . length ? { ...node , children : children } : null ;
@@ -134,25 +134,25 @@ class FilterExample extends React.Component {
134
134
nodesFiltered : nodesFiltered
135
135
} ) ;
136
136
}
137
-
138
- setFilterText ( e ) {
139
- this . setState ( { filterText : e . target . value } , this . filterTree ) ;
140
- }
137
+
138
+ setFilterText ( e ) {
139
+ this . setState ( { filterText : e . target . value } , this . filterTree ) ;
140
+ }
141
141
142
142
render ( ) {
143
143
const { checked, expanded } = this . state ;
144
144
145
145
return (
146
- < div >
147
- < input type = "text" placeholder = "Search" value = { this . state . filterText } onChange = { this . setFilterText } />
148
- < CheckboxTree
149
- checked = { checked }
150
- expanded = { expanded }
151
- nodes = { this . state . nodesFiltered }
152
- onCheck = { this . onCheck }
153
- onExpand = { this . onExpand }
154
- />
155
- </ div >
146
+ < div >
147
+ < input type = "text" placeholder = "Search" value = { this . state . filterText } onChange = { this . setFilterText } />
148
+ < CheckboxTree
149
+ checked = { checked }
150
+ expanded = { expanded }
151
+ nodes = { this . state . nodesFiltered }
152
+ onCheck = { this . onCheck }
153
+ onExpand = { this . onExpand }
154
+ />
155
+ </ div >
156
156
) ;
157
157
}
158
158
}
0 commit comments