[
  {
    "path": ".github/FUNDING.yml",
    "content": "# These are supported funding model platforms\n\ngithub: TronNatthakorn\n#patreon: # Replace with a single Patreon username\n#open_collective: # Replace with a single Open Collective username\n#ko_fi: # Replace with a single Ko-fi username\n#tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel\n#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry\n#liberapay: # Replace with a single Liberapay username\n#issuehunt: # Replace with a single IssueHunt username\n#lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry\n#polar: # Replace with a single Polar username\n#buy_me_a_coffee: # Replace with a single Buy Me a Coffee username\n#thanks_dev: # Replace with a single thanks.dev username\n#custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']\n"
  },
  {
    "path": ".gitignore",
    "content": "android/.gradle\nandroid/.idea\nandroid/.project\nandroid/.settings\nandroid/android.iml\nandroid/gradle\nandroid/gradlew\nandroid/gradlew.bat\nandroid/local.properties\n"
  },
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "NOTICE",
    "content": "react-native-wheel-pick\nCopyright 2022 tron.natthakorn@engineer.com\n\nThis project contains code copied from AigeStudio:\nhttps://github.com/AigeStudio/WheelPicker\nCopyright 2015-2017 AigeStudio\nLicensed under the Apache License, Version 2.0\n\nThis project contains code copied from @leslisam/react-native-wheel-picker:\nhttps://github.com/lesliesam/react-native-wheel-picker\n\nThis project contains code copied from @wusuopu/react-native-wheel-picker:\nhttps://github.com/wusuopu/react-native-wheel-picker\n\nThis project contains code copied from @pinguinjkeke/react-native-wheel-datepicker:\nhttps://github.com/pinguinjkeke/react-native-wheel-datepicker\n"
  },
  {
    "path": "README.md",
    "content": "\n# [react-native-wheel-pick](https://www.npmjs.com/package/react-native-wheel-pick)\n\nReact native wheel picker for both iOS and android.\n\nThis is not original but inspired by [react-native-wheel-datepicker](https://github.com/pinguinjkeke/react-native-wheel-datepicker)\n\n## Preview\n\n![](https://i.ibb.co/4W7h12M/rn-wl-pk-1-1-13.png)\n\n## Note\n\n- For Picker of iOS use [@react-native-picker/picker](https://github.com/react-native-picker/picker)\n- For DatePicker of iOS use [@react-native-community/datetimepicker](https://github.com/react-native-datetimepicker/datetimepicker) \n- For Picker and DatePicker of Android use WheelPicker of [AigeStudio](https://github.com/AigeStudio/WheelPicker)\n\n## How to use\n\nReact Native >= 0.60+\n```\nnpm install react-native-wheel-pick --save-dev --legacy-peer-deps\nnpm install @react-native-picker/picker --save-dev --legacy-peer-deps\nnpm install @react-native-community/datetimepicker --save-dev --legacy-peer-deps\nnpx pod-install\n\nnpx react-native start --reset-cache // clear cache\n\nnpx react-native run-ios // re-build native-code\nnpx react-native run-android // re-build native-code for gradle\n```\n\nReact Native < 0.60\n```\nnpm install react-native-wheel-pick\nreact-native link react-native-wheel-pick\n```\n## Example code \n\n```jsx\nimport { Picker, DatePicker } from 'react-native-wheel-pick';\n\n// use Picker\n<Picker\n  style={{ backgroundColor: 'white', width: 300, height: 215 }}\n  selectedValue='item4'\n  pickerData={['item1', 'item2', 'item3', 'item4', 'item5', 'item6', 'item7']}\n  onValueChange={value => { console.log(value) }}\n/>\n\n// use DatePicker\n<DatePicker\n  style={{ backgroundColor: 'white', width: 370, height: 240 }} \n  onDateChange={date => { console.log(date) }}\n/>\n\n// for TypeScript\nonValueChange={(value: string) => { console.log(value) }}\nonDateChange={(date: Date) => { console.log(date) }}\n\n```\n## More Example \n\n```jsx\n// Set Text Color\n<Picker textColor=\"red\" />\n\n// DatePicker set default select date\n<DatePicker\n  style={{ height: 215, width: 300 }}\n  date={new Date('2018-06-27')} // Optional prop - default is Today\n  onDateChange={date => { console.log(date) }}\n/>\n\n// DatePicker set min/max Date\n<DatePicker\n  style={{ height: 215, width: 300 }}\n  minimumDate={new Date('2000-01-01')}\n  maximumDate={new Date('2050-12-31')}\n  onDateChange={date => { console.log(date) }}\n/>\n```\n```jsx\n// pickerData also support array of object. (Optional Way)\n\n// Normal Way\n<Picker\n  selectedValue='item4'\n  pickerData={['item1', 'item2', 'item3', 'item4', 'item5', 'item6', 'item7']}\n  onValueChange={value => { console.log(value) }}\n/>\n\n// Optional Way\n// `label` only use for show Text to UI.\n// You cannot get `label` from onValueChange\n<Picker\n  selectedValue='5765387680'\n  pickerData={[\n    { value : '5765387677', label : 'item1' },\n    { value : '5765387678', label : 'item2' },\n    { value : '5765387679', label : 'item3' },\n    { value : '5765387680', label : 'item4' },\n    { value : '5765387681', label : 'item5' },\n    { value : '5765387682', label : 'item6' },\n    { value : '5765387683', label : 'item7' },\n  ]}\n  onValueChange={value => { console.log(value) }} // '5765387680'\n/>\n```\n```jsx\n// Android Only.\n// These is special props for Android. (iOS and Web not work)\n// You can also use these props for DatePicker, too.\n<Picker\n  textSize={20}\n\n  selectTextColor='green'\n  isShowSelectBackground={false} // Default is true\n  selectBackgroundColor='#8080801A' // support HEXA color Style (#rrggbbaa)\n  // (Please always set 'aa' value for transparent)\n  \n  isShowSelectLine={false} // Default is true\n  selectLineColor='black'\n  selectLineSize={6} // Default is 4\n\n  isCyclic={true} // Support Infinitely Scrolling.\n/>\n\n// Android Only.\n<DatePicker\n  order='D-M-Y' // Default is M-D-Y\n/>\n\n// Test on Web (Platform.OS === 'Web')\n<Picker style={{ height: 50 }} />\n// DatePicker still not supported on Web.\n```\n## How to change Font Family for Android\n\n1. Goto `android/app/src/main/res/values/styles.xml`\n2. Add this code `<item name=\"wheel_font_path\">fonts/[FONT_NAME].ttf</item>`\n\nThanks to [@RMabroukS](https://github.com/TronNatthakorn/react-native-wheel-pick/issues/58)\n\n## FYI\n\nI rarely check this lib. (6 Months - 3 Years). Up on my life's time.\n\nIf you want to pay me coffee for quickly check & merge your request. \nYou can sponsor me \n\n[![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/TronNatthakorn) \n\nOR you can fork this project instead.\n\n## Release Note\n\n### 1.2.8 (Feb 14 2026)\n[Android]\n- Add support for decimal number on Native Android. Thanks to [@ArnaudDerosin](https://github.com/TronNatthakorn/react-native-wheel-pick/pull/69)\n\n### 1.2.6 (Jul 5 2025)\n[Android]\n- Add support for `isCyclic` property on Android. (Infinitely Scrolling) Thanks to [@cip123](https://github.com/TronNatthakorn/react-native-wheel-pick/pull/67)\n\n### 1.2.5 (Jun 14 2025)\n[Android]\n- Fix Android DatePicker time mode default selection issue and correct hour range. Thanks to [@harryxu](https://github.com/TronNatthakorn/react-native-wheel-pick/pull/66)\n\n### 1.2.4 (Feb 17 2025)\n[Web]\n- Test on `Platform.OS === 'web'`\n- Only `<Picker />` can use on Web. `<DatePicker />` still not supported on Web.\n\n### 1.2.3 (Feb 15 2024)\n- Fix state is not updating after onValueChange in Picker Component. Thanks to [@spasma\n](https://github.com/TronNatthakorn/react-native-wheel-pick/issues/52)\n- Test on React Native Version 0.77\n\n[Android]\n- Support [UIManager New Architecture of React Native](https://github.com/reactwg/react-native-new-architecture/discussions/201)\n- Use Handler for fix 23 index problem. Thanks to [@mykhailoperemitko](https://github.com/TronNatthakorn/react-native-wheel-pick/issues/44) [@A-ANing](https://github.com/A-ANing)\n\n### 1.2.2 (June 7 2023)\n[iOS]\n- Now iOS can use `textColor`, too. [Add missing color option for iOS](https://github.com/TronNatthakorn/react-native-wheel-pick/pull/38) [@aurotones](https://github.com/aurotones)\n\n### 1.2.1 (June 4 2023)\n- Fix typescript warning\n\n[Android]\n- Update compileSDK to version 33.\n\n### 1.2.0 (July 3 2022)\n- Remove `deprecated-react-native-prop-types`\n- Support for peer dependencies React 18 by `--legacy-peer-deps`\n\n### 1.1.7 (June 21 2022)\n[Android]\n- compileSdk -> compileSdkVersion\n\n### 1.1.6 (June 20 2022)\n- Add more step for How to use\n\n### 1.1.5 (June 20 2022)\n- Change License from MIT to Apache-2.0\n- Add NOTICE file for credit original author.\n- Fix peerDependency do not break other version.\n \n[Android]\n- Fix WheelCurvedPicker not found for first run.\n- DatePicker support order prop.\n\n### 1.1.4 (June 19 2022)\n- Fix Readme wrong type.\n\n### 1.1.3 (June 19 2022)\n- Restructure code of Picker iOS and Android.\n- pickerData support array of object.\n\n[Android]\n- Update sdk support for SDK Version 30 (Google Play need sdk version 30+)\n- Now android support for style of selectLine / selectBackground. Special thanks to [@kaisv7n](https://github.com/kaisv7n) for his pull request, [Update WheelPicker version, exposed more methods and fixed crash on android](https://github.com/TronNatthakorn/react-native-wheel-pick/pull/12) I changed prop name for more understandable.\n- DatePicker of Android also support width.\n- Deprecated some android prop that make library faster. (Atmospheric / Curved / visibleItemCount / itemSpace)\nIf you want it back pull request are welcome.\n- Change some prop name for make code more understandable.\n- If update from version <= 1.1.2. You will get warning about Deprecated prop if you still use, I write some logic for make app not crash. (Please fix warning if possible.)\n\n[IOS]\n- Do not use PickerIOS and DatePickerIOS of 'react-native' anymore.\n\n## Preview for version <= 1.12\n\n![](https://preview.ibb.co/iUjDZo/screen1.png)\n\n## Example code for version <= 1.12\n\n```jsx\nimport { Platform } from 'react-native';\nimport { Picker, DatePicker } from 'react-native-wheel-pick';\n\nconst isIos = Platform.OS === 'ios'\n\n// use Picker\n<Picker\n  style={{ backgroundColor: 'white', width: 300, height: 215 }}\n  selectedValue='item4'\n  pickerData={['item1', 'item2', 'item3', 'item4', 'item5', 'item6', 'item7']}\n  onValueChange={value => { }}\n  itemSpace={30} // this only support in android\n/>\n\n// use DatePicker\n<DatePicker\n  style={{ backgroundColor: 'white', height: 215, width: isIos ? 300 : undefined }} \n  // android not support width\n  onDateChange={date => { }}\n/>\n\n```\n## Note for version <= 1.12\n\n- For iOS use default PickerIOS / DatePickerIOS of React Native.\n- For Android use WheelPicker of [WheelPicker](https://github.com/AigeStudio/WheelPicker)\n- Line color is white in android. (Support Line style in future. Pull request welcome)\n- Line color is grey in IOS but it has bug line not show in Picker (iOS 11.4 not sure other version).\n\n## More Example for version <= 1.12\n\n```jsx\n// DatePicker set default choose date\n<DatePicker\n  style={{ height: 215, width: isIos ? 300 : undefined }}\n  date={new Date('2018-06-27')} // Optional prop - default is Today\n  onDateChange={date => { }}\n/>\n\n// DatePicker set min/max Date\n<DatePicker\n  style={{ height: 215, width: isIos ? 300 : undefined }}\n  minimumDate={new Date('2000-01-01')}\n  maximumDate={new Date('2050-12-31')}\n  onDateChange={date => { }}\n/>\n```\n\n## Release Note for version <= 1.12\n\n### 1.1.2 (April 13 2022)\n- Edit broken url.\n\n### 1.1.1 (November 20 2021)\n- Edit broken url.\n\n### 1.1.0 (January 14 2020)\n- Use react-native.config.js instead of rnpm section. [@darkbluesun](https://github.com/darkbluesun)\n\n[Android]\n- Add safeExtGet to get sdk version from root project.[@darkbluesun](https://github.com/darkbluesun)\n\n### 1.0.9 (June 27 2018)\n[IOS]\n- Fix bug props date of DatePicker is not work right.\n\n### 1.0.8 (June 27 2018)\n- Support props for date picker (date / minimumDate / maximumDate)\n\n[IOS]\n- Fix bug cannot read property 'getTime' of null\n\n### 1.0.7 (June 25 2018)\n\n[Android]\n- Fix bug android value wrong from array\n\n### 1.0.5 (June 24 2018)\n- Fix Lifecycle for support React 16 (Remove componentWillMount / componentWillReceiveProps)\n\n[Android]\n- Fix bug onValueChange occur first time without change\n\n### 1.0.4 (June 24 2018)\n[Android]\n- Support compileSDKVersion 26\n\n## License\n\n    Copyright 2022 tron.natthakorn@engineer.com\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n        http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n"
  },
  {
    "path": "android/build.gradle",
    "content": "buildscript {\n    repositories {\n        maven { url \"https://jitpack.io\" }\n    }\n}\n\napply plugin: 'com.android.library'\n\ndef isNewArchitectureEnabled() {\n    return project.hasProperty(\"newArchEnabled\") && project.newArchEnabled == \"true\"\n}\n\nif (isNewArchitectureEnabled()) {\n    apply plugin: 'com.facebook.react'\n}\n\nandroid {\n    compileSdkVersion 33\n    namespace 'com.tron'\n\n    defaultConfig {\n        buildConfigField(\"boolean\", \"IS_NEW_ARCHITECTURE_ENABLED\", isNewArchitectureEnabled().toString())\n    }\n\n    buildFeatures {\n        buildConfig true\n    }\n}\n\ndependencies {\n    implementation fileTree(dir: 'libs', include: ['*.jar'])\n    implementation \"com.github.AigeStudio:WheelPicker:5913fa15fc\"\n    implementation 'com.facebook.react:react-native:+'\n}\n"
  },
  {
    "path": "android/src/main/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n</manifest>\n"
  },
  {
    "path": "android/src/main/java/com/tron/ReactNativeWheelPickerPackage.java",
    "content": "package com.tron;\n\nimport com.facebook.react.ReactPackage;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.uimanager.ViewManager;\n\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\n\npublic class ReactNativeWheelPickerPackage implements ReactPackage {\n    @Override\n    public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {\n        return Collections.emptyList();\n    }\n\n    public List<Class<? extends JavaScriptModule>> createJSModules() {\n        return Collections.emptyList();\n    }\n\n    @Override\n    public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {\n        return Arrays.<ViewManager>asList(\n                new ReactWheelCurvedPickerManager()\n        );\n    }\n}"
  },
  {
    "path": "android/src/main/java/com/tron/ReactWheelCurvedPicker.java",
    "content": "package com.tron;\n\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.LinearGradient;\nimport android.graphics.Paint;\nimport android.graphics.Shader;\nimport android.os.SystemClock;\nimport android.util.AttributeSet;\n\n// import android.util.Log;\n\nimport com.aigestudio.wheelpicker.WheelPicker;\nimport com.aigestudio.wheelpicker.WheelPicker.OnWheelChangeListener;\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.EventDispatcher;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\nimport com.facebook.react.uimanager.UIManagerHelper;\n\n// UIManagerType;\nimport com.facebook.react.uimanager.common.UIManagerType;\n\nimport java.util.Date;\nimport java.util.List;\n\n/**\n * Credit Author: Sam Yu\n */\npublic class ReactWheelCurvedPicker extends WheelPicker {\n\n    private final EventDispatcher mEventDispatcher;\n    private List<Object> mValueData;\n\n    //private int mState;\n\n    public ReactWheelCurvedPicker(ReactContext reactContext) {\n        super(reactContext);\n\n        if(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n            mEventDispatcher = (UIManagerHelper.getUIManager(reactContext, 1 /** UIManagerType */)).getEventDispatcher();\n        } else {\n            mEventDispatcher = reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();\n        }\n        \n        setOnWheelChangeListener(new OnWheelChangeListener() {\n            @Override\n            public void onWheelScrolled(int offset) {\n            }\n\n            @Override\n            public void onWheelSelected(int position) {\n                // Log.d(\"onWheelSelected\", \"Wheel Selected\");\n                if (mValueData != null && position < mValueData.size()) {\n                    mEventDispatcher.dispatchEvent(\n                        new ItemSelectedEvent(getId(), mValueData.get(position)));\n                }\n            }\n\n            @Override\n            public void onWheelScrollStateChanged(int state) {\n                //mState = state;\n            }\n        });\n    }\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n        super.onMeasure(widthMeasureSpec, heightMeasureSpec);\n    }\n\n    public void setValueData(List<Object> data) {\n        mValueData = data;\n    }\n\n    public void getState() {\n    //public int getState() {\n        //return state;\n    }\n}\n\nclass ItemSelectedEvent extends Event<ItemSelectedEvent> {\n\n    public static final String EVENT_NAME = \"wheelCurvedPickerPageSelected\";\n\n    private final Object mValue;\n\n    protected ItemSelectedEvent(int viewTag, Object value) {\n        super(viewTag);\n        mValue = value;\n    }\n\n    @Override\n    public String getEventName() {\n        return EVENT_NAME;\n    }\n\n    @Override\n    public void dispatch(RCTEventEmitter rctEventEmitter) {\n        rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());\n    }\n\n    private WritableMap serializeEventData() {\n        WritableMap eventData = Arguments.createMap();\n\n        Class mValueClass = mValue.getClass();\n        if (mValueClass == Integer.class) {\n            eventData.putInt(\"data\", (Integer) mValue);\n        } else if (mValueClass == Double.class) {\n            eventData.putDouble(\"data\", (Double) mValue);\n        } else if (mValueClass == String.class) {\n            eventData.putString(\"data\", mValue.toString());\n        }\n\n        return eventData;\n    }\n}\n"
  },
  {
    "path": "android/src/main/java/com/tron/ReactWheelCurvedPickerManager.java",
    "content": "package com.tron;\n\nimport android.graphics.Color;\nimport android.os.Handler;\n\nimport com.aigestudio.wheelpicker.WheelPicker;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableType;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.SimpleViewManager;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.annotations.ReactProp;\n\n// import android.util.Log;\n\nimport java.util.ArrayList;\nimport java.util.Map;\n\n/**\n * Credit Author: Sam Yu\n */\npublic class ReactWheelCurvedPickerManager extends SimpleViewManager<ReactWheelCurvedPicker> {\n\n    private static final String REACT_CLASS = \"WheelCurvedPicker\";\n\n    private static final int DEFAULT_TEXT_SIZE = 24 * 2;\n    private static final int DEFAULT_ITEM_SPACE = 16 * 2;\n\n    @Override\n    public Map getExportedCustomDirectEventTypeConstants() {\n        return MapBuilder.of(\n                ItemSelectedEvent.EVENT_NAME, MapBuilder.of(\"registrationName\", \"onValueChange\")\n        );\n    }\n\n    @Override\n    protected ReactWheelCurvedPicker createViewInstance(ThemedReactContext reactContext) {\n        ReactWheelCurvedPicker picker = new ReactWheelCurvedPicker(reactContext);\n        picker.setItemTextColor(Color.BLACK);\n        picker.setItemTextSize(DEFAULT_TEXT_SIZE);\n        picker.setSelectedItemTextColor(Color.WHITE);\n        picker.setItemSpace(DEFAULT_ITEM_SPACE);\n        picker.setIndicator(true);\n        picker.setIndicatorSize(4);\n        picker.setIndicatorColor(Color.parseColor(\"#26808080\"));\n        picker.setCurtain(true);\n        picker.setCurtainColor(Color.parseColor(\"#1A808080\"));\n        picker.setAtmospheric(true);\n        picker.setCurved(true);\n        picker.setVisibleItemCount(7);\n\n        picker.setItemAlign(0);\n\n        // Trick Code - wake setSelectItemPosition\n        picker.setSelectedItemPosition(1); // Cannot 0 instead of 1, I Don Know why but need this line for make ReactProp selectIndex Work\n\n        return picker;\n    }\n\n    @ReactProp(name=\"data\")\n    public void setData(ReactWheelCurvedPicker picker, ReadableArray items) {\n        if (picker != null) {\n            ArrayList<Object> valueData = new ArrayList<>();\n            ArrayList<String> labelData = new ArrayList<>();\n            for (int i = 0; i < items.size(); i ++) {\n                ReadableMap itemMap = items.getMap(i);\n\n                if (itemMap.getType(\"value\") == ReadableType.String) {\n                    valueData.add(itemMap.getString(\"value\"));\n                } else if (itemMap.getType(\"value\") == ReadableType.Number) {\n                    // valueData.add(itemMap.getInt(\"value\"));\n                    // Store as Double to preserve decimal precision\n                    valueData.add(itemMap.getDouble(\"value\"));\n                }\n\n                labelData.add(itemMap.getString(\"label\"));\n            }\n            picker.setValueData(valueData);\n            picker.setData(labelData);\n        }\n    }\n\n    @ReactProp(name=\"selectedIndex\")\n    public void setSelectedIndex(ReactWheelCurvedPicker picker, int index) {\n        //if (picker != null && picker.getState() == WheelPicker.SCROLL_STATE_IDLE) {\n        // Log.d(\"Index from React\", index + \"\");\n        if (picker != null) {\n            // picker.setSelectedItemPosition(index);\n            // picker.invalidate();\n\n            final Handler handler = new Handler();\n\n            handler.post(new Runnable() {\n                @Override\n                public void run() {\n                    picker.setSelectedItemPosition(index);\n                    picker.invalidate();\n                }\n            });\n        }\n    }\n\n    // @ReactProp(name=\"atmospheric\")\n    // public void setAtmospheric(ReactWheelCurvedPicker picker, boolean hasAtmospheric) {\n    //     if (picker != null) {\n    //         picker.setAtmospheric(hasAtmospheric);\n    //     }\n    // }\n\n    // @ReactProp(name=\"curved\")\n    // public void setCurved(ReactWheelCurvedPicker picker, boolean hasCurved) {\n    //     if (picker != null) {\n    //         picker.setCurved(hasCurved);\n    //     }\n    // }\n\n    // @ReactProp(name=\"visibleItemCount\")\n    // public void setVisibleItemCount(ReactWheelCurvedPicker picker, int num) {\n    //     if (picker != null) {\n    //         picker.setVisibleItemCount(num);\n    //     }\n    // }\n\n    // // Didnot work on android 11\n    // @ReactProp(name=\"itemSpace\")\n    // public void setItemSpace(ReactWheelCurvedPicker picker, int space) {\n    //     if (picker != null) {\n    //         picker.setItemSpace((int) PixelUtil.toPixelFromDIP(space));\n    //     }\n    // }\n\n    @ReactProp(name=\"textColor\", customType = \"Color\")\n    public void setTextColor(ReactWheelCurvedPicker picker, Integer color) {\n        if (picker != null) {\n            picker.setItemTextColor(color);\n        }\n    }\n\n    @ReactProp(name=\"textSize\")\n    public void setTextSize(ReactWheelCurvedPicker picker, int size) {\n        if (picker != null) {\n            picker.setItemTextSize((int) PixelUtil.toPixelFromDIP(size));\n        }\n    }\n\n    @ReactProp(name=\"selectTextColor\", customType = \"Color\")\n    public void setSelectedTextColor(ReactWheelCurvedPicker picker, Integer color) {\n        if (picker != null) {\n            picker.setSelectedItemTextColor(color);\n        }\n    }\n\n    //@ReactProp(name=\"curtain\")\n    @ReactProp(name=\"isShowSelectBackground\")\n    public void setCurtain(ReactWheelCurvedPicker picker, boolean hasCurtain) {\n        if (picker != null) {\n            picker.setCurtain(hasCurtain);\n        }\n    }\n\n    //@ReactProp(name=\"curtainColor\", customType = \"Color\")\n    @ReactProp(name=\"selectBackgroundColor\", customType = \"Color\")\n    public void setCurtainColor(ReactWheelCurvedPicker picker, Integer color) {\n        if (picker != null) {\n            picker.setCurtainColor(color);\n        }\n    }\n\n    // @ReactProp(name=\"indicator\")\n    @ReactProp(name=\"isShowSelectLine\")\n    public void setIndicator(ReactWheelCurvedPicker picker, boolean hasIndicator) {\n        if (picker != null) {\n            picker.setIndicator(hasIndicator);\n        }\n    }\n\n    //@ReactProp(name=\"indicatorColor\", customType = \"Color\")\n    @ReactProp(name=\"selectLineColor\", customType = \"Color\")\n    public void setIndicatorColor(ReactWheelCurvedPicker picker, Integer color) {\n        if (picker != null) {\n            picker.setIndicatorColor(color);\n        }\n    }\n\n    //@ReactProp(name=\"indicatorSize\")\n    @ReactProp(name=\"selectLineSize\")\n    public void setIndicatorSize(ReactWheelCurvedPicker picker, int size) {\n        if (picker != null) {\n            picker.setIndicatorSize(size);\n        }\n    }\n\n    // @ReactProp(name=\"isCyclic\")\n    @ReactProp(name=\"isCyclic\")\n    public void setCyclic(ReactWheelCurvedPicker picker, boolean isCyclic) {\n        if (picker != null) {\n            picker.setCyclic(isCyclic);\n        }\n    }\n\n    @Override\n    public String getName() {\n        return REACT_CLASS;\n    }\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"react-native-wheel-pick\",\n  \"version\": \"1.2.8\",\n  \"description\": \"React native wheel picker iOS style with android.\",\n  \"main\": \"src/index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/TronNatthakorn/react-native-wheel-pick.git\"\n  },\n  \"keywords\": [\n    \"react-native\",\n    \"react-native-wheel\",\n    \"react-native-wheel-pick\",\n    \"react-native-wheel-picker\"\n  ],\n  \"author\": \"Tron Natthakorn <tron.natthakorn@engineer.com>\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/TronNatthakorn/react-native-wheel-pick/issues\"\n  },\n  \"homepage\": \"https://github.com/TronNatthakorn/react-native-wheel-pick#readme\",\n  \"dependencies\": {\n    \"moment\": \"^2.19.1\"\n  },\n  \"peerDependencies\": {\n    \"moment\": \">=2.0.0\",\n    \"prop-types\": \"*\",\n    \"@react-native-community/datetimepicker\": \">=6.1.3\",\n    \"@react-native-picker/picker\": \">=2.4.1\"\n  }\n}\n"
  },
  {
    "path": "react-native.config.js",
    "content": "module.exports = {\n  dependency: {\n    platforms: {\n      android: {\n        packageInstance: \"new ReactNativeWheelPickerPackage()\"\n      }\n    }\n  }\n};\n"
  },
  {
    "path": "src/WheelCurvedPicker.android.js",
    "content": "import React, { PureComponent } from 'react';\nimport { requireNativeComponent, View } from 'react-native';\n// import { ColorPropType, ViewPropTypes as RNViewPropTypes, } from 'deprecated-react-native-prop-types'\nimport PropTypes from 'prop-types';\n\n// const ViewPropTypes = RNViewPropTypes || View.propTypes;\nlet firstTimeOnChange = true\n\nconst stateFromProps = (props) => {\n  let selectedIndex = 0;\n\n  const items = props.children.map(({ props: { value, label } }, index) => {\n    if (value === props.selectedValue) {\n      selectedIndex = index;\n    }\n\n    return { value, label };\n  });\n\n  return { selectedIndex, items };\n};\n\nclass WheelCurvedPicker extends PureComponent {\n  static propTypes = {\n    // ...ViewPropTypes,\n    data: PropTypes.array,\n    // textColor: ColorPropType,\n    textSize: PropTypes.number,\n    onValueChange: PropTypes.func.isRequired,\n    selectedValue: PropTypes.any,\n    // selectedIndex: PropTypes.number,\n  };\n\n  static defaultProps = {\n    textSize: 26,\n    textColor: '#333',\n  };\n\n  state = {\n    selectedIndex: 0\n  }\n\n  onValueChange = ({ nativeEvent: { data } }) => {\n    this.props.onValueChange(data); \n    if(firstTimeOnChange) {\n      return firstTimeOnChange = false\n    }\n  }\n\n  // componentDidMount() {\n  //   this.setState(stateFromProps(this.props));\n  // }\n\n  static getDerivedStateFromProps(nextProps) {\n    return stateFromProps(nextProps)\n  }\n\n  render() {\n    const { children, ...otherProps } = this.props;\n\n    return (\n      <WheelCurvedPickerNative\n        {...otherProps}\n        onValueChange={this.onValueChange}\n        data={this.state.items}\n        selectedIndex={parseInt(this.state.selectedIndex, 10)}\n      />\n    );\n  }\n}\n\nclass Item extends PureComponent {\n  static propTypes = {\n    value: PropTypes.any.isRequired,\n    label: PropTypes.string.isRequired,\n  };\n\n  // These items don't get rendered directly.\n  render = () => <></>;\n}\n\nWheelCurvedPicker.Item = Item;\n\nconst WheelCurvedPickerNative = requireNativeComponent('WheelCurvedPicker', WheelCurvedPicker);\n\nexport default WheelCurvedPicker;\n"
  },
  {
    "path": "src/WheelCurvedPicker.ios.js",
    "content": "import React from 'react';\nimport { Picker } from '@react-native-picker/picker';\n\nexport default Picker;\n"
  },
  {
    "path": "src/WheelCurvedPicker.web.js",
    "content": "// Wait for future maintenance\n\nimport React from 'react';\nimport { Picker } from '@react-native-picker/picker';\n\nexport default Picker;\n"
  },
  {
    "path": "src/date-picker.android.js",
    "content": "import React, { PureComponent } from 'react';\nimport { StyleSheet, View } from 'react-native';\n// import { ColorPropType, ViewPropTypes as RNViewPropTypes } from 'deprecated-react-native-prop-types'\nimport PropTypes from 'prop-types';\nimport moment from 'moment';\nimport Picker from './picker';\n\n// const ViewPropTypes = RNViewPropTypes || View.propTypes;\nconst firstTimeOnChange = {\n  year: true,\n  month: true,\n  date: true,\n  hour: true,\n  minute: true,\n}\n\nconst styles = StyleSheet.create({\n  picker: {\n    flex: 1,\n  },\n  row: {\n    flexDirection: 'row',\n  },\n});\n\nconst stylesFromProps = props => ({\n  textColor: props.textColor,\n  textSize: props.textSize,\n  style: props.style,\n});\n\nexport default class DatePicker extends PureComponent {\n  static propTypes = {\n    labelUnit: PropTypes.shape({\n      year: PropTypes.string,\n      month: PropTypes.array,\n      date: PropTypes.string,\n    }),\n    order: PropTypes.string,\n    date: PropTypes.instanceOf(Date),\n    maximumDate: PropTypes.instanceOf(Date),\n    minimumDate: PropTypes.instanceOf(Date),\n    mode: PropTypes.oneOf(['date', 'time', 'datetime']),\n    onDateChange: PropTypes.func.isRequired,\n    // style: ViewPropTypes.style,\n    // textColor: ColorPropType,\n    textSize: PropTypes.number,\n  };\n\n  static defaultProps = {\n    labelUnit: {\n      year: '',\n      month: moment.months(),\n      date: ''\n    },\n    order: 'M-D-Y',\n    mode: 'date',\n    maximumDate: moment().add(10, 'years').toDate(),\n    minimumDate: moment().add(-10, 'years').toDate(),\n    date: new Date(),\n    style: null,\n    textColor: '#333',\n    textSize: 26,\n  };\n\n  constructor(props) {\n    super(props);\n\n    const { date, minimumDate, maximumDate, labelUnit } = props;\n\n    this.state = { date, monthRange: [], yearRange: [] };\n\n    this.newValue = {};\n\n    this.parseDate(date);\n\n    const mdate = moment(date);\n\n    const dayNum = mdate.daysInMonth();\n    this.state.dayRange = this.genDateRange(dayNum);\n\n    const minYear = minimumDate.getFullYear();\n    const maxYear = maximumDate.getFullYear();\n\n    for (let i = 1; i <= 12; i += 1) {\n      this.state.monthRange.push({ value: i, label: `${labelUnit.month[i - 1]}` });\n    }\n\n    this.state.yearRange.push({ value: minYear, label: `${minYear}${labelUnit.year}` });\n\n    for (let i = minYear + 1; i <= maxYear; i += 1) {\n      this.state.yearRange.push({ value: i, label: `${i}${labelUnit.year}` });\n    }\n  }\n\n  static getDerivedStateFromProps(nextProps, prevState) {\n    if (prevState.date !== nextProps.date) {\n\n      if(typeof this === 'object' && typeof this.parseDate === 'function'){\n        this.parseDate(nextProps.date);\n      }\n\n      return { date: nextProps.date }\n    }\n    else return null;\n  }\n\n  parseDate = (date) => {\n    const mdate = moment(date);\n\n    ['year', 'month', 'date', 'hour', 'minute'].forEach((s) => { this.newValue[s] = mdate.get(s); });\n  }\n\n  onYearChange = (year) => {\n    const oldYear = this.newValue.year;\n\n    this.newValue.year = year;\n    this.checkDate(oldYear, this.newValue.month);\n    if(firstTimeOnChange.year) {\n      firstTimeOnChange.year = false\n    }\n    this.props.onDateChange(this.getValue());\n  };\n\n  onMonthChange = (month) => {\n    const oldMonth = this.newValue.month;\n\n    this.newValue.month = month - 1;\n    this.checkDate(this.newValue.year, oldMonth);\n    if(firstTimeOnChange.month) {\n      firstTimeOnChange.month = false\n    }\n    this.props.onDateChange(this.getValue());\n  };\n\n  onDateChange = (date) => {\n    this.newValue.date = date;\n    this.checkDate(this.newValue.year, this.newValue.month);\n    if(firstTimeOnChange.date) {\n      firstTimeOnChange.date = false\n    }\n    this.props.onDateChange(this.getValue());\n  };\n\n  onHourChange = (hour) => {\n    this.newValue.hour = hour;\n    if(firstTimeOnChange.hour) {\n      firstTimeOnChange.hour = false\n    }\n    this.props.onDateChange(this.getValue());\n  };\n\n  onMinuteChange = (minute) => {\n    this.newValue.minute = minute;\n    if(firstTimeOnChange.minute) {\n      firstTimeOnChange.minute = false\n    }\n    this.props.onDateChange(this.getValue());\n  };\n\n  genDateRange(dayNum) {\n    const days = [];\n\n    for (let i = 1; i <= dayNum; i += 1) {\n      days.push({ value: i, label: `${i}${this.props.labelUnit.date}` });\n    }\n\n    return days;\n  }\n\n  render() {\n    const width_wrapper = this.props.style.width || '100%';\n\n    return (\n      <View style={{...styles.row, width: width_wrapper}}>\n        {['date', 'datetime'].includes(this.props.mode) && this.datePicker}\n        {['time', 'datetime'].includes(this.props.mode) && this.timePicker}\n      </View>\n    );\n  }\n\n  get datePicker() {\n    const propsStyles = stylesFromProps(this.props);\n\n    const { order } = this.props;\n\n    if (!order.includes('D') && !order.includes('M') && !order.includes('Y')) {\n      throw new Error(`WheelDatePicker: you are using order prop wrong, default value is 'D-M-Y'`);\n    }\n\n    return this.props.order.split('-').map((key) => {\n      switch (key) {\n        case 'D': return (\n          <View key='date' style={styles.picker}>\n            <Picker\n              {...propsStyles}\n              {...this.props}\n              style={{...this.props.style, width: '100%'}}\n              ref={(date) => { this.dateComponent = date; }}\n              selectedValue={this.state.date.getDate()}\n              pickerData={this.state.dayRange}\n              onValueChange={this.onDateChange}\n            />\n          </View>\n        );\n        case 'M': return (\n          <View key='month' style={styles.picker}>\n            <Picker\n              {...propsStyles}\n              {...this.props}\n              style={{...this.props.style, width: '100%'}}\n              ref={(month) => { this.monthComponent = month; }}\n              selectedValue={this.state.date.getMonth() + 1}\n              pickerData={this.state.monthRange}\n              onValueChange={this.onMonthChange}\n            />\n          </View>\n        );\n        case 'Y': return (\n          <View key='year' style={styles.picker}>\n            <Picker\n              {...propsStyles}\n              {...this.props}\n              style={{...this.props.style, width: '100%'}}\n              ref={(year) => { this.yearComponent = year; }}\n              selectedValue={this.state.date.getFullYear()}\n              pickerData={this.state.yearRange}\n              onValueChange={this.onYearChange}\n            />\n          </View>\n        );\n        default: return null;\n      }\n    })\n  }\n\n  get timePicker() {\n    const propsStyles = stylesFromProps(this.props);\n\n    const [hours, minutes] = [[], []];\n\n    for (let i = 0; i <= 23; i += 1) {\n      // hours.push(i);\n      hours.push({ value: i, label: `${i}` })\n    }\n\n    for (let i = 0; i <= 59; i += 1) {\n      // minutes.push(i);\n      minutes.push({ value: i, label: `${i}` })\n    }\n\n    return [\n      <View key='hour' style={styles.picker}>\n        <Picker\n          ref={(hour) => { this.hourComponent = hour; }}\n          {...propsStyles}\n          selectedValue={this.state.date.getHours()}\n          pickerData={hours}\n          onValueChange={this.onHourChange}\n        />\n      </View>,\n      <View key='minute' style={styles.picker}>\n        <Picker\n          ref={(minute) => { this.minuteComponent = minute; }}\n          {...propsStyles}\n          selectedValue={this.state.date.getMinutes()}\n          pickerData={minutes}\n          onValueChange={this.onMinuteChange}\n        />\n      </View>,\n    ];\n  }\n\n  checkDate(oldYear, oldMonth) {\n    const currentMonth = this.newValue.month;\n    const currentYear = this.newValue.year;\n    const currentDay = this.newValue.date;\n\n    let dayRange = this.state.dayRange;\n    let dayNum = dayRange.length;\n\n    if (oldMonth !== currentMonth || oldYear !== currentYear) {\n      dayNum = moment(`${currentYear}-${currentMonth + 1}`, 'YYYY-MM').daysInMonth();\n    }\n\n    if (dayNum !== dayRange.length) {\n      dayRange = this.genDateRange(dayNum);\n\n      if (currentDay > dayNum) {\n        this.newValue.date = dayNum;\n        this.dateComponent.setState({ selectedValue: dayNum });\n      }\n\n      this.setState({ dayRange });\n    }\n\n    const unit = this.props.mode === 'date' ? 'day' : undefined;\n    const current = Object.assign({}, this.newValue, { date: this.newValue.date });\n    let currentTime = moment(current);\n    const min = moment(this.props.minimumDate);\n    const max = moment(this.props.maximumDate);\n    let isCurrentTimeChanged = false;\n\n    if (currentTime.isBefore(min, unit)) {\n      [currentTime, isCurrentTimeChanged] = [min, true];\n    } else if (currentTime.isAfter(max, unit)) {\n      [currentTime, isCurrentTimeChanged] = [max, true];\n    }\n\n    if (isCurrentTimeChanged) {\n      if (this.monthComponent) {\n        this.monthComponent.setState({ selectedValue: currentTime.get('month') + 1 });\n      }\n\n      ['year', 'date', 'hour', 'minute'].forEach((segment) => {\n        const ref = this[`${segment}Component`];\n\n        return ref && ref.setState({ selectedValue: currentTime.get(segment) });\n      });\n    }\n  }\n\n  getValue() {\n    const { year, month, date, hour, minute } = this.newValue;\n    const nextDate = new Date(Date.UTC(year, month, date, hour, minute));\n\n    if (nextDate < this.props.minimumDate) {\n      return this.props.minimumDate;\n    }\n\n    return nextDate > this.props.maximumDate ? this.props.maximumDate : nextDate;\n  }\n}\n"
  },
  {
    "path": "src/date-picker.ios.js",
    "content": "import React, { PureComponent } from 'react';\n// import { DatePickerIOS } from 'react-native';\nimport DateTimePicker from '@react-native-community/datetimepicker';\nimport PropTypes from 'prop-types';\n\nexport default class DatePicker extends PureComponent {\n  static propTypes = {\n    date: PropTypes.instanceOf(Date),\n    maximumDate: PropTypes.instanceOf(Date),\n    minimumDate: PropTypes.instanceOf(Date),\n    mode: PropTypes.oneOf(['date', 'time', 'datetime']),\n    onDateChange: PropTypes.func.isRequired,\n  };\n\n  static defaultProps = {\n    mode: 'date',\n    date: new Date(),\n  };\n\n  state = {\n    date: new Date(),\n  };\n\n  // @react-native-community/datetimepicker\n  //2022 use value instead of date\n  //2022 use onChange instead of onDateChange (and first param not date anymore)\n  render() {\n    return (\n      <DateTimePicker\n        {...this.props}\n        onChange={(event, date) => this.onDateChange(date)}\n        display='spinner'\n        value={this.state.date}\n      />\n    );\n  }\n\n  componentDidMount() {\n    this.setState({ date: this.props.date })\n  }\n\n  componentDidUpdate(prevProps) {\n    if (this.props.date !== prevProps.date) {\n      this.setState({ date: this.props.date })\n    }\n  }\n\n  onDateChange = (date) => {\n    this.setState({ date });\n    this.props.onDateChange(date);\n  }\n}\n"
  },
  {
    "path": "src/date-picker.web.js",
    "content": "import React, { PureComponent } from 'react';\r\n// import { DatePickerIOS } from 'react-native';\r\nimport DateTimePicker from '@react-native-community/datetimepicker';\r\nimport PropTypes from 'prop-types';\r\n\r\nexport default class DatePicker extends PureComponent {\r\n  static propTypes = {\r\n    date: PropTypes.instanceOf(Date),\r\n    maximumDate: PropTypes.instanceOf(Date),\r\n    minimumDate: PropTypes.instanceOf(Date),\r\n    mode: PropTypes.oneOf(['date', 'time', 'datetime']),\r\n    onDateChange: PropTypes.func.isRequired,\r\n  };\r\n\r\n  static defaultProps = {\r\n    mode: 'date',\r\n    date: new Date(),\r\n  };\r\n\r\n  state = {\r\n    date: new Date(),\r\n  };\r\n\r\n  // @react-native-community/datetimepicker\r\n  //2022 use value instead of date\r\n  //2022 use onChange instead of onDateChange (and first param not date anymore)\r\n  render() {\r\n    return (\r\n      <DateTimePicker\r\n        {...this.props}\r\n        onChange={(event, date) => this.onDateChange(date)}\r\n        display='spinner'\r\n        value={this.state.date}\r\n      />\r\n    );\r\n  }\r\n\r\n  componentDidMount() {\r\n    this.setState({ date: this.props.date })\r\n  }\r\n\r\n  componentDidUpdate(prevProps) {\r\n    if (this.props.date !== prevProps.date) {\r\n      this.setState({ date: this.props.date })\r\n    }\r\n  }\r\n\r\n  onDateChange = (date) => {\r\n    this.setState({ date });\r\n    this.props.onDateChange(date);\r\n  }\r\n}\r\n"
  },
  {
    "path": "src/index.d.ts",
    "content": "'use strict';\n\nimport { Platform } from 'react-native';\nimport Picker from './picker';\nimport DatePicker from './date-picker';\n\nlet DatePickerComponent = DatePicker;\n\nexport const registerCustomDatePickerIOS = (CustomDatePickerIOS) => {\n  if (Platform.OS === 'ios') {\n    DatePickerComponent = CustomDatePickerIOS;\n  }\n\n  return DatePickerComponent;\n};\n\nexport const Picker;\nexport const DatePicker;\n"
  },
  {
    "path": "src/index.js",
    "content": "'use strict';\n\nimport { Platform } from 'react-native';\nimport Picker from './picker';\nimport DatePicker from './date-picker';\n\nlet DatePickerComponent = DatePicker;\n\nconst registerCustomDatePickerIOS = (CustomDatePickerIOS) => {\n  if (Platform.OS === 'ios') {\n    DatePickerComponent = CustomDatePickerIOS;\n  }\n\n  return DatePickerComponent;\n};\n\nmodule.exports = { Picker, DatePicker: DatePickerComponent, registerCustomDatePickerIOS };\n"
  },
  {
    "path": "src/picker.js",
    "content": "import React, { Component } from 'react';\nimport { StyleSheet, View, Text, Platform } from 'react-native';\n// import { ColorPropType, ViewPropTypes as RNViewPropTypes, } from 'deprecated-react-native-prop-types'\nimport PropTypes from 'prop-types';\nimport WheelCurvedPicker from './WheelCurvedPicker';\n\n// const ViewPropTypes = RNViewPropTypes || View.propTypes;\nconst PickerItem = WheelCurvedPicker.Item;\n\nconst styles = StyleSheet.create({\n  picker: {\n    backgroundColor: '#d3d3d3',\n    height: 220,\n  },\n});\n\n\nexport default class Picker extends Component {\n  static propTypes = {\n    // textColor: ColorPropType,\n    textSize: PropTypes.number,\n    // itemStyle: ViewPropTypes.style,\n    onValueChange: PropTypes.func.isRequired,\n    pickerData: PropTypes.array.isRequired,\n    // style: ViewPropTypes.style,\n    selectedValue: PropTypes.any,\n  };\n\n  static defaultProps = {\n    textColor: '#333',\n    textSize: 26,\n    itemStyle: null,\n    // onValueChange: () => {}, // Require\n    // pickerData: [''], // Require\n    style: {},\n    selectedValue: '',\n  };\n\n  state = {\n    selectedValue: this.props.selectedValue,\n  };\n\n  handleChange = (selectedValue) => {\n    this.setState({ selectedValue });\n    this.props.onValueChange(selectedValue);\n  };\n\n  componentDidUpdate(prevProps) {\n    if (prevProps.selectedValue !== this.props.selectedValue) {\n      this.setState({ selectedValue: this.props.selectedValue });\n    }\n  }\n\n  validateDeprecateProps = (oldProp = 'curtain', newProp = '') => {\n    if(this.props){\n      if(typeof this.props[oldProp] !== 'undefined'){\n        this.props[oldProp] = undefined;\n\n        if(newProp === ''){\n          console.warn(`react-native-wheel-pick : \"${oldProp}\" Prop was deprecated. Please remove it for improve native performance.`)\n        } else {\n          console.warn(`react-native-wheel-pick : \"${oldProp}\" Prop was deprecated. Please use \"${newProp}\" instead.`)\n        }\n      }\n    }\n  }\n\n  render() {\n    const { pickerData, style, ...props } = this.props;\n\n    if(Platform.OS === 'android'){\n      //checkDeprecatedProp\n      this.validateDeprecateProps('atmospheric');\n      this.validateDeprecateProps('curved');\n      this.validateDeprecateProps('visibleItemCount');\n      this.validateDeprecateProps('itemSpace');\n      this.validateDeprecateProps('curtain', 'isShowSelectBackground');\n      this.validateDeprecateProps('curtainColor', 'selectBackgroundColor');\n\n      this.validateDeprecateProps('indicator', 'isShowSelectLine');\n      this.validateDeprecateProps('indicatorColor', 'selectLineColor');\n      this.validateDeprecateProps('indicatorSize', 'selectLineSize');\n    }\n\n    const propsForWeb = { ...props }\n\n    if(Platform.OS === 'web'){\n      propsForWeb.textcolor = propsForWeb.textColor\n      propsForWeb.textsize = propsForWeb.textSize\n\n      propsForWeb.selecttextcolor = propsForWeb.selectTextColor\n      propsForWeb.isshowselectbackground = propsForWeb.isShowSelectBackground.toString()\n      propsForWeb.selectbackgroundcolor = propsForWeb.selectBackgroundColor\n      propsForWeb.isshowselectline = propsForWeb.isShowSelectLine.toString()\n      propsForWeb.selectlinecolor = propsForWeb.selectLineColor\n      propsForWeb.selectlinesize = propsForWeb.selectLineSize\n\n      delete propsForWeb.textColor\n      delete propsForWeb.textSize\n\n      delete propsForWeb.selectTextColor\n      delete propsForWeb.isShowSelectBackground\n      delete propsForWeb.selectBackgroundColor\n      delete propsForWeb.isShowSelectLine\n      delete propsForWeb.selectLineColor\n      delete propsForWeb.selectLineSize\n    }\n\n    return (\n      <WheelCurvedPicker\n        {...(Platform.OS === 'web'? propsForWeb: props)}\n        style={[styles.picker, style]}\n        selectedValue={this.state.selectedValue}\n        onValueChange={this.handleChange}\n      >\n        {pickerData.map((data, index) => (\n          <PickerItem\n            key={index}\n            value={typeof data.value !== 'undefined' ? data.value : data.toString()}\n            label={typeof data.label !== 'undefined' ? data.label : data.toString()}\n            color={(Platform.OS === 'web'? propsForWeb.textcolor: props.textColor)}\n          />\n        ))}\n      </WheelCurvedPicker>\n    );\n  }\n\n  getValue() {\n    return this.state.selectedValue;\n  }\n}\n"
  }
]