react-autocomplete
Advanced tools
Comparing version 1.5.5 to 1.5.6
@@ -7,2 +7,6 @@ # CHANGELOG | ||
## [1.5.6] - 2017-06-01 | ||
### Fixed | ||
- Include prop-types in UMD build, fixes an unintentional breaking change introduced in 1.5.5 | ||
## [1.5.5] - 2017-05-29 | ||
@@ -184,3 +188,4 @@ ### Fixed | ||
[Unreleased]: https://github.com/reactjs/react-autocomplete/compare/v1.5.5...HEAD | ||
[Unreleased]: https://github.com/reactjs/react-autocomplete/compare/v1.5.6...HEAD | ||
[1.5.6]: https://github.com/reactjs/react-autocomplete/compare/v1.5.5...v1.5.6 | ||
[1.5.5]: https://github.com/reactjs/react-autocomplete/compare/v1.5.4...v1.5.5 | ||
@@ -187,0 +192,0 @@ [1.5.4]: https://github.com/reactjs/react-autocomplete/compare/v1.5.3...v1.5.4 |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("react-dom"),require("prop-types")):"function"==typeof define&&define.amd?define(["react","react-dom","prop-types"],t):e.ReactAutocomplete=t(e.React,e.ReactDOM,e.PropTypes)}(this,function(e,t,n){return function(e){return function t(n,o,i){function r(s,u){if(!o[s]){if(!n[s]){var p="function"==typeof e&&e;if(!u&&p)return p(s,!0);if(l)return l(s,!0);var a=new Error("Cannot find module '"+s+"'");throw a.code="MODULE_NOT_FOUND",a}var f=o[s]={exports:{}};n[s][0].call(f.exports,function(e){var t=n[s][1][e];return r(t||e)},f,f.exports,t,n,o,i)}return o[s].exports}for(var l="function"==typeof e&&e,s=0;s<i.length;s++)r(i[s]);return r}({1:[function(e,t,n){(function(n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(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)}var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u=e("react"),p=e("prop-types"),a=e("react-dom"),f=a.findDOMNode,h=e("dom-scroll-into-view"),c=[],d=["blur","checkValidity","click","focus","select","setCustomValidity","setSelectionRange","setRangeText"],m=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={isOpen:!1,highlightedIndex:null},n.exposeAPI=n.exposeAPI.bind(n),n.handleInputFocus=n.handleInputFocus.bind(n),n.handleInputBlur=n.handleInputBlur.bind(n),n.handleChange=n.handleChange.bind(n),n.handleKeyDown=n.handleKeyDown.bind(n),n.handleKeyUp=n.handleKeyUp.bind(n),n.handleInputClick=n.handleInputClick.bind(n),n}return r(t,e),s(t,[{key:"componentWillMount",value:function(){this.refs={},this._ignoreBlur=!1,this._performAutoCompleteOnUpdate=!1,this._performAutoCompleteOnKeyUp=!1}},{key:"componentWillReceiveProps",value:function(e){this._performAutoCompleteOnUpdate=!0,(this.props.items!==e.items||this.state.highlightedIndex>=e.items.length)&&this.setState({highlightedIndex:null})}},{key:"componentDidMount",value:function(){this.isOpen()&&this.setMenuPositions()}},{key:"componentDidUpdate",value:function(e,t){(this.state.isOpen&&!t.isOpen||"open"in this.props&&this.props.open&&!e.open)&&this.setMenuPositions(),this.isOpen()&&this._performAutoCompleteOnUpdate&&(this._performAutoCompleteOnUpdate=!1,this.maybeAutoCompleteText()),this.maybeScrollItemIntoView(),t.isOpen!==this.state.isOpen&&this.props.onMenuVisibilityChange(this.state.isOpen),this._ignoreBlur&&this.refs.input.focus()}},{key:"exposeAPI",value:function(e){var t=this;this.refs.input=e,d.forEach(function(n){return t[n]=e&&e[n]&&e[n].bind(e)})}},{key:"maybeScrollItemIntoView",value:function(){if(this.isOpen()&&null!==this.state.highlightedIndex){var e=this.refs["item-"+this.state.highlightedIndex],t=this.refs.menu;e&&h(f(e),f(t),{onlyScrollIfNeeded:!0})}}},{key:"handleKeyDown",value:function(e){t.keyDownHandlers[e.key]?t.keyDownHandlers[e.key].call(this,e):this.isOpen()||this.setState({isOpen:!0})}},{key:"handleChange",value:function(e){this._performAutoCompleteOnKeyUp=!0,this.setState({highlightedIndex:null}),this.props.onChange(e,e.target.value)}},{key:"handleKeyUp",value:function(){this._performAutoCompleteOnKeyUp&&(this._performAutoCompleteOnKeyUp=!1,this.maybeAutoCompleteText())}},{key:"getFilteredItems",value:function(){var e=this,t=this.props.items;return this.props.shouldItemRender&&(t=t.filter(function(t){return e.props.shouldItemRender(t,e.props.value)})),this.props.sortItems&&t.sort(function(t,n){return e.props.sortItems(t,n,e.props.value)}),t}},{key:"maybeAutoCompleteText",value:function(){if(this.props.autoHighlight&&""!==this.props.value){var e=this.state.highlightedIndex,t=this.getFilteredItems();if(0!==t.length){var n=null!==e?t[e]:t[0];0===this.props.getItemValue(n).toLowerCase().indexOf(this.props.value.toLowerCase())&&null===e&&this.setState({highlightedIndex:0})}}}},{key:"setMenuPositions",value:function(){var e=this.refs.input,t=e.getBoundingClientRect(),o=n.window.getComputedStyle(e),i=parseInt(o.marginBottom,10)||0,r=parseInt(o.marginLeft,10)||0,l=parseInt(o.marginRight,10)||0;this.setState({menuTop:t.bottom+i,menuLeft:t.left+r,menuWidth:t.width+r+l})}},{key:"highlightItemFromMouse",value:function(e){this.setState({highlightedIndex:e})}},{key:"selectItemFromMouse",value:function(e){var t=this,n=this.props.getItemValue(e);this.setState({isOpen:!1,highlightedIndex:null},function(){t.setIgnoreBlur(!1),t.props.onSelect(n,e)})}},{key:"setIgnoreBlur",value:function(e){this._ignoreBlur=e}},{key:"renderMenu",value:function(){var e=this,t=this.getFilteredItems().map(function(t,n){var o=e.props.renderItem(t,e.state.highlightedIndex===n,{cursor:"default"});return u.cloneElement(o,{onMouseEnter:function(){return e.highlightItemFromMouse(n)},onClick:function(){return e.selectItemFromMouse(t)},ref:function(t){return e.refs["item-"+n]=t}})}),n={left:this.state.menuLeft,top:this.state.menuTop,minWidth:this.state.menuWidth},o=this.props.renderMenu(t,this.props.value,n);return u.cloneElement(o,{ref:function(t){return e.refs.menu=t},onMouseEnter:function(){return e.setIgnoreBlur(!0)},onMouseLeave:function(){return e.setIgnoreBlur(!1)}})}},{key:"handleInputBlur",value:function(e){if(!this._ignoreBlur){this.setState({isOpen:!1,highlightedIndex:null});var t=this.props.inputProps.onBlur;t&&t(e)}}},{key:"handleInputFocus",value:function(e){if(!this._ignoreBlur){this.setState({isOpen:!0});var t=this.props.inputProps.onFocus;t&&t(e)}}},{key:"isInputFocused",value:function(){var e=this.refs.input;return e.ownerDocument&&e===e.ownerDocument.activeElement}},{key:"handleInputClick",value:function(){this.isInputFocused()&&!this.isOpen()&&this.setState({isOpen:!0})}},{key:"composeEventHandlers",value:function(e,t){return t?function(n){e(n),t(n)}:e}},{key:"isOpen",value:function(){return"open"in this.props?this.props.open:this.state.isOpen}},{key:"render",value:function(){this.props.debug&&c.push({id:c.length,state:this.state});var e=this.props.inputProps,t=this.isOpen();return u.createElement("div",l({style:l({},this.props.wrapperStyle)},this.props.wrapperProps),u.createElement("input",l({},e,{role:"combobox","aria-autocomplete":"list","aria-expanded":t,autoComplete:"off",ref:this.exposeAPI,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,onChange:this.handleChange,onKeyDown:this.composeEventHandlers(this.handleKeyDown,e.onKeyDown),onKeyUp:this.composeEventHandlers(this.handleKeyUp,e.onKeyUp),onClick:this.composeEventHandlers(this.handleInputClick,e.onClick),value:this.props.value})),t&&this.renderMenu(),this.props.debug&&u.createElement("pre",{style:{marginLeft:300}},JSON.stringify(c.slice(c.length-5,c.length),null,2)))}}]),t}(u.Component);m.propTypes={items:p.array.isRequired,value:p.any,onChange:p.func,onSelect:p.func,shouldItemRender:p.func,sortItems:p.func,getItemValue:p.func.isRequired,renderItem:p.func.isRequired,renderMenu:p.func,menuStyle:p.object,inputProps:p.object,wrapperProps:p.object,wrapperStyle:p.object,autoHighlight:p.bool,onMenuVisibilityChange:p.func,open:p.bool,debug:p.bool},m.defaultProps={value:"",wrapperProps:{},wrapperStyle:{display:"inline-block"},inputProps:{},onChange:function(){},onSelect:function(){},renderMenu:function(e,t,n){return u.createElement("div",{style:l({},n,this.menuStyle),children:e})},menuStyle:{borderRadius:"3px",boxShadow:"0 2px 12px rgba(0, 0, 0, 0.1)",background:"rgba(255, 255, 255, 0.9)",padding:"2px 0",fontSize:"90%",position:"fixed",overflow:"auto",maxHeight:"50%"},autoHighlight:!0,onMenuVisibilityChange:function(){}},m.keyDownHandlers={ArrowDown:function(e){e.preventDefault();var t=this.getFilteredItems().length;if(t){var n=this.state.highlightedIndex,o=null===n||n===t-1?0:n+1;this._performAutoCompleteOnKeyUp=!0,this.setState({highlightedIndex:o,isOpen:!0})}},ArrowUp:function(e){e.preventDefault();var t=this.getFilteredItems().length;if(t){var n=this.state.highlightedIndex,o=0===n||null===n?t-1:n-1;this._performAutoCompleteOnKeyUp=!0,this.setState({highlightedIndex:o,isOpen:!0})}},Enter:function(e){var t=this;if(this.isOpen())if(null==this.state.highlightedIndex)this.setState({isOpen:!1},function(){t.refs.input.select()});else{e.preventDefault();var n=this.getFilteredItems()[this.state.highlightedIndex],o=this.props.getItemValue(n);this.setState({isOpen:!1,highlightedIndex:null},function(){t.refs.input.setSelectionRange(o.length,o.length),t.props.onSelect(o,n)})}},Escape:function(){this.setIgnoreBlur(!1),this.setState({highlightedIndex:null,isOpen:!1})},Tab:function(){this.setIgnoreBlur(!1)}},t.exports=m}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"dom-scroll-into-view":2,"prop-types":"prop-types",react:"react","react-dom":"react-dom"}],2:[function(e,t,n){t.exports=e("./lib/dom-scroll-into-view")},{"./lib/dom-scroll-into-view":3}],3:[function(e,t,n){function o(e,t,n){n=n||{},9===t.nodeType&&(t=i.getWindow(t));var o=n.allowHorizontalScroll,r=n.onlyScrollIfNeeded,l=n.alignWithTop,s=n.alignWithLeft;o=void 0===o||o;var u,p,a,f,h,c,d,m,g,v,y=i.isWindow(t),w=i.offset(e),b=i.outerHeight(e),I=i.outerWidth(e);y?(d=t,v=i.height(d),g=i.width(d),m={left:i.scrollLeft(d),top:i.scrollTop(d)},h={left:w.left-m.left,top:w.top-m.top},c={left:w.left+I-(m.left+g),top:w.top+b-(m.top+v)},f=m):(u=i.offset(t),p=t.clientHeight,a=t.clientWidth,f={left:t.scrollLeft,top:t.scrollTop},h={left:w.left-(u.left+(parseFloat(i.css(t,"borderLeftWidth"))||0)),top:w.top-(u.top+(parseFloat(i.css(t,"borderTopWidth"))||0))},c={left:w.left+I-(u.left+a+(parseFloat(i.css(t,"borderRightWidth"))||0)),top:w.top+b-(u.top+p+(parseFloat(i.css(t,"borderBottomWidth"))||0))}),h.top<0||c.top>0?!0===l?i.scrollTop(t,f.top+h.top):!1===l?i.scrollTop(t,f.top+c.top):h.top<0?i.scrollTop(t,f.top+h.top):i.scrollTop(t,f.top+c.top):r||(l=void 0===l||!!l,l?i.scrollTop(t,f.top+h.top):i.scrollTop(t,f.top+c.top)),o&&(h.left<0||c.left>0?!0===s?i.scrollLeft(t,f.left+h.left):!1===s?i.scrollLeft(t,f.left+c.left):h.left<0?i.scrollLeft(t,f.left+h.left):i.scrollLeft(t,f.left+c.left):r||(s=void 0===s||!!s,s?i.scrollLeft(t,f.left+h.left):i.scrollLeft(t,f.left+c.left)))}var i=e("./util");t.exports=o},{"./util":4}],4:[function(e,t,n){function o(e){var t,n,o,i=e.ownerDocument,r=i.body,l=i&&i.documentElement;return t=e.getBoundingClientRect(),n=t.left,o=t.top,n-=l.clientLeft||r.clientLeft||0,o-=l.clientTop||r.clientTop||0,{left:n,top:o}}function i(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],o="scroll"+(t?"Top":"Left");if("number"!=typeof n){var i=e.document;n=i.documentElement[o],"number"!=typeof n&&(n=i.body[o])}return n}function r(e){return i(e)}function l(e){return i(e,!0)}function s(e){var t=o(e),n=e.ownerDocument,i=n.defaultView||n.parentWindow;return t.left+=r(i),t.top+=l(i),t}function u(e,t,n){var o="",i=e.ownerDocument;return(n=n||i.defaultView.getComputedStyle(e,null))&&(o=n.getPropertyValue(t)||n[t]),o}function p(e,t){var n=e[C]&&e[C][t];if(x.test(n)&&!O.test(t)){var o=e.style,i=o[k],r=e[S][k];e[S][k]=e[C][k],o[k]="fontSize"===t?"1em":n||0,n=o.pixelLeft+T,o[k]=i,e[S][k]=r}return""===n?"auto":n}function a(e,t){"static"===y(e,"position")&&(e.style.position="relative");var n,o,i=s(e),r={};for(o in t)n=parseFloat(y(e,o))||0,r[o]=n+t[o]-i[o];y(e,r)}function f(e,t){for(var n=0;n<e.length;n++)t(e[n])}function h(e){return"border-box"===b(e,"boxSizing")}function c(e,t,n){var o,i={},r=e.style;for(o in t)i[o]=r[o],r[o]=t[o];n.call(e);for(o in t)r[o]=i[o]}function d(e,t,n){var o,i,r,l=0;for(i=0;i<t.length;i++)if(o=t[i])for(r=0;r<n.length;r++){var s;s="border"===o?o+n[r]+"Width":o+n[r],l+=parseFloat(b(e,s))||0}return l}function m(e){return null!=e&&e==e.window}function g(e,t,n){if(m(e))return"width"===t?_.viewportWidth(e):_.viewportHeight(e);if(9===e.nodeType)return"width"===t?_.docWidth(e):_.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],i="width"===t?e.offsetWidth:e.offsetHeight,r=b(e),l=h(e,r),s=0;(null==i||i<=0)&&(i=void 0,s=b(e,t),(null==s||Number(s)<0)&&(s=e.style[t]||0),s=parseFloat(s)||0),void 0===n&&(n=l?F:L);var u=void 0!==i||l,p=i||s;return n===L?u?p-d(e,["border","padding"],o,r):s:u?p+(n===F?0:n===D?-d(e,["border"],o,r):d(e,["margin"],o,r)):s+d(e,E.slice(n),o,r)}function v(e){var t,n=arguments;return 0!==e.offsetWidth?t=g.apply(void 0,n):c(e,M,function(){t=g.apply(void 0,n)}),t}function y(e,t,n){if("object"!=typeof t){if(void 0===n)return b(e,t);"number"==typeof n&&(n+="px"),e.style[t]=n}else for(var o in t)y(e,o,t[o])}function w(e,t){for(var n in t)e[n]=t[n];return e}var b,I=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,x=new RegExp("^("+I+")(?!px)[a-z%]+$","i"),O=/^(top|right|bottom|left)$/,C="currentStyle",S="runtimeStyle",k="left",T="px";"undefined"!=typeof window&&(b=window.getComputedStyle?u:p);var E=["margin","border","padding"],L=-1,D=2,F=1,_={};f(["Width","Height"],function(e){_["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],_["viewport"+e](n))},_["viewport"+e]=function(t){var n="client"+e,o=t.document,i=o.body,r=o.documentElement,l=r[n];return"CSS1Compat"===o.compatMode&&l||i&&i[n]||l}});var M={position:"absolute",visibility:"hidden",display:"block"};f(["width","height"],function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);_["outer"+t]=function(t,n){return t&&v(t,e,n?0:F)};var n="width"===e?["Left","Right"]:["Top","Bottom"];_[e]=function(t,o){if(void 0===o)return t&&v(t,e,L);if(t){var i=b(t);return h(t)&&(o+=d(t,["padding","border"],n,i)),y(t,e,o)}}});var W=t.exports={getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return s(e);a(e,t)},isWindow:m,each:f,css:y,clone:function(e){var t={};for(var n in e)t[n]=e[n];if(e.overflow)for(n in e)t.overflow[n]=e.overflow[n];return t},mix:w,scrollLeft:function(e,t){if(m(e)){if(void 0===t)return r(e);window.scrollTo(t,l(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(m(e)){if(void 0===t)return l(e);window.scrollTo(r(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},merge:function(){for(var e={},t=0;t<arguments.length;t++)W.mix(e,arguments[t]);return e},viewportWidth:0,viewportHeight:0};w(W,_)},{}]},{},[1])(1)}(function(o){if("react"===o)return e;if("react-dom"===o)return t;if("prop-types"===o)return n;if("undefined"!=typeof require)return require(o);var i=new Error("Cannot find module '"+o+"'");throw i.code="MODULE_NOT_FOUND",i})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):e.ReactAutocomplete=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){return function t(n,r,o){function i(s,l){if(!r[s]){if(!n[s]){var a="function"==typeof e&&e;if(!l&&a)return a(s,!0);if(u)return u(s,!0);var p=new Error("Cannot find module '"+s+"'");throw p.code="MODULE_NOT_FOUND",p}var f=r[s]={exports:{}};n[s][0].call(f.exports,function(e){var t=n[s][1][e];return i(t||e)},f,f.exports,t,n,r,o)}return r[s].exports}for(var u="function"==typeof e&&e,s=0;s<o.length;s++)i(o[s]);return i}({1:[function(e,t,n){(function(n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(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)}var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=e("react"),a=e("prop-types"),p=e("react-dom"),f=p.findDOMNode,c=e("dom-scroll-into-view"),h=[],d=["blur","checkValidity","click","focus","select","setCustomValidity","setSelectionRange","setRangeText"],y=function(e){function t(e){r(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={isOpen:!1,highlightedIndex:null},n.exposeAPI=n.exposeAPI.bind(n),n.handleInputFocus=n.handleInputFocus.bind(n),n.handleInputBlur=n.handleInputBlur.bind(n),n.handleChange=n.handleChange.bind(n),n.handleKeyDown=n.handleKeyDown.bind(n),n.handleKeyUp=n.handleKeyUp.bind(n),n.handleInputClick=n.handleInputClick.bind(n),n}return i(t,e),s(t,[{key:"componentWillMount",value:function(){this.refs={},this._ignoreBlur=!1,this._performAutoCompleteOnUpdate=!1,this._performAutoCompleteOnKeyUp=!1}},{key:"componentWillReceiveProps",value:function(e){this._performAutoCompleteOnUpdate=!0,(this.props.items!==e.items||this.state.highlightedIndex>=e.items.length)&&this.setState({highlightedIndex:null})}},{key:"componentDidMount",value:function(){this.isOpen()&&this.setMenuPositions()}},{key:"componentDidUpdate",value:function(e,t){(this.state.isOpen&&!t.isOpen||"open"in this.props&&this.props.open&&!e.open)&&this.setMenuPositions(),this.isOpen()&&this._performAutoCompleteOnUpdate&&(this._performAutoCompleteOnUpdate=!1,this.maybeAutoCompleteText()),this.maybeScrollItemIntoView(),t.isOpen!==this.state.isOpen&&this.props.onMenuVisibilityChange(this.state.isOpen),this._ignoreBlur&&this.refs.input.focus()}},{key:"exposeAPI",value:function(e){var t=this;this.refs.input=e,d.forEach(function(n){return t[n]=e&&e[n]&&e[n].bind(e)})}},{key:"maybeScrollItemIntoView",value:function(){if(this.isOpen()&&null!==this.state.highlightedIndex){var e=this.refs["item-"+this.state.highlightedIndex],t=this.refs.menu;e&&c(f(e),f(t),{onlyScrollIfNeeded:!0})}}},{key:"handleKeyDown",value:function(e){t.keyDownHandlers[e.key]?t.keyDownHandlers[e.key].call(this,e):this.isOpen()||this.setState({isOpen:!0})}},{key:"handleChange",value:function(e){this._performAutoCompleteOnKeyUp=!0,this.setState({highlightedIndex:null}),this.props.onChange(e,e.target.value)}},{key:"handleKeyUp",value:function(){this._performAutoCompleteOnKeyUp&&(this._performAutoCompleteOnKeyUp=!1,this.maybeAutoCompleteText())}},{key:"getFilteredItems",value:function(){var e=this,t=this.props.items;return this.props.shouldItemRender&&(t=t.filter(function(t){return e.props.shouldItemRender(t,e.props.value)})),this.props.sortItems&&t.sort(function(t,n){return e.props.sortItems(t,n,e.props.value)}),t}},{key:"maybeAutoCompleteText",value:function(){if(this.props.autoHighlight&&""!==this.props.value){var e=this.state.highlightedIndex,t=this.getFilteredItems();if(0!==t.length){var n=null!==e?t[e]:t[0];0===this.props.getItemValue(n).toLowerCase().indexOf(this.props.value.toLowerCase())&&null===e&&this.setState({highlightedIndex:0})}}}},{key:"setMenuPositions",value:function(){var e=this.refs.input,t=e.getBoundingClientRect(),r=n.window.getComputedStyle(e),o=parseInt(r.marginBottom,10)||0,i=parseInt(r.marginLeft,10)||0,u=parseInt(r.marginRight,10)||0;this.setState({menuTop:t.bottom+o,menuLeft:t.left+i,menuWidth:t.width+i+u})}},{key:"highlightItemFromMouse",value:function(e){this.setState({highlightedIndex:e})}},{key:"selectItemFromMouse",value:function(e){var t=this,n=this.props.getItemValue(e);this.setState({isOpen:!1,highlightedIndex:null},function(){t.setIgnoreBlur(!1),t.props.onSelect(n,e)})}},{key:"setIgnoreBlur",value:function(e){this._ignoreBlur=e}},{key:"renderMenu",value:function(){var e=this,t=this.getFilteredItems().map(function(t,n){var r=e.props.renderItem(t,e.state.highlightedIndex===n,{cursor:"default"});return l.cloneElement(r,{onMouseEnter:function(){return e.highlightItemFromMouse(n)},onClick:function(){return e.selectItemFromMouse(t)},ref:function(t){return e.refs["item-"+n]=t}})}),n={left:this.state.menuLeft,top:this.state.menuTop,minWidth:this.state.menuWidth},r=this.props.renderMenu(t,this.props.value,n);return l.cloneElement(r,{ref:function(t){return e.refs.menu=t},onMouseEnter:function(){return e.setIgnoreBlur(!0)},onMouseLeave:function(){return e.setIgnoreBlur(!1)}})}},{key:"handleInputBlur",value:function(e){if(!this._ignoreBlur){this.setState({isOpen:!1,highlightedIndex:null});var t=this.props.inputProps.onBlur;t&&t(e)}}},{key:"handleInputFocus",value:function(e){if(!this._ignoreBlur){this.setState({isOpen:!0});var t=this.props.inputProps.onFocus;t&&t(e)}}},{key:"isInputFocused",value:function(){var e=this.refs.input;return e.ownerDocument&&e===e.ownerDocument.activeElement}},{key:"handleInputClick",value:function(){this.isInputFocused()&&!this.isOpen()&&this.setState({isOpen:!0})}},{key:"composeEventHandlers",value:function(e,t){return t?function(n){e(n),t(n)}:e}},{key:"isOpen",value:function(){return"open"in this.props?this.props.open:this.state.isOpen}},{key:"render",value:function(){this.props.debug&&h.push({id:h.length,state:this.state});var e=this.props.inputProps,t=this.isOpen();return l.createElement("div",u({style:u({},this.props.wrapperStyle)},this.props.wrapperProps),l.createElement("input",u({},e,{role:"combobox","aria-autocomplete":"list","aria-expanded":t,autoComplete:"off",ref:this.exposeAPI,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,onChange:this.handleChange,onKeyDown:this.composeEventHandlers(this.handleKeyDown,e.onKeyDown),onKeyUp:this.composeEventHandlers(this.handleKeyUp,e.onKeyUp),onClick:this.composeEventHandlers(this.handleInputClick,e.onClick),value:this.props.value})),t&&this.renderMenu(),this.props.debug&&l.createElement("pre",{style:{marginLeft:300}},JSON.stringify(h.slice(h.length-5,h.length),null,2)))}}]),t}(l.Component);y.propTypes={items:a.array.isRequired,value:a.any,onChange:a.func,onSelect:a.func,shouldItemRender:a.func,sortItems:a.func,getItemValue:a.func.isRequired,renderItem:a.func.isRequired,renderMenu:a.func,menuStyle:a.object,inputProps:a.object,wrapperProps:a.object,wrapperStyle:a.object,autoHighlight:a.bool,onMenuVisibilityChange:a.func,open:a.bool,debug:a.bool},y.defaultProps={value:"",wrapperProps:{},wrapperStyle:{display:"inline-block"},inputProps:{},onChange:function(){},onSelect:function(){},renderMenu:function(e,t,n){return l.createElement("div",{style:u({},n,this.menuStyle),children:e})},menuStyle:{borderRadius:"3px",boxShadow:"0 2px 12px rgba(0, 0, 0, 0.1)",background:"rgba(255, 255, 255, 0.9)",padding:"2px 0",fontSize:"90%",position:"fixed",overflow:"auto",maxHeight:"50%"},autoHighlight:!0,onMenuVisibilityChange:function(){}},y.keyDownHandlers={ArrowDown:function(e){e.preventDefault();var t=this.getFilteredItems().length;if(t){var n=this.state.highlightedIndex,r=null===n||n===t-1?0:n+1;this._performAutoCompleteOnKeyUp=!0,this.setState({highlightedIndex:r,isOpen:!0})}},ArrowUp:function(e){e.preventDefault();var t=this.getFilteredItems().length;if(t){var n=this.state.highlightedIndex,r=0===n||null===n?t-1:n-1;this._performAutoCompleteOnKeyUp=!0,this.setState({highlightedIndex:r,isOpen:!0})}},Enter:function(e){var t=this;if(this.isOpen())if(null==this.state.highlightedIndex)this.setState({isOpen:!1},function(){t.refs.input.select()});else{e.preventDefault();var n=this.getFilteredItems()[this.state.highlightedIndex],r=this.props.getItemValue(n);this.setState({isOpen:!1,highlightedIndex:null},function(){t.refs.input.setSelectionRange(r.length,r.length),t.props.onSelect(r,n)})}},Escape:function(){this.setIgnoreBlur(!1),this.setState({highlightedIndex:null,isOpen:!1})},Tab:function(){this.setIgnoreBlur(!1)}},t.exports=y}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"dom-scroll-into-view":2,"prop-types":11,react:"react","react-dom":"react-dom"}],2:[function(e,t,n){t.exports=e("./lib/dom-scroll-into-view")},{"./lib/dom-scroll-into-view":3}],3:[function(e,t,n){function r(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,i=n.onlyScrollIfNeeded,u=n.alignWithTop,s=n.alignWithLeft;r=void 0===r||r;var l,a,p,f,c,h,d,y,m,v,g=o.isWindow(t),b=o.offset(e),w=o.outerHeight(e),I=o.outerWidth(e);g?(d=t,v=o.height(d),m=o.width(d),y={left:o.scrollLeft(d),top:o.scrollTop(d)},c={left:b.left-y.left,top:b.top-y.top},h={left:b.left+I-(y.left+m),top:b.top+w-(y.top+v)},f=y):(l=o.offset(t),a=t.clientHeight,p=t.clientWidth,f={left:t.scrollLeft,top:t.scrollTop},c={left:b.left-(l.left+(parseFloat(o.css(t,"borderLeftWidth"))||0)),top:b.top-(l.top+(parseFloat(o.css(t,"borderTopWidth"))||0))},h={left:b.left+I-(l.left+p+(parseFloat(o.css(t,"borderRightWidth"))||0)),top:b.top+w-(l.top+a+(parseFloat(o.css(t,"borderBottomWidth"))||0))}),c.top<0||h.top>0?!0===u?o.scrollTop(t,f.top+c.top):!1===u?o.scrollTop(t,f.top+h.top):c.top<0?o.scrollTop(t,f.top+c.top):o.scrollTop(t,f.top+h.top):i||(u=void 0===u||!!u,u?o.scrollTop(t,f.top+c.top):o.scrollTop(t,f.top+h.top)),r&&(c.left<0||h.left>0?!0===s?o.scrollLeft(t,f.left+c.left):!1===s?o.scrollLeft(t,f.left+h.left):c.left<0?o.scrollLeft(t,f.left+c.left):o.scrollLeft(t,f.left+h.left):i||(s=void 0===s||!!s,s?o.scrollLeft(t,f.left+c.left):o.scrollLeft(t,f.left+h.left)))}var o=e("./util");t.exports=r},{"./util":4}],4:[function(e,t,n){function r(e){var t,n,r,o=e.ownerDocument,i=o.body,u=o&&o.documentElement;return t=e.getBoundingClientRect(),n=t.left,r=t.top,n-=u.clientLeft||i.clientLeft||0,r-=u.clientTop||i.clientTop||0,{left:n,top:r}}function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],r="scroll"+(t?"Top":"Left");if("number"!=typeof n){var o=e.document;n=o.documentElement[r],"number"!=typeof n&&(n=o.body[r])}return n}function i(e){return o(e)}function u(e){return o(e,!0)}function s(e){var t=r(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=i(o),t.top+=u(o),t}function l(e,t,n){var r="",o=e.ownerDocument;return(n=n||o.defaultView.getComputedStyle(e,null))&&(r=n.getPropertyValue(t)||n[t]),r}function a(e,t){var n=e[T]&&e[T][t];if(x.test(n)&&!O.test(t)){var r=e.style,o=r[k],i=e[S][k];e[S][k]=e[T][k],r[k]="fontSize"===t?"1em":n||0,n=r.pixelLeft+C,r[k]=o,e[S][k]=i}return""===n?"auto":n}function p(e,t){"static"===g(e,"position")&&(e.style.position="relative");var n,r,o=s(e),i={};for(r in t)n=parseFloat(g(e,r))||0,i[r]=n+t[r]-o[r];g(e,i)}function f(e,t){for(var n=0;n<e.length;n++)t(e[n])}function c(e){return"border-box"===w(e,"boxSizing")}function h(e,t,n){var r,o={},i=e.style;for(r in t)o[r]=i[r],i[r]=t[r];n.call(e);for(r in t)i[r]=o[r]}function d(e,t,n){var r,o,i,u=0;for(o=0;o<t.length;o++)if(r=t[o])for(i=0;i<n.length;i++){var s;s="border"===r?r+n[i]+"Width":r+n[i],u+=parseFloat(w(e,s))||0}return u}function y(e){return null!=e&&e==e.window}function m(e,t,n){if(y(e))return"width"===t?_.viewportWidth(e):_.viewportHeight(e);if(9===e.nodeType)return"width"===t?_.docWidth(e):_.docHeight(e);var r="width"===t?["Left","Right"]:["Top","Bottom"],o="width"===t?e.offsetWidth:e.offsetHeight,i=w(e),u=c(e,i),s=0;(null==o||o<=0)&&(o=void 0,s=w(e,t),(null==s||Number(s)<0)&&(s=e.style[t]||0),s=parseFloat(s)||0),void 0===n&&(n=u?j:P);var l=void 0!==o||u,a=o||s;return n===P?l?a-d(e,["border","padding"],r,i):s:l?a+(n===j?0:n===E?-d(e,["border"],r,i):d(e,["margin"],r,i)):s+d(e,R.slice(n),r,i)}function v(e){var t,n=arguments;return 0!==e.offsetWidth?t=m.apply(void 0,n):h(e,F,function(){t=m.apply(void 0,n)}),t}function g(e,t,n){if("object"!=typeof t){if(void 0===n)return w(e,t);"number"==typeof n&&(n+="px"),e.style[t]=n}else for(var r in t)g(e,r,t[r])}function b(e,t){for(var n in t)e[n]=t[n];return e}var w,I=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,x=new RegExp("^("+I+")(?!px)[a-z%]+$","i"),O=/^(top|right|bottom|left)$/,T="currentStyle",S="runtimeStyle",k="left",C="px";"undefined"!=typeof window&&(w=window.getComputedStyle?l:a);var R=["margin","border","padding"],P=-1,E=2,j=1,_={};f(["Width","Height"],function(e){_["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],_["viewport"+e](n))},_["viewport"+e]=function(t){var n="client"+e,r=t.document,o=r.body,i=r.documentElement,u=i[n];return"CSS1Compat"===r.compatMode&&u||o&&o[n]||u}});var F={position:"absolute",visibility:"hidden",display:"block"};f(["width","height"],function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);_["outer"+t]=function(t,n){return t&&v(t,e,n?0:j)};var n="width"===e?["Left","Right"]:["Top","Bottom"];_[e]=function(t,r){if(void 0===r)return t&&v(t,e,P);if(t){var o=w(t);return c(t)&&(r+=d(t,["padding","border"],n,o)),g(t,e,r)}}});var A=t.exports={getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return s(e);p(e,t)},isWindow:y,each:f,css:g,clone:function(e){var t={};for(var n in e)t[n]=e[n];if(e.overflow)for(n in e)t.overflow[n]=e.overflow[n];return t},mix:b,scrollLeft:function(e,t){if(y(e)){if(void 0===t)return i(e);window.scrollTo(t,u(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(y(e)){if(void 0===t)return u(e);window.scrollTo(i(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},merge:function(){for(var e={},t=0;t<arguments.length;t++)A.mix(e,arguments[t]);return e},viewportWidth:0,viewportHeight:0};b(A,_)},{}],5:[function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},t.exports=o},{}],6:[function(e,t,n){"use strict";function r(e,t,n,r,i,u,s,l){if(o(t),!e){var a;if(void 0===t)a=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var p=[n,r,i,u,s,l],f=0;a=new Error(t.replace(/%s/g,function(){return p[f++]})),a.name="Invariant Violation"}throw a.framesToPop=1,a}}var o=function(e){};t.exports=r},{}],7:[function(e,t,n){"use strict";var r=e("./emptyFunction"),o=r;t.exports=o},{"./emptyFunction":5}],8:[function(e,t,n){"use strict";function r(e,t,n,r,o){}t.exports=r},{"./lib/ReactPropTypesSecret":12,"fbjs/lib/invariant":6,"fbjs/lib/warning":7}],9:[function(e,t,n){"use strict";var r=e("fbjs/lib/emptyFunction"),o=e("fbjs/lib/invariant"),i=e("./lib/ReactPropTypesSecret");t.exports=function(){function e(e,t,n,r,u,s){s!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=r,n.PropTypes=n,n}},{"./lib/ReactPropTypesSecret":12,"fbjs/lib/emptyFunction":5,"fbjs/lib/invariant":6}],10:[function(e,t,n){"use strict";var r=e("fbjs/lib/emptyFunction"),o=e("fbjs/lib/invariant"),i=e("fbjs/lib/warning"),u=e("./lib/ReactPropTypesSecret"),s=e("./checkPropTypes");t.exports=function(e,t){function n(e){var t=e&&(T&&e[T]||e[S]);if("function"==typeof t)return t}function l(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function a(e){this.message=e,this.stack=""}function p(e){function n(n,r,i,s,l,p,f){if(s=s||k,p=p||i,f!==u)if(t)o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else;return null==r[i]?n?new a(null===r[i]?"The "+l+" `"+p+"` is marked as required in `"+s+"`, but its value is `null`.":"The "+l+" `"+p+"` is marked as required in `"+s+"`, but its value is `undefined`."):null:e(r,i,s,l,p)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function f(e){function t(t,n,r,o,i,u){var s=t[n];if(w(s)!==e)return new a("Invalid "+o+" `"+i+"` of type `"+I(s)+"` supplied to `"+r+"`, expected `"+e+"`.");return null}return p(t)}function c(e){function t(t,n,r,o,i){if("function"!=typeof e)return new a("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s)){return new a("Invalid "+o+" `"+i+"` of type `"+w(s)+"` supplied to `"+r+"`, expected an array.")}for(var l=0;l<s.length;l++){var p=e(s,l,r,o,i+"["+l+"]",u);if(p instanceof Error)return p}return null}return p(t)}function h(e){function t(t,n,r,o,i){if(!(t[n]instanceof e)){var u=e.name||k;return new a("Invalid "+o+" `"+i+"` of type `"+O(t[n])+"` supplied to `"+r+"`, expected instance of `"+u+"`.")}return null}return p(t)}function d(e){function t(t,n,r,o,i){for(var u=t[n],s=0;s<e.length;s++)if(l(u,e[s]))return null;return new a("Invalid "+o+" `"+i+"` of value `"+u+"` supplied to `"+r+"`, expected one of "+JSON.stringify(e)+".")}return Array.isArray(e)?p(t):r.thatReturnsNull}function y(e){function t(t,n,r,o,i){if("function"!=typeof e)return new a("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var s=t[n],l=w(s);if("object"!==l)return new a("Invalid "+o+" `"+i+"` of type `"+l+"` supplied to `"+r+"`, expected an object.");for(var p in s)if(s.hasOwnProperty(p)){var f=e(s,p,r,o,i+"."+p,u);if(f instanceof Error)return f}return null}return p(t)}function m(e){function t(t,n,r,o,i){for(var s=0;s<e.length;s++){if(null==(0,e[s])(t,n,r,o,i,u))return null}return new a("Invalid "+o+" `"+i+"` supplied to `"+r+"`.")}if(!Array.isArray(e))return r.thatReturnsNull;for(var n=0;n<e.length;n++){var o=e[n];if("function"!=typeof o)return i(!1,"Invalid argument supplid to oneOfType. Expected an array of check functions, but received %s at index %s.",x(o),n),r.thatReturnsNull}return p(t)}function v(e){function t(t,n,r,o,i){var s=t[n],l=w(s);if("object"!==l)return new a("Invalid "+o+" `"+i+"` of type `"+l+"` supplied to `"+r+"`, expected `object`.");for(var p in e){var f=e[p];if(f){var c=f(s,p,r,o,i+"."+p,u);if(c)return c}}return null}return p(t)}function g(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(g);if(null===t||e(t))return!0;var r=n(t);if(!r)return!1;var o,i=r.call(t);if(r!==t.entries){for(;!(o=i.next()).done;)if(!g(o.value))return!1}else for(;!(o=i.next()).done;){var u=o.value;if(u&&!g(u[1]))return!1}return!0;default:return!1}}function b(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function w(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":b(t,e)?"symbol":t}function I(e){if(void 0===e||null===e)return""+e;var t=w(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function x(e){var t=I(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function O(e){return e.constructor&&e.constructor.name?e.constructor.name:k}var T="function"==typeof Symbol&&Symbol.iterator,S="@@iterator",k="<<anonymous>>",C={array:f("array"),bool:f("boolean"),func:f("function"),number:f("number"),object:f("object"),string:f("string"),symbol:f("symbol"),any:function(){return p(r.thatReturnsNull)}(),arrayOf:c,element:function(){function t(t,n,r,o,i){var u=t[n];if(!e(u)){return new a("Invalid "+o+" `"+i+"` of type `"+w(u)+"` supplied to `"+r+"`, expected a single ReactElement.")}return null}return p(t)}(),instanceOf:h,node:function(){function e(e,t,n,r,o){return g(e[t])?null:new a("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}return p(e)}(),objectOf:y,oneOf:d,oneOfType:m,shape:v};return a.prototype=Error.prototype,C.checkPropTypes=s,C.PropTypes=C,C}},{"./checkPropTypes":8,"./lib/ReactPropTypesSecret":12,"fbjs/lib/emptyFunction":5,"fbjs/lib/invariant":6,"fbjs/lib/warning":7}],11:[function(e,t,n){t.exports=e("./factoryWithThrowingShims")()},{"./factoryWithThrowingShims":9,"./factoryWithTypeCheckers":10}],12:[function(e,t,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},{}]},{},[1])(1)}(function(n){if("react"===n)return e;if("react-dom"===n)return t;if("undefined"!=typeof require)return require(n);var r=new Error("Cannot find module '"+n+"'");throw r.code="MODULE_NOT_FOUND",r})}); | ||
//# sourceMappingURL=react-autocomplete.min.js.map |
{ | ||
"name": "react-autocomplete", | ||
"version": "1.5.5", | ||
"version": "1.5.6", | ||
"description": "Accessible, extensible, Autocomplete for React.js", | ||
@@ -5,0 +5,0 @@ "main": "./build/lib/Autocomplete.js", |
@@ -5,2 +5,21 @@ # React Autocomplete [![Travis build status](https://travis-ci.org/reactjs/react-autocomplete.svg?branch=master)](https://travis-ci.org/reactjs/react-autocomplete/) | ||
```jsx | ||
<Autocomplete | ||
getItemValue={(item) => item.label} | ||
items={[ | ||
{ label: 'apple' }, | ||
{ label: 'banana' }, | ||
{ label: 'pear' } | ||
]} | ||
renderItem={(item, isHighlighted) => | ||
<div style={{ background: isHighlighted ? 'lightgray' : 'white' }}> | ||
{item.label} | ||
</div> | ||
} | ||
value={value} | ||
onChange={(e) => value = e.target.value} | ||
onSelect={(val) => value = val} | ||
/> | ||
``` | ||
[Examples](https://reactcommunity.org/react-autocomplete/) | ||
@@ -24,4 +43,4 @@ | ||
* Development: [https://unpkg.com/react-autocomplete@1.5.4/dist/react-autocomplete.js](https://unpkg.com/react-autocomplete@1.5.4/dist/react-autocomplete.js) | ||
* Production: [https://unpkg.com/react-autocomplete@1.5.4/dist/react-autocomplete.min.js](https://unpkg.com/react-autocomplete@1.5.4/dist/react-autocomplete.min.js) | ||
* Development: [https://unpkg.com/react-autocomplete@1.5.5/dist/react-autocomplete.js](https://unpkg.com/react-autocomplete@1.5.5/dist/react-autocomplete.js) | ||
* Production: [https://unpkg.com/react-autocomplete@1.5.5/dist/react-autocomplete.min.js](https://unpkg.com/react-autocomplete@1.5.5/dist/react-autocomplete.min.js) | ||
@@ -28,0 +47,0 @@ ## API |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
299785
2401
246