Socket
Socket
Sign inDemoInstall

react-geosuggest

Package Overview
Dependencies
43
Maintainers
3
Versions
64
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.18.0 to 1.18.1

9

CHANGELOG.md

@@ -0,1 +1,10 @@

### 1.18.1 (2016-02-11)
#### Bug Fixes
* **input:** use corrected list of allowed input attributes ([d623c65c](https://github.com/ubilabs/react-geosuggest/commit/d623c65c6eb26ff84d5675e573a4991a93c4c74f))
* make classnames a real dependency ([1fd93dd](https://github.com/ubilabs/react-geosuggest/commit/1fd93dd842820f87133ae4db48ba24fc064270fd))
## 1.18.0 (2016-02-10)

@@ -2,0 +11,0 @@

2

dist/react-geosuggest.js

@@ -534,3 +534,3 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Geosuggest = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

});
var allowedAttributes = ['autocapitalize', 'autocomplete', 'autocorrect', 'autoFocus', 'autosave', 'disabled', 'form', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'height', 'id', 'inputmode', 'maxlength', 'maxlength', 'name', 'pattern', 'placeholder', 'readonly', 'required', 'selectionDirection', 'size', 'spellcheck', 'tabindex'];
var allowedAttributes = ['autoComplete', 'autoFocus', 'disabled', 'form', 'formAction', 'formEncType', 'formMethod', 'formNoValidate', 'formTarget', 'height', 'id', 'inputMode', 'maxLength', 'name', 'pattern', 'placeholder', 'readOnly', 'required', 'size', 'spellCheck', 'tabIndex'];

@@ -537,0 +537,0 @@ /**

@@ -1,1 +0,1 @@

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Geosuggest=e()}}(function(){var e;return function t(e,n,s){function o(i,r){if(!n[i]){if(!e[i]){var a="function"==typeof require&&require;if(!r&&a)return a(i,!0);if(u)return u(i,!0);var l=new Error("Cannot find module '"+i+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[i]={exports:{}};e[i][0].call(c.exports,function(t){var n=e[i][1][t];return o(n?n:t)},c,c.exports,t,e,n,s)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<s.length;i++)o(s[i]);return o}({1:[function(t,n){!function(){"use strict";function t(){for(var e=[],n=0;n<arguments.length;n++){var o=arguments[n];if(o){var u=typeof o;if("string"===u||"number"===u)e.push(o);else if(Array.isArray(o))e.push(t.apply(null,o));else if("object"===u)for(var i in o)s.call(o,i)&&o[i]&&e.push(i)}}return e.join(" ")}var s={}.hasOwnProperty;"undefined"!=typeof n&&n.exports?n.exports=t:"function"==typeof e&&"object"==typeof e.amd&&e.amd?e("classnames",[],function(){return t}):window.classNames=t}()},{}],2:[function(e,t,n){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}Object.defineProperty(n,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}return function(t,n,s){return n&&e(t.prototype,n),s&&e(t,s),t}}(),l=function(e,t,n){for(var s=!0;s;){var o=e,u=t,i=n;s=!1,null===o&&(o=Function.prototype);var r=Object.getOwnPropertyDescriptor(o,u);if(void 0!==r){if("value"in r)return r.value;var a=r.get;return void 0===a?void 0:a.call(i)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=u,n=i,s=!0,r=l=void 0}},c=window.React,f=s(c),p=e("classnames"),g=s(p),d=e("./defaults"),h=s(d),v=e("./filter-input-attributes"),y=s(v),m=e("./input"),S=s(m),b=e("./suggest-list"),w=s(b),O=function(e){function t(e){o(this,t),l(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.state={isMounted:!1,isSuggestsHidden:!0,userInput:this.props.initialValue,activeSuggest:null,suggests:[]}}return u(t,e),a(t,[{key:"componentWillReceiveProps",value:function(e){this.props.initialValue!==e.initialValue&&this.setState({userInput:e.initialValue})}},{key:"componentDidMount",value:function(){this.setState({userInput:this.props.initialValue});var e=this.props.googleMaps||window.google&&window.google.maps||this.googleMaps;e&&(this.googleMaps=e,this.autocompleteService=new e.places.AutocompleteService,this.geocoder=new e.Geocoder,this.setState({isMounted:!0}))}},{key:"componentWillUnmount",value:function(){this.setState({isMounted:!1})}},{key:"onInputChange",value:function(e){var t=this;this.setState({userInput:e},function(){t.showSuggests(),t.props.onChange(e)})}},{key:"onInputFocus",value:function(){this.props.onFocus(),this.showSuggests()}},{key:"onInputBlur",value:function(){this.state.ignoreBlur||this.hideSuggests()}},{key:"focus",value:function(){this.refs.input.focus()}},{key:"update",value:function(e){this.setState({userInput:e}),this.props.onChange(e)}},{key:"clear",value:function(){var e=this;this.setState({userInput:""},function(){return e.hideSuggests()})}},{key:"searchSuggests",value:function(){var e=this;if(!this.state.userInput)return void this.updateSuggests();var t={input:this.state.userInput};["location","radius","bounds","types"].forEach(function(n){e.props[n]&&(t[n]=e.props[n])}),this.props.country&&(t.componentRestrictions={country:this.props.country}),this.autocompleteService.getPlacePredictions(t,function(t){e.updateSuggests(t||[]),e.props.autoActivateFirstSuggest&&e.activateSuggest("next")})}},{key:"updateSuggests",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?[]:arguments[0],n=[],s=new RegExp(i(this.state.userInput),"gim"),o=this.props.skipSuggest;this.props.fixtures.forEach(function(e){!o(e)&&e.label.match(s)&&(e.placeId=e.label,n.push(e))}),t.forEach(function(t){o(t)||n.push({label:e.props.getSuggestLabel(t),placeId:t.place_id})}),this.setState({suggests:n})}},{key:"showSuggests",value:function(){this.searchSuggests(),this.setState({isSuggestsHidden:!1})}},{key:"hideSuggests",value:function(){var e=this;this.props.onBlur(),setTimeout(function(){e.state&&e.state.isMounted&&e.setState({isSuggestsHidden:!0})},100)}},{key:"activateSuggest",value:function(e){if(this.state.isSuggestsHidden)return void this.showSuggests();var t=this.state.suggests.length-1,n="next"===e,s=null,o=0,u=0;for(u;t>=u;u++)this.state.suggests[u]===this.state.activeSuggest&&(o=n?u+1:u-1);this.state.activeSuggest||(o=n?0:t),o>=0&&t>=o&&(s=this.state.suggests[o]),this.setState({activeSuggest:s})}},{key:"selectSuggest",value:function(e){return e||(e={label:this.state.userInput}),this.setState({isSuggestsHidden:!0,userInput:e.label}),e.location?(this.setState({ignoreBlur:!1}),void this.props.onSuggestSelect(e)):void this.geocodeSuggest(e)}},{key:"geocodeSuggest",value:function(e){var t=this;this.geocoder.geocode(e.placeId?{placeId:e.placeId}:{address:e.label},function(n,s){if(s===t.googleMaps.GeocoderStatus.OK){var o=n[0],u=o.geometry.location;e.gmaps=o,e.location={lat:u.lat(),lng:u.lng()},t.props.onSuggestSelect(e)}})}},{key:"render",value:function(){var e=this,t=y["default"](this.props),n=g["default"]("geosuggest",this.props.className);return f["default"].createElement("div",{className:n},f["default"].createElement(S["default"],r({className:this.props.inputClassName,ref:"input",value:this.state.userInput,onChange:this.onInputChange.bind(this),onFocus:this.onInputFocus.bind(this),onBlur:this.onInputBlur.bind(this),onNext:function(){return e.activateSuggest("next")},onPrev:function(){return e.activateSuggest("prev")},onSelect:function(){return e.selectSuggest(e.state.activeSuggest)},onEscape:this.hideSuggests.bind(this)},t)),f["default"].createElement(w["default"],{isHidden:this.state.isSuggestsHidden,suggests:this.state.suggests,activeSuggest:this.state.activeSuggest,onSuggestMouseDown:function(){return e.setState({ignoreBlur:!0})},onSuggestMouseOut:function(){return e.setState({ignoreBlur:!1})},onSuggestSelect:this.selectSuggest.bind(this)}))}}]),t}(f["default"].Component);O.defaultProps=h["default"],n["default"]=O,t.exports=n["default"]},{"./defaults":3,"./filter-input-attributes":4,"./input":5,"./suggest-list":7,classnames:1}],3:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]={fixtures:[],initialValue:"",placeholder:"Search places",disabled:!1,className:"",inputClassName:"",location:null,radius:null,bounds:null,country:null,types:null,googleMaps:null,onSuggestSelect:function(){},onFocus:function(){},onBlur:function(){},onChange:function(){},skipSuggest:function(){},getSuggestLabel:function(e){return e.description},autoActivateFirstSuggest:!1},t.exports=n["default"]},{}],4:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var s=["autocapitalize","autocomplete","autocorrect","autoFocus","autosave","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","id","inputmode","maxlength","maxlength","name","pattern","placeholder","readonly","required","selectionDirection","size","spellcheck","tabindex"];n["default"]=function(e){var t={};return s.forEach(function(n){e[n]&&(t[n]=e[n])}),t},t.exports=n["default"]},{}],5:[function(e,t,n){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}return function(t,n,s){return n&&e(t.prototype,n),s&&e(t,s),t}}(),a=function(e,t,n){for(var s=!0;s;){var o=e,u=t,i=n;s=!1,null===o&&(o=Function.prototype);var r=Object.getOwnPropertyDescriptor(o,u);if(void 0!==r){if("value"in r)return r.value;var a=r.get;return void 0===a?void 0:a.call(i)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=u,n=i,s=!0,r=l=void 0}},l=window.React,c=s(l),f=e("classnames"),p=s(f),g=e("./filter-input-attributes"),d=s(g),h=function(e){function t(){o(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return u(t,e),r(t,[{key:"onChange",value:function(){this.props.onChange(this.refs.input.value)}},{key:"onInputKeyDown",value:function(e){switch(e.which){case 40:e.preventDefault(),this.props.onNext();break;case 38:e.preventDefault(),this.props.onPrev();break;case 13:e.preventDefault(),this.props.onSelect();break;case 9:this.props.onSelect();break;case 27:this.props.onEscape()}}},{key:"focus",value:function(){this.refs.input.focus()}},{key:"render",value:function(){var e=d["default"](this.props),t=p["default"]("geosuggest__input",this.props.className);return c["default"].createElement("input",i({className:t,ref:"input",type:"text"},e,{value:this.props.value,onKeyDown:this.onInputKeyDown.bind(this),onChange:this.onChange.bind(this),onFocus:this.props.onFocus.bind(this),onBlur:this.props.onBlur.bind(this)}))}}]),t}(c["default"].Component);h.defaultProps={className:"",value:"",onChange:function(){},onFocus:function(){},onBlur:function(){},onNext:function(){},onPrev:function(){},onSelect:function(){},onEscape:function(){}},n["default"]=h,t.exports=n["default"]},{"./filter-input-attributes":4,classnames:1}],6:[function(e,t,n){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var o=window.React,u=s(o),i=e("classnames"),r=s(i);n["default"]=function(e){var t=e.isActive,n=void 0===t?!1:t,s=e.className,o=void 0===s?"":s,i=e.suggest,a=void 0===i?{}:i,l=e.onMouseDown,c=void 0===l?function(){}:l,f=e.onMouseOut,p=void 0===f?function(){}:f,g=e.onSelect,d=void 0===g?function(){}:g,h=r["default"]("geosuggest-item",o,{"geosuggest-item--active":n});return u["default"].createElement("li",{className:h,onMouseDown:c,onMouseOut:p,onClick:function(e){e.preventDefault(),d()}},a.label)},t.exports=n["default"]},{classnames:1}],7:[function(e,t,n){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var o=window.React,u=s(o),i=e("classnames"),r=s(i),a=e("./suggest-item"),l=s(a);n["default"]=function(e){var t=e.isHidden,n=void 0===t?!0:t,s=e.suggests,o=void 0===s?[]:s,i=e.activeSuggest,a=e.onSuggestMouseDown,c=void 0===a?function(){}:a,f=e.onSuggestMouseOut,p=void 0===f?function(){}:f,g=e.onSuggestSelect,d=void 0===g?function(){}:g,h=r["default"]("geosuggest__suggests",{"geosuggest__suggests--hidden":n});return u["default"].createElement("ul",{className:h},o.map(function(e){var t=i&&e.placeId===i.placeId;return u["default"].createElement(l["default"],{key:e.placeId,suggest:e,isActive:t,onMouseDown:c,onMouseOut:p,onSelect:function(){return d(e)}})}))},t.exports=n["default"]},{"./suggest-item":6,classnames:1}]},{},[2])(2)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Geosuggest=e()}}(function(){var e;return function t(e,n,s){function o(i,r){if(!n[i]){if(!e[i]){var a="function"==typeof require&&require;if(!r&&a)return a(i,!0);if(u)return u(i,!0);var l=new Error("Cannot find module '"+i+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[i]={exports:{}};e[i][0].call(c.exports,function(t){var n=e[i][1][t];return o(n?n:t)},c,c.exports,t,e,n,s)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<s.length;i++)o(s[i]);return o}({1:[function(t,n){!function(){"use strict";function t(){for(var e=[],n=0;n<arguments.length;n++){var o=arguments[n];if(o){var u=typeof o;if("string"===u||"number"===u)e.push(o);else if(Array.isArray(o))e.push(t.apply(null,o));else if("object"===u)for(var i in o)s.call(o,i)&&o[i]&&e.push(i)}}return e.join(" ")}var s={}.hasOwnProperty;"undefined"!=typeof n&&n.exports?n.exports=t:"function"==typeof e&&"object"==typeof e.amd&&e.amd?e("classnames",[],function(){return t}):window.classNames=t}()},{}],2:[function(e,t,n){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}Object.defineProperty(n,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}return function(t,n,s){return n&&e(t.prototype,n),s&&e(t,s),t}}(),l=function(e,t,n){for(var s=!0;s;){var o=e,u=t,i=n;s=!1,null===o&&(o=Function.prototype);var r=Object.getOwnPropertyDescriptor(o,u);if(void 0!==r){if("value"in r)return r.value;var a=r.get;return void 0===a?void 0:a.call(i)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=u,n=i,s=!0,r=l=void 0}},c=window.React,f=s(c),p=e("classnames"),g=s(p),d=e("./defaults"),h=s(d),v=e("./filter-input-attributes"),y=s(v),m=e("./input"),S=s(m),b=e("./suggest-list"),w=s(b),O=function(e){function t(e){o(this,t),l(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.state={isMounted:!1,isSuggestsHidden:!0,userInput:this.props.initialValue,activeSuggest:null,suggests:[]}}return u(t,e),a(t,[{key:"componentWillReceiveProps",value:function(e){this.props.initialValue!==e.initialValue&&this.setState({userInput:e.initialValue})}},{key:"componentDidMount",value:function(){this.setState({userInput:this.props.initialValue});var e=this.props.googleMaps||window.google&&window.google.maps||this.googleMaps;e&&(this.googleMaps=e,this.autocompleteService=new e.places.AutocompleteService,this.geocoder=new e.Geocoder,this.setState({isMounted:!0}))}},{key:"componentWillUnmount",value:function(){this.setState({isMounted:!1})}},{key:"onInputChange",value:function(e){var t=this;this.setState({userInput:e},function(){t.showSuggests(),t.props.onChange(e)})}},{key:"onInputFocus",value:function(){this.props.onFocus(),this.showSuggests()}},{key:"onInputBlur",value:function(){this.state.ignoreBlur||this.hideSuggests()}},{key:"focus",value:function(){this.refs.input.focus()}},{key:"update",value:function(e){this.setState({userInput:e}),this.props.onChange(e)}},{key:"clear",value:function(){var e=this;this.setState({userInput:""},function(){return e.hideSuggests()})}},{key:"searchSuggests",value:function(){var e=this;if(!this.state.userInput)return void this.updateSuggests();var t={input:this.state.userInput};["location","radius","bounds","types"].forEach(function(n){e.props[n]&&(t[n]=e.props[n])}),this.props.country&&(t.componentRestrictions={country:this.props.country}),this.autocompleteService.getPlacePredictions(t,function(t){e.updateSuggests(t||[]),e.props.autoActivateFirstSuggest&&e.activateSuggest("next")})}},{key:"updateSuggests",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?[]:arguments[0],n=[],s=new RegExp(i(this.state.userInput),"gim"),o=this.props.skipSuggest;this.props.fixtures.forEach(function(e){!o(e)&&e.label.match(s)&&(e.placeId=e.label,n.push(e))}),t.forEach(function(t){o(t)||n.push({label:e.props.getSuggestLabel(t),placeId:t.place_id})}),this.setState({suggests:n})}},{key:"showSuggests",value:function(){this.searchSuggests(),this.setState({isSuggestsHidden:!1})}},{key:"hideSuggests",value:function(){var e=this;this.props.onBlur(),setTimeout(function(){e.state&&e.state.isMounted&&e.setState({isSuggestsHidden:!0})},100)}},{key:"activateSuggest",value:function(e){if(this.state.isSuggestsHidden)return void this.showSuggests();var t=this.state.suggests.length-1,n="next"===e,s=null,o=0,u=0;for(u;t>=u;u++)this.state.suggests[u]===this.state.activeSuggest&&(o=n?u+1:u-1);this.state.activeSuggest||(o=n?0:t),o>=0&&t>=o&&(s=this.state.suggests[o]),this.setState({activeSuggest:s})}},{key:"selectSuggest",value:function(e){return e||(e={label:this.state.userInput}),this.setState({isSuggestsHidden:!0,userInput:e.label}),e.location?(this.setState({ignoreBlur:!1}),void this.props.onSuggestSelect(e)):void this.geocodeSuggest(e)}},{key:"geocodeSuggest",value:function(e){var t=this;this.geocoder.geocode(e.placeId?{placeId:e.placeId}:{address:e.label},function(n,s){if(s===t.googleMaps.GeocoderStatus.OK){var o=n[0],u=o.geometry.location;e.gmaps=o,e.location={lat:u.lat(),lng:u.lng()},t.props.onSuggestSelect(e)}})}},{key:"render",value:function(){var e=this,t=y["default"](this.props),n=g["default"]("geosuggest",this.props.className);return f["default"].createElement("div",{className:n},f["default"].createElement(S["default"],r({className:this.props.inputClassName,ref:"input",value:this.state.userInput,onChange:this.onInputChange.bind(this),onFocus:this.onInputFocus.bind(this),onBlur:this.onInputBlur.bind(this),onNext:function(){return e.activateSuggest("next")},onPrev:function(){return e.activateSuggest("prev")},onSelect:function(){return e.selectSuggest(e.state.activeSuggest)},onEscape:this.hideSuggests.bind(this)},t)),f["default"].createElement(w["default"],{isHidden:this.state.isSuggestsHidden,suggests:this.state.suggests,activeSuggest:this.state.activeSuggest,onSuggestMouseDown:function(){return e.setState({ignoreBlur:!0})},onSuggestMouseOut:function(){return e.setState({ignoreBlur:!1})},onSuggestSelect:this.selectSuggest.bind(this)}))}}]),t}(f["default"].Component);O.defaultProps=h["default"],n["default"]=O,t.exports=n["default"]},{"./defaults":3,"./filter-input-attributes":4,"./input":5,"./suggest-list":7,classnames:1}],3:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]={fixtures:[],initialValue:"",placeholder:"Search places",disabled:!1,className:"",inputClassName:"",location:null,radius:null,bounds:null,country:null,types:null,googleMaps:null,onSuggestSelect:function(){},onFocus:function(){},onBlur:function(){},onChange:function(){},skipSuggest:function(){},getSuggestLabel:function(e){return e.description},autoActivateFirstSuggest:!1},t.exports=n["default"]},{}],4:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var s=["autoComplete","autoFocus","disabled","form","formAction","formEncType","formMethod","formNoValidate","formTarget","height","id","inputMode","maxLength","name","pattern","placeholder","readOnly","required","size","spellCheck","tabIndex"];n["default"]=function(e){var t={};return s.forEach(function(n){e[n]&&(t[n]=e[n])}),t},t.exports=n["default"]},{}],5:[function(e,t,n){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}return function(t,n,s){return n&&e(t.prototype,n),s&&e(t,s),t}}(),a=function(e,t,n){for(var s=!0;s;){var o=e,u=t,i=n;s=!1,null===o&&(o=Function.prototype);var r=Object.getOwnPropertyDescriptor(o,u);if(void 0!==r){if("value"in r)return r.value;var a=r.get;return void 0===a?void 0:a.call(i)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=u,n=i,s=!0,r=l=void 0}},l=window.React,c=s(l),f=e("classnames"),p=s(f),g=e("./filter-input-attributes"),d=s(g),h=function(e){function t(){o(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return u(t,e),r(t,[{key:"onChange",value:function(){this.props.onChange(this.refs.input.value)}},{key:"onInputKeyDown",value:function(e){switch(e.which){case 40:e.preventDefault(),this.props.onNext();break;case 38:e.preventDefault(),this.props.onPrev();break;case 13:e.preventDefault(),this.props.onSelect();break;case 9:this.props.onSelect();break;case 27:this.props.onEscape()}}},{key:"focus",value:function(){this.refs.input.focus()}},{key:"render",value:function(){var e=d["default"](this.props),t=p["default"]("geosuggest__input",this.props.className);return c["default"].createElement("input",i({className:t,ref:"input",type:"text"},e,{value:this.props.value,onKeyDown:this.onInputKeyDown.bind(this),onChange:this.onChange.bind(this),onFocus:this.props.onFocus.bind(this),onBlur:this.props.onBlur.bind(this)}))}}]),t}(c["default"].Component);h.defaultProps={className:"",value:"",onChange:function(){},onFocus:function(){},onBlur:function(){},onNext:function(){},onPrev:function(){},onSelect:function(){},onEscape:function(){}},n["default"]=h,t.exports=n["default"]},{"./filter-input-attributes":4,classnames:1}],6:[function(e,t,n){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var o=window.React,u=s(o),i=e("classnames"),r=s(i);n["default"]=function(e){var t=e.isActive,n=void 0===t?!1:t,s=e.className,o=void 0===s?"":s,i=e.suggest,a=void 0===i?{}:i,l=e.onMouseDown,c=void 0===l?function(){}:l,f=e.onMouseOut,p=void 0===f?function(){}:f,g=e.onSelect,d=void 0===g?function(){}:g,h=r["default"]("geosuggest-item",o,{"geosuggest-item--active":n});return u["default"].createElement("li",{className:h,onMouseDown:c,onMouseOut:p,onClick:function(e){e.preventDefault(),d()}},a.label)},t.exports=n["default"]},{classnames:1}],7:[function(e,t,n){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var o=window.React,u=s(o),i=e("classnames"),r=s(i),a=e("./suggest-item"),l=s(a);n["default"]=function(e){var t=e.isHidden,n=void 0===t?!0:t,s=e.suggests,o=void 0===s?[]:s,i=e.activeSuggest,a=e.onSuggestMouseDown,c=void 0===a?function(){}:a,f=e.onSuggestMouseOut,p=void 0===f?function(){}:f,g=e.onSuggestSelect,d=void 0===g?function(){}:g,h=r["default"]("geosuggest__suggests",{"geosuggest__suggests--hidden":n});return u["default"].createElement("ul",{className:h},o.map(function(e){var t=i&&e.placeId===i.placeId;return u["default"].createElement(l["default"],{key:e.placeId,suggest:e,isActive:t,onMouseDown:c,onMouseOut:p,onSelect:function(){return d(e)}})}))},t.exports=n["default"]},{"./suggest-item":6,classnames:1}]},{},[2])(2)});

@@ -9,3 +9,3 @@ /**

});
var allowedAttributes = ['autocapitalize', 'autocomplete', 'autocorrect', 'autoFocus', 'autosave', 'disabled', 'form', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'height', 'id', 'inputmode', 'maxlength', 'maxlength', 'name', 'pattern', 'placeholder', 'readonly', 'required', 'selectionDirection', 'size', 'spellcheck', 'tabindex'];
var allowedAttributes = ['autoComplete', 'autoFocus', 'disabled', 'form', 'formAction', 'formEncType', 'formMethod', 'formNoValidate', 'formTarget', 'height', 'id', 'inputMode', 'maxLength', 'name', 'pattern', 'placeholder', 'readOnly', 'required', 'size', 'spellCheck', 'tabIndex'];

@@ -12,0 +12,0 @@ /**

{
"name": "react-geosuggest",
"version": "1.18.0",
"version": "1.18.1",
"description": "A React autosuggest for the Google Maps Places API.",

@@ -19,2 +19,5 @@ "main": "module/Geosuggest.js",

},
"dependencies": {
"classnames": "^2.2.3"
},
"devDependencies": {

@@ -28,3 +31,2 @@ "babel": "^5.6.23",

"chai": "^3.5.0",
"classnames": "^2.2.3",
"conventional-changelog-generator": "0.0.3",

@@ -31,0 +33,0 @@ "eslint": "^1.5.1",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc