react-google-uni-autocomplete
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -18,2 +18,4 @@ 'use strict'; | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -31,3 +33,3 @@ | ||
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(ReactGoogleAutocomplete).call(this, props)); | ||
var _this = _possibleConstructorReturn(this, (ReactGoogleAutocomplete.__proto__ || Object.getPrototypeOf(ReactGoogleAutocomplete)).call(this, props)); | ||
@@ -41,4 +43,8 @@ _this.autocomplete = null; | ||
value: function componentDidMount() { | ||
var _props$types = this.props.types; | ||
var types = _props$types === undefined ? ['(cities)'] : _props$types; | ||
this.autocomplete = new google.maps.places.Autocomplete(this.refs.input, { | ||
types: ['(cities)'] | ||
types: types | ||
}); | ||
@@ -58,2 +64,8 @@ | ||
value: function render() { | ||
var _props = this.props; | ||
var onPlaceSelected = _props.onPlaceSelected; | ||
var types = _props.types; | ||
var rest = _objectWithoutProperties(_props, ['onPlaceSelected', 'types']); | ||
return _react2.default.createElement( | ||
@@ -64,3 +76,3 @@ 'div', | ||
ref: 'input' | ||
}, this.props)) | ||
}, rest)) | ||
); | ||
@@ -83,3 +95,3 @@ } | ||
var _this2 = _possibleConstructorReturn(this, Object.getPrototypeOf(ReactCustomGoogleAutocomplete).call(this, props)); | ||
var _this2 = _possibleConstructorReturn(this, (ReactCustomGoogleAutocomplete.__proto__ || Object.getPrototypeOf(ReactCustomGoogleAutocomplete)).call(this, props)); | ||
@@ -86,0 +98,0 @@ _this2.service = new google.maps.places.AutocompleteService(); |
{ | ||
"name": "react-google-uni-autocomplete", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "React components for google autocomplete.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -14,4 +14,6 @@ import React, {PropTypes} from 'react'; | ||
componentDidMount() { | ||
const { types=['(cities)'] } = this.props; | ||
this.autocomplete = new google.maps.places.Autocomplete(this.refs.input, { | ||
types: ['(cities)'], | ||
types, | ||
}); | ||
@@ -29,2 +31,4 @@ | ||
render() { | ||
const {onPlaceSelected, types, ...rest} = this.props; | ||
return ( | ||
@@ -34,3 +38,3 @@ <div> | ||
ref="input" | ||
{...this.props} | ||
{...rest} | ||
/> | ||
@@ -37,0 +41,0 @@ </div> |
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
11699
218