1
- " use strict" ;
1
+ ' use strict' ;
2
2
3
3
Object . defineProperty ( exports , "__esModule" , {
4
4
value : true
5
5
} ) ;
6
6
7
7
var _createClass = function ( ) { function defineProperties ( target , props ) { for ( var i = 0 ; i < props . length ; i ++ ) { var descriptor = props [ i ] ; descriptor . enumerable = descriptor . enumerable || false ; descriptor . configurable = true ; if ( "value" in descriptor ) descriptor . writable = true ; Object . defineProperty ( target , descriptor . key , descriptor ) ; } } return function ( Constructor , protoProps , staticProps ) { if ( protoProps ) defineProperties ( Constructor . prototype , protoProps ) ; if ( staticProps ) defineProperties ( Constructor , staticProps ) ; return Constructor ; } ; } ( ) ;
8
8
9
- var _react = require ( " react" ) ;
9
+ var _react = require ( ' react' ) ;
10
10
11
11
var _react2 = _interopRequireDefault ( _react ) ;
12
12
@@ -36,19 +36,19 @@ var CheckButton = function (_Component) {
36
36
}
37
37
38
38
_createClass ( CheckButton , [ {
39
- key : " fill" ,
39
+ key : ' fill' ,
40
40
value : function fill ( ) {
41
- if ( this . props . isSelected ) return "#4285f4" ; else if ( this . state . hover ) return "rgba(255, 255, 255, 1)" ;
42
- return "rgba(255, 255, 255, 0.7)" ;
41
+ if ( this . props . isSelected ) return this . props . selectedColor ; else if ( this . state . hover ) return this . props . hoverColor ;
42
+ return this . props . color ;
43
43
}
44
44
} , {
45
- key : " visibility" ,
45
+ key : ' visibility' ,
46
46
value : function visibility ( ) {
47
47
if ( this . props . isSelected || this . props . isSelectable && this . props . parentHover ) return 'visible' ;
48
48
return 'hidden' ;
49
49
}
50
50
} , {
51
- key : " render" ,
51
+ key : ' render' ,
52
52
value : function render ( ) {
53
53
var _this2 = this ;
54
54
@@ -57,9 +57,9 @@ var CheckButton = function (_Component) {
57
57
} ;
58
58
59
59
return _react2 . default . createElement (
60
- " div" ,
60
+ ' div' ,
61
61
{
62
- title : " Select" ,
62
+ title : ' Select' ,
63
63
style : {
64
64
visibility : this . visibility ( ) ,
65
65
background : 'none' ,
@@ -80,43 +80,43 @@ var CheckButton = function (_Component) {
80
80
return _this2 . setState ( { hover : false } ) ;
81
81
} } ,
82
82
_react2 . default . createElement (
83
- " svg" ,
83
+ ' svg' ,
84
84
{
85
85
fill : this . fill ( ) ,
86
- height : "24" , viewBox : " 0 0 24 24" ,
87
- width : "24" ,
88
- xmlns : " http://www.w3.org/2000/svg" } ,
86
+ height : '24' , viewBox : ' 0 0 24 24' ,
87
+ width : '24' ,
88
+ xmlns : ' http://www.w3.org/2000/svg' } ,
89
89
_react2 . default . createElement (
90
- " radialGradient" ,
90
+ ' radialGradient' ,
91
91
{
92
- id : " shadow" ,
93
- cx : "38" ,
94
- cy : " 95.488" ,
95
- r : " 10.488" ,
96
- gradientTransform : " matrix(1 0 0 -1 -26 109)" ,
97
- gradientUnits : " userSpaceOnUse" } ,
98
- _react2 . default . createElement ( " stop" , {
99
- offset : " .832" ,
100
- stopColor : " #010101" } ) ,
101
- _react2 . default . createElement ( " stop" , {
102
- offset : "1" ,
103
- stopColor : " #010101" ,
104
- stopOpacity : "0" } )
92
+ id : ' shadow' ,
93
+ cx : '38' ,
94
+ cy : ' 95.488' ,
95
+ r : ' 10.488' ,
96
+ gradientTransform : ' matrix(1 0 0 -1 -26 109)' ,
97
+ gradientUnits : ' userSpaceOnUse' } ,
98
+ _react2 . default . createElement ( ' stop' , {
99
+ offset : ' .832' ,
100
+ stopColor : ' #010101' } ) ,
101
+ _react2 . default . createElement ( ' stop' , {
102
+ offset : '1' ,
103
+ stopColor : ' #010101' ,
104
+ stopOpacity : '0' } )
105
105
) ,
106
- _react2 . default . createElement ( " circle" , {
106
+ _react2 . default . createElement ( ' circle' , {
107
107
style : circleStyle ,
108
- opacity : " .26" ,
109
- fill : " url(#shadow)" ,
110
- cx : "12" , cy : " 13.512" ,
111
- r : " 10.488" } ) ,
112
- _react2 . default . createElement ( " circle" , {
108
+ opacity : ' .26' ,
109
+ fill : ' url(#shadow)' ,
110
+ cx : '12' , cy : ' 13.512' ,
111
+ r : ' 10.488' } ) ,
112
+ _react2 . default . createElement ( ' circle' , {
113
113
style : circleStyle ,
114
- fill : " #FFF" ,
115
- cx : "12" ,
116
- cy : " 12.2" ,
117
- r : " 8.292" } ) ,
118
- _react2 . default . createElement ( " path" , { d : " M0 0h24v24H0z" , fill : " none" } ) ,
119
- _react2 . default . createElement ( " path" , { d : " M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" } )
114
+ fill : ' #FFF' ,
115
+ cx : '12' ,
116
+ cy : ' 12.2' ,
117
+ r : ' 8.292' } ) ,
118
+ _react2 . default . createElement ( ' path' , { d : ' M0 0h24v24H0z' , fill : ' none' } ) ,
119
+ _react2 . default . createElement ( ' path' , { d : ' M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z' } )
120
120
)
121
121
) ;
122
122
}
@@ -126,15 +126,19 @@ var CheckButton = function (_Component) {
126
126
} ( _react . Component ) ;
127
127
128
128
CheckButton . propTypes = { index : _react . PropTypes . number ,
129
+ color : _react . PropTypes . string ,
129
130
isSelectable : _react . PropTypes . bool ,
130
131
isSelected : _react . PropTypes . bool ,
132
+ selectedColor : _react . PropTypes . string ,
131
133
parentHover : _react . PropTypes . bool ,
132
134
hover : _react . PropTypes . bool ,
135
+ hoverColor : _react . PropTypes . string ,
133
136
onClick : _react . PropTypes . func } ;
134
137
135
138
CheckButton . defaultProps = { isSelectable : true ,
136
139
isSelected : false ,
137
140
parentHover : false ,
138
141
hover : false } ;
139
142
140
- exports . default = CheckButton ;
143
+ exports . default = CheckButton ;
144
+ //module.exports = CheckButton;
0 commit comments