A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://unpkg.com/react-autocomplete@1.8.1/dist/react-autocomplete.min.js below:

!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(l,s){if(!r[l]){if(!n[l]){var a="function"==typeof e&&e;if(!s&&a)return a(l,!0);if(u)return u(l,!0);var c=new Error("Cannot find module '"+l+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[l]={exports:{}};n[l][0].call(f.exports,function(e){var t=n[l][1][e];return i(t||e)},f,f.exports,t,n,r,o)}return r[l].exports}for(var u="function"==typeof e&&e,l=0;l =this.getFilteredItems(t).length)return{highlightedIndex:null}}},{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.setIgnoreBlur(!1),this.setState({isOpen:!1,highlightedIndex:null},function(){t.props.onSelect(n,e)})}},{key:"setIgnoreBlur",value:function(e){this._ignoreBlur=e}},{key:"renderMenu",value:function(){var e=this,t=this.getFilteredItems(this.props).map(function(t,n){var r=e.props.renderItem(t,e.state.highlightedIndex===n,{cursor:"default"});return a.cloneElement(r,{onMouseEnter:e.props.isItemSelectable(t)?function(){return e.highlightItemFromMouse(n)}:null,onClick:e.props.isItemSelectable(t)?function(){return e.selectItemFromMouse(t)}:null,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 a.cloneElement(r,{ref:function(t){return e.refs.menu=t},onTouchStart:function(){return e.setIgnoreBlur(!0)},onMouseEnter:function(){return e.setIgnoreBlur(!0)},onMouseLeave:function(){return e.setIgnoreBlur(!1)}})}},{key:"handleInputBlur",value:function(e){var t=this;if(this._ignoreBlur)return this._ignoreFocus=!0,this._scrollOffset=u(),void this.refs.input.focus();var n=void 0,r=this.state.highlightedIndex;if(this.props.selectOnBlur&&null!==r){var o=this.getFilteredItems(this.props),i=o[r],l=this.props.getItemValue(i);n=function(){return t.props.onSelect(l,i)}}this.setState({isOpen:!1,highlightedIndex:null},n);var s=this.props.inputProps.onBlur;s&&s(e)}},{key:"handleInputFocus",value:function(e){var t=this;if(this._ignoreFocus){this._ignoreFocus=!1;var n=this._scrollOffset,r=n.x,o=n.y;return this._scrollOffset=null,window.scrollTo(r,o),clearTimeout(this._scrollTimer),void(this._scrollTimer=setTimeout(function(){t._scrollTimer=null,window.scrollTo(r,o)},0))}this.setState({isOpen:!0});var i=this.props.inputProps.onFocus;i&&i(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&&this._debugStates.push({id:this._debugStates.length,state:this.state});var e=this.props.inputProps,t=this.isOpen();return a.createElement("div",l({style:l({},this.props.wrapperStyle)},this.props.wrapperProps),this.props.renderInput(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),onClick:this.composeEventHandlers(this.handleInputClick,e.onClick),value:this.props.value})),t&&this.renderMenu(),this.props.debug&&a.createElement("pre",{style:{marginLeft:300}},JSON.stringify(this._debugStates.slice(Math.max(0,this._debugStates.length-5),this._debugStates.length),null,2)))}}]),t}(a.Component);g.propTypes={items:c.array.isRequired,value:c.any,onChange:c.func,onSelect:c.func,shouldItemRender:c.func,isItemSelectable:c.func,sortItems:c.func,getItemValue:c.func.isRequired,renderItem:c.func.isRequired,renderMenu:c.func,menuStyle:c.object,renderInput:c.func,inputProps:c.object,wrapperProps:c.object,wrapperStyle:c.object,autoHighlight:c.bool,selectOnBlur:c.bool,onMenuVisibilityChange:c.func,open:c.bool,debug:c.bool},g.defaultProps={value:"",wrapperProps:{},wrapperStyle:{display:"inline-block"},inputProps:{},renderInput:function(e){return a.createElement("input",e)},onChange:function(){},onSelect:function(){},isItemSelectable:function(){return!0},renderMenu:function(e,t,n){return a.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,selectOnBlur:!1,onMenuVisibilityChange:function(){}},g.keyDownHandlers={ArrowDown:function(e){e.preventDefault();var t=this.getFilteredItems(this.props);if(t.length){for(var n=this.state.highlightedIndex,r=null===n?-1:n,o=0;o -1&&r!==n&&this.setState({highlightedIndex:r,isOpen:!0})}},ArrowUp:function(e){e.preventDefault();var t=this.getFilteredItems(this.props);if(t.length){for(var n=this.state.highlightedIndex,r=null===n?t.length:n,o=0;o 0?!0===u?o.scrollTop(t,f.top+p.top):!1===u?o.scrollTop(t,f.top+h.top):p.top<0?o.scrollTop(t,f.top+p.top):o.scrollTop(t,f.top+h.top):i||(u=void 0===u||!!u,u?o.scrollTop(t,f.top+p.top):o.scrollTop(t,f.top+h.top)),r&&(p.left<0||h.left>0?!0===l?o.scrollLeft(t,f.left+p.left):!1===l?o.scrollLeft(t,f.left+h.left):p.left<0?o.scrollLeft(t,f.left+p.left):o.scrollLeft(t,f.left+h.left):i||(l=void 0===l||!!l,l?o.scrollLeft(t,f.left+p.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 l(e){var t=r(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=i(o),t.top+=u(o),t}function s(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[S]&&e[S][t];if(x.test(n)&&!T.test(t)){var r=e.style,o=r[k],i=e[O][k];e[O][k]=e[S][k],r[k]="fontSize"===t?"1em":n||0,n=r.pixelLeft+R,r[k]=o,e[O][k]=i}return""===n?"auto":n}function c(e,t){"static"===y(e,"position")&&(e.style.position="relative");var n,r,o=l(e),i={};for(r in t)n=parseFloat(y(e,r))||0,i[r]=n+t[r]-o[r];y(e,i)}function f(e,t){for(var n=0;n

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4