@@ -35,10 +35,8 @@ class InputSpinner extends Component {
3535 spinnerStep = 1 ;
3636 }
3737
38- const min =
39- this . props . min != null ? this . parseNum ( this . props . min ) : null ;
40- const max =
41- this . props . max != null ? this . parseNum ( this . props . max ) : null ;
38+ const min = this . props . min != null ? this . parseNum ( this . props . min ) : null ;
39+ const max = this . props . max != null ? this . parseNum ( this . props . max ) : null ;
4240
4341 let initialValue =
4442 this . props . initialValue != null && ! isNaN ( 12 )
@@ -72,19 +70,13 @@ class InputSpinner extends Component {
7270 // Parse Min
7371 if ( this . props . min !== prevProps . min ) {
7472 this . setState ( {
75- min :
76- this . props . min != null
77- ? this . parseNum ( this . props . min )
78- : null ,
73+ min : this . props . min != null ? this . parseNum ( this . props . min ) : null ,
7974 } ) ;
8075 }
8176 // Parse Max
8277 if ( this . props . max !== prevProps . max ) {
8378 this . setState ( {
84- max :
85- this . props . max != null
86- ? this . parseNum ( this . props . max )
87- : null ,
79+ max : this . props . max != null ? this . parseNum ( this . props . max ) : null ,
8880 } ) ;
8981 }
9082 // Parse Step
@@ -198,10 +190,8 @@ class InputSpinner extends Component {
198190 */
199191 parseNum ( num ) {
200192 num = String ( num ) . replace (
201- ! isEmpty ( this . props . decimalSeparator )
202- ? this . props . decimalSeparator
203- : "." ,
204- "."
193+ ! isEmpty ( this . props . decimalSeparator ) ? this . props . decimalSeparator : "." ,
194+ "." ,
205195 ) ;
206196 if ( this . typeDecimal ( ) ) {
207197 num = parseFloat ( num ) ;
@@ -226,9 +216,7 @@ class InputSpinner extends Component {
226216 value = this . parseNum ( value ) . toFixed ( 1 ) . replace ( / 0 + $ / , "" ) ;
227217 } else if ( this . typeDecimal ( ) ) {
228218 value = String (
229- this . parseNum (
230- this . parseNum ( value ) . toFixed ( this . props . precision )
231- )
219+ this . parseNum ( this . parseNum ( value ) . toFixed ( this . props . precision ) ) ,
232220 ) ;
233221 } else {
234222 value = String ( this . parseNum ( value ) ) ;
@@ -240,7 +228,7 @@ class InputSpinner extends Component {
240228 "." ,
241229 ! isEmpty ( this . props . decimalSeparator )
242230 ? this . props . decimalSeparator
243- : "."
231+ : "." ,
244232 ) ;
245233 }
246234
@@ -284,8 +272,7 @@ class InputSpinner extends Component {
284272 */
285273 increase ( ) {
286274 if ( this . _isDisabledButtonRight ( ) ) return ;
287- let num =
288- this . parseNum ( this . state . value ) + this . parseNum ( this . state . step ) ;
275+ let num = this . parseNum ( this . state . value ) + this . parseNum ( this . state . step ) ;
289276 if ( this . props . onIncrease ) {
290277 let increased_num = num ;
291278 if ( this . maxReached ( num ) ) {
@@ -308,8 +295,7 @@ class InputSpinner extends Component {
308295 */
309296 decrease ( ) {
310297 if ( this . _isDisabledButtonLeft ( ) ) return ;
311- let num =
312- this . parseNum ( this . state . value ) - this . parseNum ( this . state . step ) ;
298+ let num = this . parseNum ( this . state . value ) - this . parseNum ( this . state . step ) ;
313299 if ( this . props . onDecrease ) {
314300 let decreased_num = num ;
315301 if ( this . minReached ( num ) ) {
@@ -564,9 +550,7 @@ class InputSpinner extends Component {
564550 */
565551 _getColorLeftButton ( ) {
566552 const color = this . _getColor ( ) ;
567- return this . props . colorLeft !== defaultColor
568- ? this . props . colorLeft
569- : color ;
553+ return this . props . colorLeft !== defaultColor ? this . props . colorLeft : color ;
570554 }
571555
572556 /**
@@ -590,9 +574,7 @@ class InputSpinner extends Component {
590574 return [
591575 Style . container ,
592576 {
593- borderColor : this . props . showBorder
594- ? this . _getColor ( )
595- : "transparent" ,
577+ borderColor : this . props . showBorder ? this . _getColor ( ) : "transparent" ,
596578 width : this . props . width ,
597579 } ,
598580 this . props . style ,
@@ -611,9 +593,7 @@ class InputSpinner extends Component {
611593 color : this . props . textColor ,
612594 fontSize : this . props . fontSize ,
613595 fontFamily : this . props . fontFamily ,
614- borderColor : this . props . showBorder
615- ? this . _getColor ( )
616- : "transparent" ,
596+ borderColor : this . props . showBorder ? this . _getColor ( ) : "transparent" ,
617597 backgroundColor : this . props . background ,
618598 height : this . props . height ,
619599 } ,
@@ -702,10 +682,7 @@ class InputSpinner extends Component {
702682 _renderLeftButtonElement ( ) {
703683 if ( this . props . buttonLeftImage ) {
704684 return this . props . buttonLeftImage ;
705- } else if (
706- this . _isLeftButtonPressed ( ) &&
707- this . props . buttonPressLeftImage
708- ) {
685+ } else if ( this . _isLeftButtonPressed ( ) && this . props . buttonPressLeftImage ) {
709686 return this . props . buttonPressLeftImage ;
710687 } else {
711688 const text =
@@ -820,9 +797,7 @@ class InputSpinner extends Component {
820797 */
821798 render ( ) {
822799 return (
823- < View
824- style = { this . _getContainerStyle ( ) }
825- { ...this . props . containerProps } >
800+ < View style = { this . _getContainerStyle ( ) } { ...this . props . containerProps } >
826801 { this . _renderLeftButton ( ) }
827802
828803 { this . props . prepend }
0 commit comments