react-geosuggest
Advanced tools
Comparing version 1.3.0 to 1.4.0
{ | ||
"name": "react-geosuggest", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "A React autosuggest for the Google Maps Places API.", | ||
"main": "dist/react-geosuggest.js", | ||
"main": "module/Geosuggest.js", | ||
"author": "Robert Katzki <katzki@ubilabs.net>", | ||
@@ -17,28 +17,39 @@ "homepage": "https://github.com/ubilabs/react-geosuggest", | ||
"dependencies": { | ||
"react": "^0.13.1", | ||
"reactify": "^1.1.0" | ||
"react": "^0.13.1" | ||
}, | ||
"devDependencies": { | ||
"babel": "^5.6.23", | ||
"babelify": "^6.1.3", | ||
"browserify": "^11.0.0", | ||
"bumpery": "^1.1.1", | ||
"conventional-changelog-generator": "0.0.3", | ||
"eslint": "^0.24.0", | ||
"gulp": "^3.8.10", | ||
"gulp-git": "^1.0.0", | ||
"react-component-gulp-tasks": "^0.1.1" | ||
"gh-pages": "^0.3.1", | ||
"light-server": "^1.0.3", | ||
"uglifyjs": "^2.4.10" | ||
}, | ||
"browser": "src/Geosuggest.jsx", | ||
"browserify": { | ||
"transform": [ | ||
"reactify" | ||
] | ||
}, | ||
"browserify-shim": { | ||
"react": "global:React" | ||
}, | ||
"scripts": { | ||
"prepublish": "npm run build:module", | ||
"lint": "eslint ./src/*.jsx ./example/src", | ||
"test": "npm run lint", | ||
"build": "gulp build", | ||
"release": "gulp release", | ||
"release:patch": "gulp release:patch", | ||
"release:minor": "gulp release:minor", | ||
"release:major": "gulp release:major" | ||
"start": "npm run server", | ||
"server": "npm run prepare:example && light-server -s example/dist -p 8000 -w 'src/*.jsx,example/src/*.js # npm run js:example' -w 'src/*.css,example/src/*.css # npm run css # reloadcss' -w 'example/src/*.html # npm run copy:assets # reload'", | ||
"prepare:example": "rm -rf example/dist && mkdir example/dist && npm run copy:assets && npm run js:example && npm run css", | ||
"copy:assets": "cp example/src/*.html example/dist && cp example/src/*.svg example/dist", | ||
"css": "cat example/src/app.css src/geosuggest.css > example/dist/app.css", | ||
"js:example": "browserify example/src/app.js -t babelify > example/dist/app.js", | ||
"js:example:uglify": "uglifyjs example/dist/app.js -o example/dist/app.js -c warnings=false,drop_console=true --mangle", | ||
"js:browser": "browserify src/Geosuggest.jsx --standalone Geosuggest --exclude react -t babelify > dist/react-geosuggest.js", | ||
"js:browser:uglify": "uglifyjs dist/react-geosuggest.js -o dist/react-geosuggest.min.js -c warnings=false,drop_console=true --mangle", | ||
"build:module": "babel src --out-dir module", | ||
"build:browser": "npm run js:browser && npm run js:browser:uglify", | ||
"build:example": "npm run prepare:example && npm run js:example:uglify", | ||
"changelog": "conventional-changelog-generator && atom -w CHANGELOG.md", | ||
"release": "echo 'Usage: npm run release:patch|minor|major'", | ||
"release:patch": "npm run build:browser && bumpery --verify='npm test' --no-push --no-commit --no-createTag --versionType patch && npm run release:finish", | ||
"release:minor": "npm run build:browser && bumpery --verify='npm test' --no-push --no-commit --no-createTag --versionType minor && npm run release:finish", | ||
"release:major": "npm run build:browser && bumpery --verify='npm test' --no-push --no-commit --no-createTag --versionType major && npm run release:finish", | ||
"release:finish": "npm run changelog && npm run release:commit && npm run publish:example", | ||
"release:commit": "bumpery --commitFiles 'dist/*.js CHANGELOG.md package.json' --commitMessage 'chore(release): version %VERSION%' --no-bumpVersion", | ||
"publish:example": "npm run build:example && gh-pages -d example/dist" | ||
}, | ||
@@ -45,0 +56,0 @@ "readmeFilename": "README.md", |
@@ -56,2 +56,14 @@ # React Geosuggest | ||
#### initialValue | ||
Type: `String` | ||
Default: `''` | ||
An initial value for the input, when you want to prefill the suggest. | ||
#### className | ||
Type: `String` | ||
Default: `''` | ||
Add an additional class to the geosuggest container. | ||
#### location | ||
@@ -114,2 +126,3 @@ Type: `google.maps.LatLng` | ||
placeholder="Start typing!" | ||
initialValue="Hamburg" | ||
fixtures={fixtures} | ||
@@ -148,3 +161,3 @@ onSuggestSelect={this.onSuggestSelect} | ||
npm install | ||
gulp serve | ||
npm start | ||
``` | ||
@@ -159,3 +172,3 @@ | ||
``` | ||
gulp release:patch|minor|major | ||
npm run release:patch|minor|major | ||
``` | ||
@@ -162,0 +175,0 @@ |
@@ -14,3 +14,5 @@ /* global google */ | ||
fixtures: [], | ||
initialValue: '', | ||
placeholder: 'Search places', | ||
className: '', | ||
onSuggestSelect: function() {}, | ||
@@ -30,3 +32,3 @@ location: null, | ||
isSuggestsHidden: true, | ||
userInput: '', | ||
userInput: this.props.initialValue, | ||
activeSuggest: null, | ||
@@ -47,8 +49,12 @@ suggests: [], | ||
this.setState({userInput: userInput}, function() { | ||
if (!userInput) { | ||
this.updateSuggests(); | ||
} | ||
this.showSuggests(); | ||
}.bind(this)); | ||
}, | ||
if (!userInput) { | ||
/** | ||
* Search for new suggests | ||
*/ | ||
searchSuggests: function() { | ||
if (!this.state.userInput) { | ||
this.updateSuggests(); | ||
return; | ||
@@ -58,3 +64,3 @@ } | ||
this.state.autocompleteService.getPlacePredictions({ | ||
input: userInput, | ||
input: this.state.userInput, | ||
location: this.props.location || new this.props.googleMaps.LatLng(0, 0), | ||
@@ -100,3 +106,3 @@ radius: this.props.radius | ||
showSuggests: function() { | ||
this.updateSuggests(); | ||
this.searchSuggests(); | ||
@@ -148,2 +154,7 @@ this.setState({isSuggestsHidden: false}); | ||
activateSuggest: function(direction) { | ||
if (this.state.isSuggestsHidden) { | ||
this.showSuggests(); | ||
return; | ||
} | ||
var suggestsCount = this.state.suggests.length - 1, | ||
@@ -228,3 +239,4 @@ next = direction === 'next', | ||
return (// eslint-disable-line no-extra-parens | ||
<div className="geosuggest" onClick={this.onClick}> | ||
<div className={'geosuggest ' + this.props.className} | ||
onClick={this.onClick}> | ||
<input | ||
@@ -231,0 +243,0 @@ className="geosuggest__input" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
51088
1
18
818
195
9
1
4
- Removedreactify@^1.1.0
- Removedbase62@0.1.1(transitive)
- Removedesprima-fb@13001.1001.0-dev-harmony-fb(transitive)
- Removedjstransform@10.1.0(transitive)
- Removedreact-tools@0.13.3(transitive)
- Removedreactify@1.1.1(transitive)
- Removedsource-map@0.1.31(transitive)