@momo-kits/date-picker 0.110.1-beta.2 → 0.110.1-beta.3
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/WheelPicker.tsx +1 -50
- package/index.tsx +3 -1
- package/package.json +2 -2
package/WheelPicker.tsx
CHANGED
|
@@ -81,60 +81,11 @@ const WheelPicker: FC<WheelPickerProps> = ({
|
|
|
81
81
|
const ItemComponent: FC<any> = React.memo(props => {
|
|
82
82
|
const {item, index} = props;
|
|
83
83
|
|
|
84
|
-
const opacityAnimated = (a: number, b: number, c: number) => {
|
|
85
|
-
return {
|
|
86
|
-
inputRange: [...data.map((_: any, i: number) => i * itemSize)],
|
|
87
|
-
outputRange: [
|
|
88
|
-
...data.map((_: any, i: number) => {
|
|
89
|
-
const center = i + 2;
|
|
90
|
-
if (center === index) {
|
|
91
|
-
return a;
|
|
92
|
-
} else if (center + 1 === index || center - 1 === index) {
|
|
93
|
-
return b;
|
|
94
|
-
} else {
|
|
95
|
-
return c;
|
|
96
|
-
}
|
|
97
|
-
}),
|
|
98
|
-
],
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const scaleAnimated = (a: number, b: number) => {
|
|
103
|
-
return {
|
|
104
|
-
inputRange: [...data.map((_: any, i: number) => i * itemSize)],
|
|
105
|
-
outputRange: [
|
|
106
|
-
...data.map((_: any, i: number) => {
|
|
107
|
-
const center = i + 2;
|
|
108
|
-
if (center === index) {
|
|
109
|
-
return a;
|
|
110
|
-
} else {
|
|
111
|
-
return b;
|
|
112
|
-
}
|
|
113
|
-
}),
|
|
114
|
-
],
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
|
|
118
84
|
return (
|
|
119
|
-
<Animated.View
|
|
120
|
-
style={[
|
|
121
|
-
styles.wheelItem,
|
|
122
|
-
{
|
|
123
|
-
opacity: scrollAnimatedValue.interpolate(
|
|
124
|
-
useMemo(() => opacityAnimated(1, 0.8, 0.4), [])
|
|
125
|
-
),
|
|
126
|
-
},
|
|
127
|
-
]}>
|
|
85
|
+
<Animated.View style={[styles.wheelItem]}>
|
|
128
86
|
<Animated.Text
|
|
129
87
|
style={{
|
|
130
88
|
fontFamily: `${theme.font}-Semibold`,
|
|
131
|
-
transform: [
|
|
132
|
-
{
|
|
133
|
-
scale: scrollAnimatedValue.interpolate(
|
|
134
|
-
useMemo(() => scaleAnimated(1, 0.87), [])
|
|
135
|
-
),
|
|
136
|
-
},
|
|
137
|
-
],
|
|
138
89
|
fontSize: scaleSize(16),
|
|
139
90
|
lineHeight: scaleSize(22),
|
|
140
91
|
}}>
|
package/index.tsx
CHANGED
package/package.json
CHANGED