react-google-autocomplete
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -41,8 +41,12 @@ 'use strict'; | ||
value: function componentDidMount() { | ||
var _props$types = this.props.types; | ||
var types = _props$types === undefined ? ['(cities)'] : _props$types; | ||
var _props = this.props, | ||
_props$types = _props.types, | ||
types = _props$types === undefined ? ['(cities)'] : _props$types, | ||
_props$componentRestr = _props.componentRestrictions, | ||
componentRestrictions = _props$componentRestr === undefined ? {} : _props$componentRestr; | ||
this.autocomplete = new google.maps.places.Autocomplete(this.refs.input, { | ||
types: types | ||
types: types, | ||
componentRestrictions: componentRestrictions | ||
}); | ||
@@ -62,8 +66,7 @@ | ||
value: function render() { | ||
var _props = this.props; | ||
var onPlaceSelected = _props.onPlaceSelected; | ||
var types = _props.types; | ||
var _props2 = this.props, | ||
onPlaceSelected = _props2.onPlaceSelected, | ||
types = _props2.types, | ||
rest = _objectWithoutProperties(_props2, ['onPlaceSelected', 'types']); | ||
var rest = _objectWithoutProperties(_props, ['onPlaceSelected', 'types']); | ||
return _react2.default.createElement( | ||
@@ -83,3 +86,5 @@ 'div', | ||
ReactGoogleAutocomplete.propTypes = { | ||
onPlaceSelected: _react.PropTypes.func | ||
onPlaceSelected: _react.PropTypes.func, | ||
types: _react.PropTypes.array, | ||
componentRestrictions: _react.PropTypes.object | ||
}; | ||
@@ -105,4 +110,4 @@ exports.default = ReactGoogleAutocomplete; | ||
var _props$types2 = this.props.types; | ||
var types = _props$types2 === undefined ? ['(cities)'] : _props$types2; | ||
var _props$types2 = this.props.types, | ||
types = _props$types2 === undefined ? ['(cities)'] : _props$types2; | ||
@@ -109,0 +114,0 @@ |
{ | ||
"name": "react-google-autocomplete", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "React component for google autocomplete.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -7,2 +7,3 @@ import React, {PropTypes} from 'react'; | ||
types: PropTypes.array, | ||
componentRestrictions: PropTypes.object, | ||
} | ||
@@ -16,6 +17,7 @@ | ||
componentDidMount() { | ||
const { types=['(cities)'] } = this.props; | ||
const { types=['(cities)'], componentRestrictions={} } = this.props; | ||
this.autocomplete = new google.maps.places.Autocomplete(this.refs.input, { | ||
types, | ||
componentRestrictions, | ||
}); | ||
@@ -22,0 +24,0 @@ |
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
11983
223