diff --git a/example/.java-version b/example/.java-version new file mode 100644 index 00000000..62593409 --- /dev/null +++ b/example/.java-version @@ -0,0 +1 @@ +1.8 diff --git a/example/ios/Podfile b/example/ios/Podfile index a5250908..56e28941 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -1,4 +1,4 @@ -platform :ios, '9.0' +platform :ios, '10.0' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' target 'example' do diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index a118a662..68cde816 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -217,6 +217,10 @@ PODS: - React-cxxreact (= 0.61.5) - React-jsi (= 0.61.5) - ReactCommon/jscallinvoker (= 0.61.5) + - RNCPicker (1.14.0): + - React-Core + - RNDateTimePicker (3.4.3): + - React-Core - Yoga (1.14.0) DEPENDENCIES: @@ -247,6 +251,8 @@ DEPENDENCIES: - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) - ReactCommon/jscallinvoker (from `../node_modules/react-native/ReactCommon`) - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) + - "RNCPicker (from `../node_modules/@react-native-picker/picker`)" + - "RNDateTimePicker (from `../node_modules/@react-native-community/datetimepicker`)" - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) SPEC REPOS: @@ -302,6 +308,10 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/Libraries/Vibration" ReactCommon: :path: "../node_modules/react-native/ReactCommon" + RNCPicker: + :path: "../node_modules/@react-native-picker/picker" + RNDateTimePicker: + :path: "../node_modules/@react-native-community/datetimepicker" Yoga: :path: "../node_modules/react-native/ReactCommon/yoga" @@ -331,8 +341,10 @@ SPEC CHECKSUMS: React-RCTText: 9ccc88273e9a3aacff5094d2175a605efa854dbe React-RCTVibration: a49a1f42bf8f5acf1c3e297097517c6b3af377ad ReactCommon: 198c7c8d3591f975e5431bec1b0b3b581aa1c5dd + RNCPicker: 1a266981fc99330c252f5f98b3f09a377a35d88c + RNDateTimePicker: d943800c936fb01c352fcfb70439550d2cb57092 Yoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b -PODFILE CHECKSUM: 79310af6b976c356911a8a833e9b99c3399fdda3 +PODFILE CHECKSUM: 458533d98e56668b204d6c159e3a7c75610075a3 -COCOAPODS: 1.8.4 +COCOAPODS: 1.10.0 diff --git a/example/package.json b/example/package.json index d740a23b..b6c976df 100644 --- a/example/package.json +++ b/example/package.json @@ -13,7 +13,8 @@ "moment": "^2.24.0", "react": "16.9.0", "react-native": "0.61.5", - "@react-native-community/picker": "^1.8.0", + "@react-native-picker/picker": "^1.14.0", + "@react-native-community/datetimepicker" : "^3.4.3", "react-native-wheel-picker-android": "../" }, "devDependencies": { diff --git a/example/yarn.lock b/example/yarn.lock index 5f7f2285..a345152f 100644 --- a/example/yarn.lock +++ b/example/yarn.lock @@ -944,6 +944,13 @@ wcwidth "^1.0.1" ws "^1.1.0" +"@react-native-community/datetimepicker@^3.4.3": + version "3.4.3" + resolved "https://registry.yarnpkg.com/@react-native-community/datetimepicker/-/datetimepicker-3.4.3.tgz#e57cc254a53ea7c4229ad7c4cfc3368c109c1db3" + integrity sha512-FaryfNYxWvgL2YH+CPhbKl2viLwsYFSq+vrhQT8IHB+uOTPhRtRZ0sWSU1N3eWy8HFwqmTw2Ao5uVgn8cvsUew== + dependencies: + invariant "^2.2.4" + "@react-native-community/eslint-config@^0.0.5": version "0.0.5" resolved "https://registry.yarnpkg.com/@react-native-community/eslint-config/-/eslint-config-0.0.5.tgz#584f6493258202a57efc22e7be66966e43832795" @@ -961,6 +968,11 @@ eslint-plugin-react-native "3.6.0" prettier "1.16.4" +"@react-native-picker/picker@^1.14.0": + version "1.14.0" + resolved "https://registry.yarnpkg.com/@react-native-picker/picker/-/picker-1.14.0.tgz#9c3ce0be162239a7a05b994f2bdcf5660b5466b9" + integrity sha512-KN/nOSxO64LxYms/8RpdjdIqemqDlxM8glDi4upg40/3JqalmXoHHBQxA0XYdAoL+padSVHAoAS6Ie5zAn8gTw== + "@types/babel__core@^7.1.0": version "7.1.6" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.6.tgz#16ff42a5ae203c9af1c6e190ed1f30f83207b610" @@ -4421,7 +4433,7 @@ mkdirp@^0.5.1: dependencies: minimist "0.0.8" -moment@^2.22.0, moment@^2.24.0: +moment@^2.24.0: version "2.24.0" resolved "https://registry.yarnpkg.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b" integrity sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg== @@ -5073,9 +5085,11 @@ react-is@^16.12.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.9.0: integrity sha512-GFMtL0vHkiBv9HluwNZTggSn/sCyEt9n02aM0dSAjGGyqyNlAyftYm4phPxdvCigG15JreC5biwxCgTAJZ7yAA== react-native-wheel-picker-android@../: - version "2.0.7" + version "3.0.0" dependencies: - moment "^2.22.0" + "@react-native-community/datetimepicker" "^3.4.3" + "@react-native-picker/picker" "^1.14.0" + moment "^2.24.0" react-native@0.61.5: version "0.61.5" diff --git a/package.json b/package.json index cebe0a39..18b0c54b 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,8 @@ }, "homepage": "https://github.com/kalontech/ReactNativeWheelPicker", "dependencies": { - "@react-native-community/picker": "^1.8.0", + "@react-native-picker/picker": "^1.14.0", + "@react-native-community/datetimepicker" : "^3.4.3", "moment": "^2.24.0" } } diff --git a/src/DatePicker.ios.tsx b/src/DatePicker.ios.tsx index 015bcf18..7633a2fe 100644 --- a/src/DatePicker.ios.tsx +++ b/src/DatePicker.ios.tsx @@ -1,5 +1,6 @@ import React, { useState } from "react"; -import { DatePickerIOS, View } from "react-native"; +import { View } from "react-native"; +import RNDateTimePicker from "@react-native-community/datetimepicker" interface Props { initDate: Date; @@ -12,13 +13,13 @@ const DatePicker: React.FC = props => { const [date, setDate] = useState(initDate || new Date()) return ( - { + { if (onDateSelected) onDateSelected(date) setDate(date) }} - mode={'date'} + mode="date" {...props} /> diff --git a/src/WheelPicker.ios.tsx b/src/WheelPicker.ios.tsx index ed44b25d..caf618dd 100644 --- a/src/WheelPicker.ios.tsx +++ b/src/WheelPicker.ios.tsx @@ -1,6 +1,6 @@ import React, { useState } from "react"; import { View } from "react-native"; -import { Picker } from "@react-native-community/picker"; +import { Picker } from "@react-native-picker/picker"; interface Props { data: Array;