react-native-custom-stepper
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -26,7 +26,19 @@ /* | ||
/* | ||
Normalizes the initial value that is sent through the component props. | ||
*/ | ||
_effectiveInitialValue = () => { | ||
var { initialValue, minValue, maxValue} = this.props | ||
return Math.min(Math.max(initialValue, minValue), maxValue) | ||
} | ||
state = { | ||
value: this.props.minValue | ||
value: this._effectiveInitialValue() | ||
} | ||
/* | ||
@@ -129,2 +141,4 @@ Decrements the value of the number stepper. If autoRepeat is true and the value is currently | ||
initialValue: 0, | ||
labelBackgroundColor: color.lightGreen, | ||
@@ -131,0 +145,0 @@ labelFontColor: color.white, |
{ | ||
"name": "react-native-custom-stepper", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A customizable React Native number stepper component.", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
## 🎟 Demo | ||
![NumberStepper](https://github.com/jadghadry/react-native-custom-stepper/raw/master/resources/NumberStepper.gif?raw=true) | ||
![NumberStepper](https://github.com/jadghadry/react-native-custom-stepper/raw/master/resources/NumberStepper.gif) | ||
@@ -11,3 +11,3 @@ ## ⚙️ Installation | ||
*I will thrive to maintain backward compatibility for this component throughout its updates. However, due to the nature of the platform and the potential breaking changes between react native releases, the aforementioned might be impossible to achieve.* | ||
*I will do my best to maintain backward compatibility for this component throughout its updates. However, due to the nature of the platform and the potential breaking changes between react native releases, the aforementioned might be impossible to achieve.* | ||
@@ -21,3 +21,3 @@ | ||
| `autoRepeat` | `boolean` | `true` | Used to determine whether the stepper should automatically repeat after reaching `minValue` or `maxValue` | | ||
| `borderColor` | `string` | `null` | The stepper's overall border color | | ||
| `borderColor` | `string` | `#000000` | The stepper's overall border color | | ||
| `borderRadius` | `number` | `8` | The stepper's outer border radius | | ||
@@ -32,2 +32,3 @@ | `borderWidth` | `number` | `0` | The stepper's overall border width | | ||
| `incrementButtonText` | `string` | `+` | The stepper's increment button text | | ||
| `initialValue` | `number` | `0` | The initial value of the stepper | | ||
| `labelBackgroundColor` | `string` | `#AED581` | The background color applied to the stepper label | | ||
@@ -34,0 +35,0 @@ | `labelFontColor` | `string` | `#FFFFFF` | The font color applied to the stepper label | |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
248400
160
52