@momo-kits/stepper 0.169.8 → 0.169.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.tsx +9 -9
  2. package/package.json +1 -1
package/index.tsx CHANGED
@@ -49,7 +49,7 @@ const Stepper = forwardRef(
49
49
  useImperativeHandle(ref, () => ({
50
50
  setStepValue: (nextValue: React.SetStateAction<number>) => {
51
51
  setValue(nextValue);
52
- _onValueChange(nextValue.toString());
52
+ handleValueChange(nextValue.toString());
53
53
  },
54
54
  }));
55
55
 
@@ -57,15 +57,15 @@ const Stepper = forwardRef(
57
57
  setValue(defaultValue);
58
58
  }, [defaultValue]);
59
59
 
60
- const onPlus = () => {
60
+ const handlePlus = () => {
61
61
  let newValue = value + step;
62
- _onValueChange(newValue.toString());
62
+ handleValueChange(newValue.toString());
63
63
  };
64
- const onMinus = () => {
64
+ const handleMinus = () => {
65
65
  let newValue = value - step;
66
- _onValueChange(newValue.toString());
66
+ handleValueChange(newValue.toString());
67
67
  };
68
- const _onValueChange = (num: string) => {
68
+ const handleValueChange = (num: string) => {
69
69
  let newValue = parseInt(num, 10);
70
70
 
71
71
  if (isNaN(newValue)) {
@@ -114,14 +114,14 @@ const Stepper = forwardRef(
114
114
  return (
115
115
  <View style={styles.stepper} accessibilityLabel={componentId}>
116
116
  <StepperButton
117
- onPress={onMinus}
117
+ onPress={handleMinus}
118
118
  sign={'-'}
119
119
  size={size}
120
120
  disabled={viewStatus.minus}
121
121
  componentId={componentId}
122
122
  />
123
123
  <NumberView
124
- onValueChange={_onValueChange}
124
+ onValueChange={handleValueChange}
125
125
  size={size}
126
126
  value={value}
127
127
  disabled={viewStatus.number}
@@ -129,7 +129,7 @@ const Stepper = forwardRef(
129
129
  componentId={componentId}
130
130
  />
131
131
  <StepperButton
132
- onPress={onPlus}
132
+ onPress={handlePlus}
133
133
  size={size}
134
134
  disabled={viewStatus.plus}
135
135
  componentId={componentId}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/stepper",
3
- "version": "0.169.8",
3
+ "version": "0.169.10",
4
4
  "private": false,
5
5
  "main": "index.tsx",
6
6
  "peerDependencies": {