react-google-autocomplete
Advanced tools
Comparing version 1.0.9 to 1.0.10
@@ -45,3 +45,5 @@ 'use strict'; | ||
_props$componentRestr = _props.componentRestrictions, | ||
componentRestrictions = _props$componentRestr === undefined ? {} : _props$componentRestr; | ||
componentRestrictions = _props$componentRestr === undefined ? {} : _props$componentRestr, | ||
_props$bounds = _props.bounds, | ||
bounds = _props$bounds === undefined ? {} : _props$bounds; | ||
@@ -51,3 +53,4 @@ | ||
types: types, | ||
componentRestrictions: componentRestrictions | ||
componentRestrictions: componentRestrictions, | ||
bounds: bounds | ||
}); | ||
@@ -71,3 +74,4 @@ | ||
componentRestrictions = _props2.componentRestrictions, | ||
rest = _objectWithoutProperties(_props2, ['onPlaceSelected', 'types', 'componentRestrictions']); | ||
bounds = _props2.bounds, | ||
rest = _objectWithoutProperties(_props2, ['onPlaceSelected', 'types', 'componentRestrictions', 'bounds']); | ||
@@ -90,3 +94,4 @@ return _react2.default.createElement( | ||
types: _react.PropTypes.array, | ||
componentRestrictions: _react.PropTypes.object | ||
componentRestrictions: _react.PropTypes.object, | ||
bounds: _react.PropTypes.object | ||
}; | ||
@@ -93,0 +98,0 @@ exports.default = ReactGoogleAutocomplete; |
{ | ||
"name": "react-google-autocomplete", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "React component for google autocomplete.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -33,2 +33,3 @@ ## React google autocomplete | ||
A [componentRestrictions](https://developers.google.com/maps/documentation/javascript/reference#ComponentRestrictions) prop by default is empty. | ||
A [bounds](https://developers.google.com/maps/documentation/javascript/reference#AutocompleteOptions) prop by default is empty. | ||
You also can pass any props you want to the final input. |
@@ -8,2 +8,3 @@ import React, {PropTypes} from 'react'; | ||
componentRestrictions: PropTypes.object, | ||
bounds: PropTypes.object, | ||
} | ||
@@ -17,3 +18,3 @@ | ||
componentDidMount() { | ||
const { types=['(cities)'], componentRestrictions={} } = this.props; | ||
const { types=['(cities)'], componentRestrictions={}, bounds={} } = this.props; | ||
@@ -23,2 +24,3 @@ this.autocomplete = new google.maps.places.Autocomplete(this.refs.input, { | ||
componentRestrictions, | ||
bounds, | ||
}); | ||
@@ -36,3 +38,3 @@ | ||
render() { | ||
const {onPlaceSelected, types, componentRestrictions, ...rest} = this.props; | ||
const {onPlaceSelected, types, componentRestrictions, bounds, ...rest} = this.props; | ||
@@ -39,0 +41,0 @@ return ( |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12691
231
35