{"_id":"@edgarturrin/google-places-autocomplete","_rev":"1-05181f6239be9eb4450739d46a3b3ea5","name":"@edgarturrin/google-places-autocomplete","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@edgarturrin/google-places-autocomplete","version":"1.0.0","description":"Customizable Google Places autocomplete component for iOS and Android React-Native apps","main":"GooglePlacesAutocomplete.js","scripts":{"test":"./node_modules/eslint/bin/eslint.js GooglePlacesAutocomplete.js"},"author":{"name":"Farid from Safi"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/FaridSafi/react-native-google-places-autocomplete.git"},"keywords":["autocomplete","google","places","react-component","react-native","ios","android"],"bugs":{"url":"https://github.com/FaridSafi/react-native-google-places-autocomplete/issues"},"homepage":"https://github.com/FaridSafi/react-native-google-places-autocomplete#readme","dependencies":{"lodash.debounce":"^4.0.8","prop-types":"^15.5.10","qs":"^5.2.0"},"devDependencies":{"eslint":"^1.9.0","eslint-config-airbnb":"^1.0.0","eslint-plugin-react":"^3.9.0"},"peerDependencies":{"react-native":">= 0.46"},"gitHead":"80d1a291c044b4259a46858f171a3447a0819b77","_id":"@edgarturrin/google-places-autocomplete@1.0.0","_nodeVersion":"10.16.3","_npmVersion":"6.12.1","dist":{"integrity":"sha512-f8d4k47RyAnrE06dvMEUIq3iKHHKkKt0WyGMghzvEyurck65frLfDL7MJq0Uf4qkGUuW17h3qsTJ07w6la2e/g==","shasum":"7676ca98c8310a1c2ef9e98d2c68560f4e508727","tarball":"https://registry.npmjs.org/@edgarturrin/google-places-autocomplete/-/google-places-autocomplete-1.0.0.tgz","fileCount":8,"unpackedSize":46868,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdyI2HCRA9TVsSAnZWagAA/sQP/0dyDwSsVjJb1RjUm5o2\nlTD9wVR0brfJC7tZoQf5dBsb36yvNMlHFGGrueIhzRNIrvfDQ8nIZ94DIrks\ne8G2zE3NrVVVnVd3bgI1FLOewFYJCARnmmTCNFC9LdtgyGPxiHWxlYNEGfDl\n83EDae9zQR3dfqtfS8wNGGIdWiDvFUsx4MuzOaq1iS3fdncOF2Ob54X3H58q\neQd6Wy0+NRkERZ5kKkrCeDWKG8UEsz4EPOLwJb/o9nO79TZkKDkc4d2IT/w9\nrDEg9N/4v0E+WtzfsBNFj135PTGSof/NIf0tU7FUGR7AB7uVZ5RfrYidPJE/\n0lvUhhwEX4nVbTvI1WVGPSRs2eNem2JaKC3qRezeBcZu/gcanc3r3hJA6ueW\nEIjqNMxDzZn5FjOyQuimjVD3qnioTuWEdVNeceHwsPMCil4k/awXrC8uT4hG\nl8xYx2gXwsX3mHRONaAUSUVk1yNNLtM+tLDeC1KJDCl0EuMkYg1tDP8Z5Gw3\nVxx1nb/e4Dn+sWc35kM5KvDOHzAHywPCRQqUqeQjgZy9T4afsL2X5tgrU2mi\nTJ630/8NyFw8X2uisa9+eXoM2V7Rwete6WG1n+UifC19xxQUQ1KojTUfa4sw\nBXKHG7aE8Gx7GCig9WHNo0e89DVBhpRlkA6hK6DY18FSdYwc/HsU6Z8zO+Yo\njk7e\r\n=UKu/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAmdN/r18Fx6bElZ87O8gKtziSQctjR/LIQeNcebTwgeAiBKDF7hYX3P8dAzBcvb0ieIs1OnkNn+BeKevDYvnA/eug=="}]},"maintainers":[{"name":"edgarturrin","email":"edgardoturrin@gmail.com"}],"_npmUser":{"name":"edgarturrin","email":"edgardoturrin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/google-places-autocomplete_1.0.0_1573424519094_0.37596597811794363"},"_hasShrinkwrap":false}},"time":{"created":"2019-11-10T22:21:58.835Z","1.0.0":"2019-11-10T22:21:59.231Z","modified":"2022-04-05T06:41:36.075Z"},"maintainers":[{"name":"edgarturrin","email":"edgardoturrin@gmail.com"}],"description":"Customizable Google Places autocomplete component for iOS and Android React-Native apps","homepage":"https://github.com/FaridSafi/react-native-google-places-autocomplete#readme","keywords":["autocomplete","google","places","react-component","react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/FaridSafi/react-native-google-places-autocomplete.git"},"author":{"name":"Farid from Safi"},"bugs":{"url":"https://github.com/FaridSafi/react-native-google-places-autocomplete/issues"},"license":"MIT","readme":"# react-native-google-places-autocomplete\nCustomizable Google Places autocomplete component for iOS and Android React-Native apps\n\n### Preview\n\n![](https://raw.githubusercontent.com/FaridSafi/react-native-google-places-autocomplete/master/Assets/screenshot.png)\n\n### Installation\n\n1. ```npm install react-native-google-places-autocomplete --save```\n2. Get your [Google Places API keys](https://developers.google.com/places/documentation/) and enable \"Google Places API Web Service\" (NOT Android or iOS) in the console.\n3. Enable \"Google Maps Geocoding API\" if you want to use GoogleReverseGeocoding for Current Location\n\n### Example\n\n```jsx\nimport React from 'react';\nimport { Image, Text } from 'react-native';\nimport { GooglePlacesAutocomplete } from 'react-native-google-places-autocomplete';\n\nconst homePlace = { description: 'Home', geometry: { location: { lat: 48.8152937, lng: 2.4597668 } }};\nconst workPlace = { description: 'Work', geometry: { location: { lat: 48.8496818, lng: 2.2940881 } }};\n\nconst GooglePlacesInput = () => {\n  return (\n    <GooglePlacesAutocomplete\n      placeholder='Search'\n      minLength={2} // minimum length of text to search\n      autoFocus={false}\n      returnKeyType={'search'} // Can be left out for default return key https://facebook.github.io/react-native/docs/textinput.html#returnkeytype\n      keyboardAppearance={'light'} // Can be left out for default keyboardAppearance https://facebook.github.io/react-native/docs/textinput.html#keyboardappearance\n      listViewDisplayed='auto'    // true/false/undefined\n      fetchDetails={true}\n      renderDescription={row => row.description} // custom description render\n      onPress={(data, details = null) => { // 'details' is provided when fetchDetails = true\n        console.log(data, details);\n      }}\n\n      getDefaultValue={() => ''}\n\n      query={{\n        // available options: https://developers.google.com/places/web-service/autocomplete\n        key: 'YOUR API KEY',\n        language: 'en', // language of the results\n        types: '(cities)' // default: 'geocode'\n      }}\n\n      styles={{\n        textInputContainer: {\n          width: '100%'\n        },\n        description: {\n          fontWeight: 'bold'\n        },\n        predefinedPlacesDescription: {\n          color: '#1faadb'\n        }\n      }}\n\n      currentLocation={true} // Will add a 'Current location' button at the top of the predefined places list\n      currentLocationLabel=\"Current location\"\n      nearbyPlacesAPI='GooglePlacesSearch' // Which API to use: GoogleReverseGeocoding or GooglePlacesSearch\n      GoogleReverseGeocodingQuery={{\n        // available options for GoogleReverseGeocoding API : https://developers.google.com/maps/documentation/geocoding/intro\n      }}\n      GooglePlacesSearchQuery={{\n        // available options for GooglePlacesSearch API : https://developers.google.com/places/web-service/search\n        rankby: 'distance',\n        type: 'cafe'\n      }}\n      \n      GooglePlacesDetailsQuery={{\n        // available options for GooglePlacesDetails API : https://developers.google.com/places/web-service/details\n        fields: 'formatted_address',\n      }}\n\n      filterReverseGeocodingByTypes={['locality', 'administrative_area_level_3']} // filter the reverse geocoding results by types - ['locality', 'administrative_area_level_3'] if you want to display only cities\n      predefinedPlaces={[homePlace, workPlace]}\n\n      debounce={200} // debounce the requests in ms. Set to 0 to remove debounce. By default 0ms.\n      renderLeftButton={()  => <Image source={require('path/custom/left-icon')} />}\n      renderRightButton={() => <Text>Custom text after the input</Text>}\n    />\n  );\n}\n```\n\n\n### Styling\n\n```GooglePlacesAutocomplete``` can be easily customized to meet styles of your  app. Pass styles props to ```GooglePlacesAutocomplete``` with style object for different elements (keys for style object are listed below)\n\n| key | type |\n| ---- | ---- |\n| container | object (View) |\n| description | object (Text style) |\n| textInputContainer | object (View style) |\n| textInput | object (style) |\n| loader | object (View style) |\n| listView | object (ListView style) |\n| predefinedPlacesDescription | object (Text style) |\n| poweredContainer | object (View style) |\n| powered | object (Image style) |\n| separator | object (View style) |\n| row | object (View style) |\n\n\n#### Example\n\n\n```jsx\n<GooglePlacesAutocomplete\n  placeholder='Enter Location'\n  minLength={2}\n  autoFocus={false}\n  returnKeyType={'default'}\n  fetchDetails={true}\n  styles={{\n    textInputContainer: {\n      backgroundColor: 'rgba(0,0,0,0)',\n      borderTopWidth: 0,\n      borderBottomWidth:0\n    },\n    textInput: {\n      marginLeft: 0,\n      marginRight: 0,\n      height: 38,\n      color: '#5d5d5d',\n      fontSize: 16\n    },\n    predefinedPlacesDescription: {\n      color: '#1faadb'\n    },\n  }}\n  currentLocation={false}\n/>\n```\n\n\n### Features\n\n- [x] Places autocompletion\n- [x] iOS and Android compatibility\n- [x] Places details fetching + ActivityIndicatorIOS/ProgressBarAndroid loaders\n- [x] Customizable using the ```styles``` parameter\n- [x] XHR cancellations when typing fast\n- [x] Google Places terms compliant\n- [x] Current location\n- [x] Predefined places\n\n### Changelog\n- 1.3.9 : Multiple bugfixes + fixed breaking change in React Native.\n- 1.3.6 : Fixed accuracy issue.\n- 1.3.5 : Fixed bug where input was being cleared.\n- 1.3.4 : Fixed bug where loading was breaking the component.\n- 1.3.3 : Fixed `key prop` warning  and added loading indicator.\n- 1.3.2 : Added small feature which makes the request on `componentDidMount()` when you\n  already have the default value set.\n- 1.3.1 : Update `react-native` peerDependecy. (> 0.46)\n- 1.3.0 : Added support for React 16 (isMounted() and propTypes bugfix), support for restricted API key and moving from `ListView` to `Flatlist`.\n- 1.2.12 : Fixed render description + docs.\n- 1.2.11 : Fixed current location result `onPress` event.\n- 1.2.10 : Set default `debounce` to `0`. Fixed debounce typing lag.\n- 1.2.9 : Added `isRowScrollable` prop.\n- 1.2.8 : Added `underlineColorAndroid`, `listUnderlayColor`, `renderLeftButton`, `renderRightButton` props. Added `nearbyPlacesAPI` option `None`.\n\n\n### License\n\n[MIT](LICENSE)\n\n### Authors\n\n- [Farid Safi](https://www.twitter.com/FaridSafi)\n- [Maxim Yaskevich](https://www.twitter.com/mayaskme)\n- [Guilherme Pontes](https://www.twitter.com/guiiipontes)\n","readmeFilename":"README.md"}