@@ -40,51 +40,51 @@ type Props = {
40
40
} ;
41
41
42
42
class MultiSelect extends Component < Props > {
43
- static defaultProps = {
44
- hasSelectAll : true ,
45
- shouldToggleOnHover : false ,
46
- }
47
-
48
- getSelectedText ( ) {
49
- const { options , selected} = this . props ;
50
-
51
- const selectedOptions = selected
52
- . map ( s => options . find ( o => o . value === s ) ) ;
53
-
54
- const selectedLabels = selectedOptions . map ( s => s ? s . label : "" ) ;
55
-
56
- return selectedLabels . join ( ", " ) ;
57
- }
58
-
59
- renderHeader ( ) {
60
- const {
61
- options ,
62
- selected ,
63
- valueRenderer ,
64
- } = this . props ;
65
-
66
- const noneSelected = selected . length === 0 ;
67
- const allSelected = selected . length === options . length ;
68
-
69
- const customText = valueRenderer && valueRenderer ( selected , options ) ;
70
-
71
- if ( noneSelected ) {
72
- return < span style = { styles . noneSelected } >
73
- { customText || "Select some items..." }
74
- </ span > ;
75
- }
76
-
77
- if ( customText ) {
78
- return < span > { customText } </ span > ;
79
- }
80
-
81
- return < span >
82
- { allSelected
83
- ? "All items are selected"
84
- : this . getSelectedText ( )
85
- }
86
- </ span > ;
87
- }
43
+ static defaultProps = {
44
+ hasSelectAll : true ,
45
+ shouldToggleOnHover : false ,
46
+ }
47
+
48
+ getSelectedText ( ) {
49
+ const { options , selected} = this . props ;
50
+
51
+ const selectedOptions = selected
52
+ . map ( s => options . find ( o => o . value === s ) ) ;
53
+
54
+ const selectedLabels = selectedOptions . map ( s => s ? s . label : "" ) ;
55
+
56
+ return selectedLabels . join ( ", " ) ;
57
+ }
58
+
59
+ renderHeader ( ) {
60
+ const {
61
+ options ,
62
+ selected ,
63
+ valueRenderer ,
64
+ } = this . props ;
65
+
66
+ const noneSelected = selected . length === 0 ;
67
+ const allSelected = selected . length === options . length ;
68
+
69
+ const customText = valueRenderer && valueRenderer ( selected , options ) ;
70
+
71
+ if ( noneSelected ) {
72
+ return < span style = { styles . noneSelected } >
73
+ { customText || "Select some items..." }
74
+ </ span > ;
75
+ }
76
+
77
+ if ( customText ) {
78
+ return < span > { customText } </ span > ;
79
+ }
80
+
81
+ return < span >
82
+ { allSelected
83
+ ? "All items are selected"
84
+ : this . getSelectedText ( )
85
+ }
86
+ </ span > ;
87
+ }
88
88
89
89
handleSelectedChanged = ( selected : Array < any > ) => {
90
90
const { onSelectedChanged, disabled} = this . props ;
0 commit comments