@momo-kits/date-picker 0.92.8-beta.5 → 0.92.8-rc.2
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 +2 -9
- package/index.tsx +2 -11
- package/package.json +16 -16
package/WheelPicker.tsx
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
FC,
|
|
3
|
-
memo,
|
|
4
|
-
useCallback,
|
|
5
|
-
useContext,
|
|
6
|
-
useEffect,
|
|
7
|
-
useRef,
|
|
8
|
-
} from 'react';
|
|
1
|
+
import React, {FC, useCallback, useContext, useEffect, useRef} from 'react';
|
|
9
2
|
import {Animated, View} from 'react-native';
|
|
10
3
|
import {FlatList} from 'react-native-gesture-handler';
|
|
11
4
|
import styles from './styles';
|
|
@@ -212,4 +205,4 @@ const WheelPicker: FC<WheelPickerProps> = ({
|
|
|
212
205
|
);
|
|
213
206
|
};
|
|
214
207
|
|
|
215
|
-
export default
|
|
208
|
+
export default WheelPicker;
|
package/index.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, {FC, useEffect, useState} from 'react';
|
|
2
|
-
import {Dimensions, LayoutChangeEvent,
|
|
2
|
+
import {Dimensions, LayoutChangeEvent, View} from 'react-native';
|
|
3
3
|
import {Spacing} from '@momo-kits/foundation';
|
|
4
4
|
import WheelPicker from './WheelPicker';
|
|
5
5
|
import {
|
|
@@ -44,12 +44,6 @@ const DateTimePicker: FC<DateTimePickerProps> = ({
|
|
|
44
44
|
return () => {};
|
|
45
45
|
}, [selectedValue, currentDate]);
|
|
46
46
|
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
if (Platform.OS === 'android') {
|
|
49
|
-
onChange?.(selectedValue);
|
|
50
|
-
}
|
|
51
|
-
}, []);
|
|
52
|
-
|
|
53
47
|
const setupData = () => {
|
|
54
48
|
const formatParts = format.split(/[^A-Za-z]+/);
|
|
55
49
|
const isOnlyHour = formatParts.length === 1 && formatParts[0] === 'HH';
|
|
@@ -119,16 +113,13 @@ const DateTimePicker: FC<DateTimePickerProps> = ({
|
|
|
119
113
|
if (changedDate <= maxDate && changedDate >= minDate) {
|
|
120
114
|
onChange?.(changedDate);
|
|
121
115
|
}
|
|
122
|
-
|
|
123
116
|
setCurrentDate(newDate);
|
|
124
117
|
};
|
|
125
118
|
|
|
126
119
|
const paddingArray = ['', ''];
|
|
127
120
|
|
|
128
121
|
const onLayout = (e: LayoutChangeEvent) => {
|
|
129
|
-
|
|
130
|
-
setContainerWidth(e.nativeEvent.layout.width);
|
|
131
|
-
}
|
|
122
|
+
setContainerWidth(e.nativeEvent.layout.width);
|
|
132
123
|
};
|
|
133
124
|
|
|
134
125
|
return (
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
"name": "@momo-kits/date-picker",
|
|
3
|
+
"version": "0.92.8-rc.2",
|
|
4
|
+
"private": false,
|
|
5
|
+
"main": "index.tsx",
|
|
6
|
+
"peerDependencies": {
|
|
7
|
+
"@momo-kits/foundation": "latest",
|
|
8
|
+
"react-native-gesture-handler": "1.10.3",
|
|
9
|
+
"react": "16.9.0",
|
|
10
|
+
"react-native": ">=0.55",
|
|
11
|
+
"prop-types": "^15.7.2"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@momo-platform/versions": "4.1.11"
|
|
15
|
+
},
|
|
16
|
+
"license": "MoMo",
|
|
17
|
+
"dependencies": {}
|
|
18
18
|
}
|