@harya72/react-native-ruler 1.0.0
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.
- package/LICENSE +21 -0
- package/README.md +212 -0
- package/dist/Ruler.d.ts +21 -0
- package/dist/Ruler.d.ts.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +268 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +273 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +155 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +75 -0
- package/src/Ruler.tsx +457 -0
- package/src/index.ts +8 -0
- package/src/types.ts +182 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 harya72
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
# @harya72/react-native-ruler
|
|
2
|
+
|
|
3
|
+
A highly customizable, performant ruler/picker component for React Native with smooth animations powered by Reanimated.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
✨ **Smooth Animations** - Built with `react-native-reanimated` for 60fps performance
|
|
11
|
+
🎨 **Highly Customizable** - Control colors, sizes, and styles of every element
|
|
12
|
+
📱 **Cross-Platform** - Works on iOS and Android
|
|
13
|
+
🔧 **TypeScript Support** - Full type definitions included
|
|
14
|
+
🎯 **Precise Control** - Configurable min, max, step values
|
|
15
|
+
🌈 **Optional Gradients** - Fade effects with `expo-linear-gradient` (optional)
|
|
16
|
+
⚡ **Optimized** - Virtualized list for handling large ranges efficiently
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install @harya72/react-native-ruler
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
or
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
yarn add @harya72/react-native-ruler
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Peer Dependencies
|
|
31
|
+
|
|
32
|
+
This library requires the following peer dependencies:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install react-native-reanimated
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Optional:** For fade gradient effects:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npx expo install expo-linear-gradient
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
> **Note:** If you don't install `expo-linear-gradient`, the component will work perfectly fine without the fade effects.
|
|
45
|
+
|
|
46
|
+
## Usage
|
|
47
|
+
|
|
48
|
+
### Basic Example
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
import React, { useState } from 'react';
|
|
52
|
+
import { View, StyleSheet } from 'react-native';
|
|
53
|
+
import Ruler from '@harya72/react-native-ruler';
|
|
54
|
+
|
|
55
|
+
export default function App() {
|
|
56
|
+
const [value, setValue] = useState(50);
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<View style={styles.container}>
|
|
60
|
+
<Ruler
|
|
61
|
+
min={0}
|
|
62
|
+
max={200}
|
|
63
|
+
step={1}
|
|
64
|
+
height={100}
|
|
65
|
+
initialValue={value}
|
|
66
|
+
onChange={(newValue) => setValue(newValue)}
|
|
67
|
+
/>
|
|
68
|
+
</View>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const styles = StyleSheet.create({
|
|
73
|
+
container: {
|
|
74
|
+
flex: 1,
|
|
75
|
+
justifyContent: 'center',
|
|
76
|
+
backgroundColor: '#000',
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Advanced Example with Customization
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
import React, { useState } from 'react';
|
|
85
|
+
import { View, StyleSheet, Text } from 'react-native';
|
|
86
|
+
import Ruler from '@harya72/react-native-ruler';
|
|
87
|
+
|
|
88
|
+
export default function App() {
|
|
89
|
+
const [weight, setWeight] = useState(70);
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<View style={styles.container}>
|
|
93
|
+
<Ruler
|
|
94
|
+
min={30}
|
|
95
|
+
max={150}
|
|
96
|
+
step={0.5}
|
|
97
|
+
height={120}
|
|
98
|
+
initialValue={weight}
|
|
99
|
+
onChange={setWeight}
|
|
100
|
+
// Styling
|
|
101
|
+
longBarColor="#4CAF50"
|
|
102
|
+
shortBarColor="#81C784"
|
|
103
|
+
indicatorColor="#FF5722"
|
|
104
|
+
indicatorHeight={120}
|
|
105
|
+
indicatorWidth={8}
|
|
106
|
+
// Gradient fade (requires expo-linear-gradient)
|
|
107
|
+
supportLinearGradient={true}
|
|
108
|
+
fadeWidth={0.3}
|
|
109
|
+
fadeOpacity={0.2}
|
|
110
|
+
// Custom text component
|
|
111
|
+
textComponent={(currentValue) => (
|
|
112
|
+
<Text style={styles.customText}>
|
|
113
|
+
{currentValue.value} kg
|
|
114
|
+
</Text>
|
|
115
|
+
)}
|
|
116
|
+
/>
|
|
117
|
+
</View>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const styles = StyleSheet.create({
|
|
122
|
+
container: {
|
|
123
|
+
flex: 1,
|
|
124
|
+
justifyContent: 'center',
|
|
125
|
+
backgroundColor: '#1a1a1a',
|
|
126
|
+
},
|
|
127
|
+
customText: {
|
|
128
|
+
fontSize: 48,
|
|
129
|
+
fontWeight: 'bold',
|
|
130
|
+
color: '#4CAF50',
|
|
131
|
+
marginBottom: 24,
|
|
132
|
+
textAlign: 'center',
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## API Reference
|
|
138
|
+
|
|
139
|
+
### Props
|
|
140
|
+
|
|
141
|
+
| Prop | Type | Default | Description |
|
|
142
|
+
|------|------|---------|-------------|
|
|
143
|
+
| `min` | `number` | **Required** | Minimum value on the ruler |
|
|
144
|
+
| `max` | `number` | **Required** | Maximum value on the ruler |
|
|
145
|
+
| `height` | `number` | **Required** | Height of the ruler component |
|
|
146
|
+
| `onChange` | `(value: number) => void` | **Required** | Callback when value changes |
|
|
147
|
+
| `step` | `number` | `1` | Step increment between values |
|
|
148
|
+
| `initialValue` | `number` | `min` | Initial value to display |
|
|
149
|
+
| `decelerationRate` | `'fast' \| 'normal'` | `'normal'` | Scroll deceleration rate |
|
|
150
|
+
| `longBarHeight` | `number` | `50` | Height of long bars (every 10th) |
|
|
151
|
+
| `shortBarHeight` | `number` | `30` | Height of short bars |
|
|
152
|
+
| `longBarWidth` | `number` | `6` | Width of long bars |
|
|
153
|
+
| `shortBarWidth` | `number` | `3` | Width of short bars |
|
|
154
|
+
| `longBarColor` | `string` | `'white'` | Color of long bars |
|
|
155
|
+
| `shortBarColor` | `string` | `'#B5B5B5'` | Color of short bars |
|
|
156
|
+
| `gapBetweenSteps` | `number` | `10` | Gap between ruler steps |
|
|
157
|
+
| `borderRadius` | `number` | `50` | Border radius for bars |
|
|
158
|
+
| `indicatorColor` | `string` | `'white'` | Color of center indicator |
|
|
159
|
+
| `indicatorHeight` | `number` | `100` | Height of center indicator |
|
|
160
|
+
| `indicatorWidth` | `number` | `10` | Width of center indicator |
|
|
161
|
+
| `supportLinearGradient` | `boolean` | `false` | Enable fade gradients (requires expo-linear-gradient) |
|
|
162
|
+
| `fadeWidth` | `number` | `0.25` | Width of fade as % of screen (0-1) |
|
|
163
|
+
| `fadeOpacity` | `number` | `0.1` | Opacity of fade gradient (0-1) |
|
|
164
|
+
| `textStyle` | `StyleProp<TextStyle>` | - | Style for the value text |
|
|
165
|
+
| `style` | `StyleProp<ViewStyle>` | - | Style for container |
|
|
166
|
+
| `barComponent` | `ReactNode` | - | Custom center indicator component |
|
|
167
|
+
| `textComponent` | `(value: SharedValue<string>) => ReactNode` | - | Custom text display component |
|
|
168
|
+
|
|
169
|
+
## TypeScript
|
|
170
|
+
|
|
171
|
+
The library is written in TypeScript and includes full type definitions. Import types as needed:
|
|
172
|
+
|
|
173
|
+
```tsx
|
|
174
|
+
import Ruler, { RulerProps } from '@harya72/react-native-ruler';
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Performance Tips
|
|
178
|
+
|
|
179
|
+
- The component uses `FlatList` with virtualization for optimal performance
|
|
180
|
+
- For large ranges (e.g., 0-1000), consider using a larger `step` value
|
|
181
|
+
- The component is optimized with `memo` and `useCallback` to prevent unnecessary re-renders
|
|
182
|
+
|
|
183
|
+
## Troubleshooting
|
|
184
|
+
|
|
185
|
+
### Gradients not showing
|
|
186
|
+
|
|
187
|
+
Make sure you have `expo-linear-gradient` installed and `supportLinearGradient` is set to `true`:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
npx expo install expo-linear-gradient
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Value not updating
|
|
194
|
+
|
|
195
|
+
Ensure you're using the `onChange` callback to update your state:
|
|
196
|
+
|
|
197
|
+
```tsx
|
|
198
|
+
const [value, setValue] = useState(50);
|
|
199
|
+
<Ruler onChange={setValue} initialValue={value} ... />
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Contributing
|
|
203
|
+
|
|
204
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
205
|
+
|
|
206
|
+
## License
|
|
207
|
+
|
|
208
|
+
MIT © harya72
|
|
209
|
+
|
|
210
|
+
## Support
|
|
211
|
+
|
|
212
|
+
If you like this project, please give it a ⭐ on [GitHub](https://github.com/harya72/react-native-ruler)!
|
package/dist/Ruler.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { RulerProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* A highly customizable, performant ruler component for React Native
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <Ruler
|
|
9
|
+
* min={0}
|
|
10
|
+
* max={200}
|
|
11
|
+
* step={1}
|
|
12
|
+
* height={100}
|
|
13
|
+
* initialValue={50}
|
|
14
|
+
* onChange={(value) => console.log('Selected:', value)}
|
|
15
|
+
* supportLinearGradient={true}
|
|
16
|
+
* />
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare const Ruler: ({ onChange, max, min, fadeWidth, fadeOpacity, decelerationRate, ...rest }: RulerProps) => React.JSX.Element;
|
|
20
|
+
export default Ruler;
|
|
21
|
+
//# sourceMappingURL=Ruler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Ruler.d.ts","sourceRoot":"","sources":["../src/Ruler.tsx"],"names":[],"mappings":"AAOA,OAAO,KAMN,MAAM,OAAO,CAAC;AAOf,OAAO,KAAK,EACV,UAAU,EAIX,MAAM,SAAS,CAAC;AAmGjB;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,KAAK,GAAI,2EAQZ,UAAU,sBAkSZ,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,YAAY,EACV,UAAU,EACV,sBAAsB,EACtB,yBAAyB,EACzB,QAAQ,GACT,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { Dimensions, View, TextInput, StyleSheet, Platform } from 'react-native';
|
|
2
|
+
import React, { memo, useMemo, useCallback, useRef, useEffect } from 'react';
|
|
3
|
+
import Animated, { useAnimatedProps, useSharedValue, useAnimatedScrollHandler, runOnJS } from 'react-native-reanimated';
|
|
4
|
+
|
|
5
|
+
let LinearGradient = null;
|
|
6
|
+
try {
|
|
7
|
+
// @ts-ignore
|
|
8
|
+
LinearGradient = require('expo-linear-gradient').LinearGradient;
|
|
9
|
+
}
|
|
10
|
+
catch (e) {
|
|
11
|
+
// expo-linear-gradient not installed, fade gradients will be disabled
|
|
12
|
+
}
|
|
13
|
+
const { width: SCREEN_WIDTH } = Dimensions.get('window');
|
|
14
|
+
const { width: screenWidth } = Dimensions.get('screen');
|
|
15
|
+
const FADE_CONFIG = {
|
|
16
|
+
fadeWidth: 0.25,
|
|
17
|
+
fadeOpacity: 0.1,
|
|
18
|
+
};
|
|
19
|
+
const STEP = 1;
|
|
20
|
+
const LONG_BAR_WIDTH = 6;
|
|
21
|
+
const LONG_BAR_HEIGHT = 50;
|
|
22
|
+
const SHORT_BAR_WIDTH = 3;
|
|
23
|
+
const SHORT_BAR_HEIGHT = 30;
|
|
24
|
+
const LONG_BAR_COLOR = 'white';
|
|
25
|
+
const SHORT_BAR_COLOR = '#B5B5B5';
|
|
26
|
+
const GAP = 10;
|
|
27
|
+
const BORDER_RADIUS = 50;
|
|
28
|
+
const Bar = memo(({ index, longBarHeight, longBarWidth, shortBarHeight, shortBarWidth, longBarColor, shortBarColor, borderRadius, }) => {
|
|
29
|
+
const isLong = index % 10 === 0;
|
|
30
|
+
const barWidth = isLong ? longBarWidth : shortBarWidth;
|
|
31
|
+
const barHeight = isLong ? longBarHeight : shortBarHeight;
|
|
32
|
+
const margin = (longBarWidth - barWidth) / 2;
|
|
33
|
+
return (React.createElement(View, { style: {
|
|
34
|
+
height: barHeight,
|
|
35
|
+
backgroundColor: isLong ? longBarColor : shortBarColor,
|
|
36
|
+
width: barWidth,
|
|
37
|
+
borderRadius: borderRadius,
|
|
38
|
+
marginHorizontal: margin,
|
|
39
|
+
} }));
|
|
40
|
+
});
|
|
41
|
+
Bar.displayName = 'Bar';
|
|
42
|
+
const AnimatedTextInput = Animated.createAnimatedComponent(TextInput);
|
|
43
|
+
const AnimatedText = memo(({ text, fontSize = 96, style, }) => {
|
|
44
|
+
const animatedProps = useAnimatedProps(() => {
|
|
45
|
+
return {
|
|
46
|
+
text: text.value,
|
|
47
|
+
defaultValue: text.value,
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
const textStyle = [
|
|
51
|
+
style,
|
|
52
|
+
{
|
|
53
|
+
fontSize: fontSize,
|
|
54
|
+
padding: 0,
|
|
55
|
+
margin: 0,
|
|
56
|
+
textAlign: 'center',
|
|
57
|
+
textAlignVertical: 'center',
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
return (React.createElement(AnimatedTextInput, { animatedProps: animatedProps, editable: false, underlineColorAndroid: "transparent", style: [textStyle, { opacity: 1 }], multiline: false }));
|
|
61
|
+
});
|
|
62
|
+
AnimatedText.displayName = 'AnimatedText';
|
|
63
|
+
/**
|
|
64
|
+
* A highly customizable, performant ruler component for React Native
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```tsx
|
|
68
|
+
* <Ruler
|
|
69
|
+
* min={0}
|
|
70
|
+
* max={200}
|
|
71
|
+
* step={1}
|
|
72
|
+
* height={100}
|
|
73
|
+
* initialValue={50}
|
|
74
|
+
* onChange={(value) => console.log('Selected:', value)}
|
|
75
|
+
* supportLinearGradient={true}
|
|
76
|
+
* />
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
const Ruler = ({ onChange, max, min, fadeWidth = FADE_CONFIG.fadeWidth, fadeOpacity = FADE_CONFIG.fadeOpacity, decelerationRate = 'normal', ...rest }) => {
|
|
80
|
+
// Prop validation
|
|
81
|
+
if (__DEV__) {
|
|
82
|
+
if (min >= max) {
|
|
83
|
+
console.error('Ruler: min must be less than max');
|
|
84
|
+
}
|
|
85
|
+
if (rest?.step !== undefined && rest.step <= 0) {
|
|
86
|
+
console.error('Ruler: step must be greater than 0');
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const MAX = max;
|
|
90
|
+
const MIN = min;
|
|
91
|
+
const step = rest?.step ?? STEP;
|
|
92
|
+
const longBarWidth = rest?.longBarWidth ?? LONG_BAR_WIDTH;
|
|
93
|
+
const shortBarWidth = rest?.shortBarWidth ?? SHORT_BAR_WIDTH;
|
|
94
|
+
const longBarHeight = rest?.longBarHeight ?? LONG_BAR_HEIGHT;
|
|
95
|
+
const shortBarHeight = rest?.shortBarHeight ?? SHORT_BAR_HEIGHT;
|
|
96
|
+
const longBarColor = rest?.longBarColor ?? LONG_BAR_COLOR;
|
|
97
|
+
const shortBarColor = rest?.shortBarColor ?? SHORT_BAR_COLOR;
|
|
98
|
+
const gap = rest?.gapBetweenSteps ?? GAP;
|
|
99
|
+
const borderRadius = rest?.borderRadius ?? BORDER_RADIUS;
|
|
100
|
+
// Calculate fraction digits based on step precision
|
|
101
|
+
const fractionDigits = useMemo(() => {
|
|
102
|
+
if (step >= 1)
|
|
103
|
+
return 0;
|
|
104
|
+
const decimals = step.toString().split('.')[1]?.length || 0;
|
|
105
|
+
return Math.min(decimals, 10);
|
|
106
|
+
}, [step]);
|
|
107
|
+
const formatValue = useCallback((value) => value.toFixed(fractionDigits), [fractionDigits]);
|
|
108
|
+
const getInitialValue = useCallback(() => {
|
|
109
|
+
const initialVal = rest?.initialValue !== undefined ? rest.initialValue : MIN;
|
|
110
|
+
return Math.max(MIN, Math.min(initialVal, MAX));
|
|
111
|
+
}, [rest?.initialValue, MIN, MAX]);
|
|
112
|
+
const prevInitialValue = useRef(getInitialValue());
|
|
113
|
+
const prevMomentumValue = useSharedValue(formatValue(getInitialValue()));
|
|
114
|
+
const isUserInteractingRef = useRef(false);
|
|
115
|
+
const isUserInteracting = useSharedValue(false);
|
|
116
|
+
const setIsUserInteracting = useCallback((value) => {
|
|
117
|
+
isUserInteractingRef.current = value;
|
|
118
|
+
}, []);
|
|
119
|
+
const currentValue = useSharedValue(formatValue(getInitialValue()));
|
|
120
|
+
const listRef = useRef(null);
|
|
121
|
+
const isInitialMount = useRef(true);
|
|
122
|
+
const data = useMemo(() => {
|
|
123
|
+
// Prevent division by zero
|
|
124
|
+
if (step <= 0)
|
|
125
|
+
return [];
|
|
126
|
+
const itemAmount = (MAX - MIN) / step;
|
|
127
|
+
// Warn about large ranges
|
|
128
|
+
if (__DEV__ && itemAmount > 1000) {
|
|
129
|
+
console.warn(`Ruler: Large range (${Math.round(itemAmount)} items). Consider increasing step size for better performance.`);
|
|
130
|
+
}
|
|
131
|
+
return Array.from({ length: itemAmount + 1 }, (_, i) => MIN + i * step);
|
|
132
|
+
}, [MIN, MAX, step]);
|
|
133
|
+
const snapOffsets = useMemo(() => {
|
|
134
|
+
return data.map((_, index) => index * (longBarWidth + gap));
|
|
135
|
+
}, [data, longBarWidth, gap]);
|
|
136
|
+
useEffect(() => {
|
|
137
|
+
let isMounted = true;
|
|
138
|
+
if (isInitialMount.current || isUserInteractingRef.current) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
const clampedValue = getInitialValue();
|
|
142
|
+
const prevValue = prevInitialValue.current;
|
|
143
|
+
if (Math.abs(clampedValue - prevValue) <= step) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
prevInitialValue.current = clampedValue;
|
|
147
|
+
currentValue.value = formatValue(clampedValue);
|
|
148
|
+
const index = Math.round((clampedValue - MIN) / step);
|
|
149
|
+
if (isMounted) {
|
|
150
|
+
listRef.current?.scrollToOffset({
|
|
151
|
+
offset: index * (longBarWidth + gap),
|
|
152
|
+
animated: true,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
return () => {
|
|
156
|
+
isMounted = false;
|
|
157
|
+
};
|
|
158
|
+
}, [rest?.initialValue, MIN, MAX, step, longBarWidth, gap, formatValue, getInitialValue]);
|
|
159
|
+
const scrollHandler = useAnimatedScrollHandler({
|
|
160
|
+
onBeginDrag: () => {
|
|
161
|
+
'worklet';
|
|
162
|
+
isUserInteracting.value = true;
|
|
163
|
+
runOnJS(setIsUserInteracting)(true);
|
|
164
|
+
},
|
|
165
|
+
onScroll: (event) => {
|
|
166
|
+
if (!isUserInteracting.value)
|
|
167
|
+
return;
|
|
168
|
+
const scrollX = event.contentOffset.x;
|
|
169
|
+
const index = Math.round(scrollX / (longBarWidth + gap));
|
|
170
|
+
const value = MIN + index * step;
|
|
171
|
+
if (value >= MIN && value <= MAX) {
|
|
172
|
+
currentValue.value = value.toFixed(fractionDigits);
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
onMomentumEnd: (event) => {
|
|
176
|
+
const scrollX = event.contentOffset.x;
|
|
177
|
+
const index = Math.round(scrollX / (longBarWidth + gap));
|
|
178
|
+
const value = MIN + index * step;
|
|
179
|
+
const formattedValue = value.toFixed(fractionDigits);
|
|
180
|
+
if (value >= MIN && value <= MAX) {
|
|
181
|
+
if (prevMomentumValue.value !== formattedValue) {
|
|
182
|
+
if (isUserInteracting.value) {
|
|
183
|
+
runOnJS(onChange)(parseFloat(formattedValue));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
prevMomentumValue.value = formattedValue;
|
|
188
|
+
isUserInteracting.value = false;
|
|
189
|
+
runOnJS(setIsUserInteracting)(false);
|
|
190
|
+
},
|
|
191
|
+
});
|
|
192
|
+
const Spacer = useCallback(() => React.createElement(View, { style: { width: SCREEN_WIDTH / 2 - longBarWidth / 2 } }), [longBarWidth]);
|
|
193
|
+
const onContentSizeChange = useCallback(() => {
|
|
194
|
+
if (isInitialMount.current) {
|
|
195
|
+
isInitialMount.current = false;
|
|
196
|
+
const initialIndex = Math.round((getInitialValue() - MIN) / step);
|
|
197
|
+
listRef.current?.scrollToOffset({
|
|
198
|
+
offset: initialIndex * (longBarWidth + gap),
|
|
199
|
+
animated: false,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
}, [getInitialValue, MIN, step, longBarWidth, gap]);
|
|
203
|
+
const renderItem = useCallback(({ index }) => (React.createElement(Bar, { index: index, longBarColor: longBarColor, longBarHeight: longBarHeight, longBarWidth: longBarWidth, shortBarColor: shortBarColor, shortBarHeight: shortBarHeight, shortBarWidth: shortBarWidth, borderRadius: borderRadius })), [
|
|
204
|
+
longBarColor,
|
|
205
|
+
longBarHeight,
|
|
206
|
+
longBarWidth,
|
|
207
|
+
shortBarColor,
|
|
208
|
+
shortBarHeight,
|
|
209
|
+
shortBarWidth,
|
|
210
|
+
borderRadius,
|
|
211
|
+
]);
|
|
212
|
+
const renderSeparator = useCallback(() => React.createElement(View, { style: { width: gap } }), [gap]);
|
|
213
|
+
const getItemLayout = useCallback((_data, index) => ({
|
|
214
|
+
length: longBarWidth + gap,
|
|
215
|
+
offset: (longBarWidth + gap) * index,
|
|
216
|
+
index,
|
|
217
|
+
}), [longBarWidth, gap]);
|
|
218
|
+
// Check if linear gradient is supported
|
|
219
|
+
const shouldShowGradient = rest?.supportLinearGradient && LinearGradient;
|
|
220
|
+
return (React.createElement(View, { style: { width: screenWidth } },
|
|
221
|
+
!rest?.textComponent ? (React.createElement(AnimatedText, { text: currentValue, style: [styles.valueText, rest?.textStyle] })) : (rest.textComponent(currentValue)),
|
|
222
|
+
React.createElement(View, { style: { justifyContent: 'center', maxHeight: rest?.height } },
|
|
223
|
+
React.createElement(Animated.FlatList, { ref: listRef, data: data, renderItem: renderItem, keyExtractor: (_, i) => i.toString(), horizontal: true, showsHorizontalScrollIndicator: false, ListHeaderComponent: Spacer, ListFooterComponent: Spacer, ItemSeparatorComponent: renderSeparator, contentContainerStyle: {
|
|
224
|
+
alignItems: 'center',
|
|
225
|
+
}, scrollEventThrottle: 16, onScroll: scrollHandler, overScrollMode: "never", snapToOffsets: snapOffsets, snapToAlignment: "start", onContentSizeChange: onContentSizeChange, decelerationRate: decelerationRate, maxToRenderPerBatch: 10, initialNumToRender: 20, windowSize: 21, getItemLayout: getItemLayout, removeClippedSubviews: Platform.OS === 'android' }),
|
|
226
|
+
shouldShowGradient && (React.createElement(LinearGradient, { colors: ['rgba(0,0,0,0.9)', `rgba(0,0,0,${fadeOpacity})`], start: { x: 0, y: 0 }, end: { x: 1, y: 0 }, style: [
|
|
227
|
+
styles.fadeOverlay,
|
|
228
|
+
{
|
|
229
|
+
left: 0,
|
|
230
|
+
width: SCREEN_WIDTH * fadeWidth,
|
|
231
|
+
},
|
|
232
|
+
], pointerEvents: "none" })),
|
|
233
|
+
shouldShowGradient && (React.createElement(LinearGradient, { colors: [`rgba(0,0,0,${fadeOpacity})`, 'rgba(0,0,0,0.9)'], start: { x: 0, y: 0 }, end: { x: 1, y: 0 }, style: [
|
|
234
|
+
styles.fadeOverlay,
|
|
235
|
+
{
|
|
236
|
+
right: 0,
|
|
237
|
+
width: SCREEN_WIDTH * fadeWidth,
|
|
238
|
+
},
|
|
239
|
+
], pointerEvents: "none" })),
|
|
240
|
+
React.createElement(View, { style: {
|
|
241
|
+
position: 'absolute',
|
|
242
|
+
alignSelf: 'center',
|
|
243
|
+
zIndex: 1,
|
|
244
|
+
}, pointerEvents: "none" }, rest?.barComponent ?? (React.createElement(View, { style: {
|
|
245
|
+
height: rest?.indicatorHeight ?? 100,
|
|
246
|
+
width: rest?.indicatorWidth ?? 10,
|
|
247
|
+
backgroundColor: rest?.indicatorColor ?? 'white',
|
|
248
|
+
borderRadius: rest?.borderRadius ?? BORDER_RADIUS,
|
|
249
|
+
} }))))));
|
|
250
|
+
};
|
|
251
|
+
const styles = StyleSheet.create({
|
|
252
|
+
container: { justifyContent: 'center', alignItems: 'center' },
|
|
253
|
+
valueText: {
|
|
254
|
+
fontSize: 28,
|
|
255
|
+
color: 'white',
|
|
256
|
+
marginBottom: 16,
|
|
257
|
+
textAlign: 'center',
|
|
258
|
+
},
|
|
259
|
+
fadeOverlay: {
|
|
260
|
+
position: 'absolute',
|
|
261
|
+
top: 0,
|
|
262
|
+
bottom: 0,
|
|
263
|
+
zIndex: 2,
|
|
264
|
+
},
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
export { Ruler, Ruler as default };
|
|
268
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/Ruler.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;AA2BA,IAAI,cAAc,GAAQ,IAAI;AAC9B,IAAI;;AAEF,IAAA,cAAc,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC,cAAc;AACjE;AAAE,OAAO,CAAC,EAAE;;AAEZ;AAEA,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC;AACxD,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC;AAEvD,MAAM,WAAW,GAAG;AAClB,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,W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