react-autocomplete-input
Advanced tools
Comparing version 1.0.14 to 1.0.15
@@ -0,1 +1,6 @@ | ||
### 2nd December 2020 - 1.0.15 | ||
- Introduced new `onSelect` callback — (https://github.com/yury-dymov/react-autocomplete-input/pull/53) | ||
- Added `passThroughEnter` prop - to override behavior on `Enter` key press | ||
- Updated deps and dev deps | ||
### 8th July 2020 - 1.0.14 | ||
@@ -2,0 +7,0 @@ - Use PropTypes.elementType to support wrapped components - (https://github.com/yury-dymov/react-autocomplete-input/pull/44) |
@@ -1,1 +0,1 @@ | ||
module.exports=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(){return r=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},r.apply(this,arguments)}function o(e,t){if(null==e)return{};var n,r,o=a(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function a(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){s(e,t,n[t])})}return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(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)}}function p(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e}function f(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?d(e):t}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}Object.defineProperty(t,"__esModule",{value:!0});var v=n(2),y=n.n(v),m=n(3),O=n.n(m),S=n(4),w=n.n(S),C=n(5),x=n.n(C),j=n(6),k=(n.n(j),{Component:O.a.oneOfType([O.a.string,O.a.elementType]),defaultValue:O.a.string,disabled:O.a.bool,maxOptions:O.a.number,onBlur:O.a.func,onChange:O.a.func,onKeyDown:O.a.func,onRequestOptions:O.a.func,options:O.a.arrayOf(O.a.string),regex:O.a.string,matchAny:O.a.bool,minChars:O.a.number,requestOnlyIfNoOptions:O.a.bool,spaceRemovers:O.a.arrayOf(O.a.string),spacer:O.a.string,trigger:O.a.string,value:O.a.string,offsetX:O.a.number,offsetY:O.a.number}),P={Component:"textarea",defaultValue:"",disabled:!1,maxOptions:6,onBlur:function(){},onChange:function(){},onKeyDown:function(){},onRequestOptions:function(){},options:[],regex:"^[A-Za-z0-9\\-_]+$",matchAny:!1,minChars:0,requestOnlyIfNoOptions:!0,spaceRemovers:[",",".","!","?"],spacer:" ",trigger:"@",offsetX:0,offsetY:0,value:null},L=function(e){function t(e){var n;return u(this,t),n=f(this,h(t).call(this,e)),n.isTrigger=n.isTrigger.bind(d(d(n))),n.getMatch=n.getMatch.bind(d(d(n))),n.handleChange=n.handleChange.bind(d(d(n))),n.handleKeyDown=n.handleKeyDown.bind(d(d(n))),n.handleResize=n.handleResize.bind(d(d(n))),n.handleSelection=n.handleSelection.bind(d(d(n))),n.updateCaretPosition=n.updateCaretPosition.bind(d(d(n))),n.updateHelper=n.updateHelper.bind(d(d(n))),n.resetHelper=n.resetHelper.bind(d(d(n))),n.renderAutocompleteList=n.renderAutocompleteList.bind(d(d(n))),n.state={helperVisible:!1,left:0,matchLength:0,matchStart:0,options:[],selection:0,top:0,value:null},n.recentValue=e.defaultValue,n.enableSpaceRemovers=!1,n.refInput=Object(v.createRef)(),n}return g(t,e),p(t,[{key:"componentDidMount",value:function(){window.addEventListener("resize",this.handleResize)}},{key:"componentDidUpdate",value:function(e){var t=this.props.options,n=this.state.caret;t.length!==e.options.length&&this.updateHelper(this.recentValue,n,t)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.handleResize)}},{key:"getMatch",value:function(e,t,n){for(var r=this.props,o=r.trigger,a=r.matchAny,i=r.regex,s=new RegExp(i),u=o.length,c=o.match(s),p=t-1;p>=0;--p){var f=e.substring(p,t),h=f.match(s),g=-1;if(u>0){var b=c?p:p-u+1;if(b<0)return null;if(this.isTrigger(e,b)&&(g=b+u),!h&&g<0)return null}else{if(h&&p>0)continue;if(g=0===p&&h?0:p+1,t-g==0)return null}if(g>=0){var d=function(){var r=e.substring(g,t),o=n.filter(function(e){var t=e.toLowerCase().indexOf(r.toLowerCase());return-1!==t&&(a||0===t)}),i=r.length;return{v:{matchStart:g,matchLength:i,options:o}}}();if("object"===l(d))return d.v}}return null}},{key:"isTrigger",value:function(e,t){var n=this.props.trigger;return!n||!n.length||e.substr(t,n.length)===n}},{key:"handleChange",value:function(e){var t=this.props,n=t.onChange,r=t.options,o=t.spaceRemovers,a=t.spacer,i=t.value,s=this.recentValue,l=e.target.value,u=x()(e.target).end;if(l.length||this.setState({helperVisible:!1}),this.recentValue=l,this.setState({caret:u,value:e.target.value}),!l.length||!u)return n(e.target.value);if(this.enableSpaceRemovers&&o.length&&l.length>2&&a.length){for(var c=0;c<Math.max(s.length,l.length);++c)if(s[c]!==l[c]){if(c>=2&&l[c-1]===a&&-1===o.indexOf(l[c-2])&&-1!==o.indexOf(l[c])&&this.getMatch(l.substring(0,c-2),u-3,r)){var p="".concat(l.slice(0,c-1)).concat(l.slice(c,c+1)).concat(l.slice(c-1,c)).concat(l.slice(c+1));return this.updateCaretPosition(c+1),this.refInput.current.value=p,i||this.setState({value:p}),n(p)}break}this.enableSpaceRemovers=!1}return this.updateHelper(l,u,r),i||this.setState({value:e.target.value}),n(e.target.value)}},{key:"handleKeyDown",value:function(e){var t=this.state,n=t.helperVisible,r=t.options,o=t.selection,a=this.props.onKeyDown;if(n)switch(e.keyCode){case 27:e.preventDefault(),this.resetHelper();break;case 38:e.preventDefault(),this.setState({selection:(r.length+o-1)%r.length});break;case 40:e.preventDefault(),this.setState({selection:(o+1)%r.length});break;case 14:case 13:case 9:e.preventDefault(),this.handleSelection(o);break;default:a(e)}else a(e)}},{key:"handleResize",value:function(){this.setState({helperVisible:!1})}},{key:"handleSelection",value:function(e){var t=this.state,n=t.matchStart,r=t.matchLength,o=t.options,a=this.props.spacer,i=o[e],s=this.recentValue,l=s.substring(0,n),u=s.substring(n+r),c={target:this.refInput.current};c.target.value="".concat(l).concat(i).concat(a).concat(u),this.handleChange(c),this.resetHelper(),this.updateCaretPosition(l.length+i.length+1),this.enableSpaceRemovers=!0}},{key:"updateCaretPosition",value:function(e){var t=this;this.setState({caret:e},function(){return Object(C.setCaretPosition)(t.refInput.current,e)})}},{key:"updateHelper",value:function(e,t,n){var r=this.refInput.current,o=this.getMatch(e,t,n);if(o){var a=w()(r,t),s=r.getBoundingClientRect(),l=a.top+r.offsetTop,u=Math.min(a.left+r.offsetLeft-10,r.offsetLeft+s.width-100),c=this.props,p=c.minChars,f=c.onRequestOptions,h=c.requestOnlyIfNoOptions;o.matchLength>=p&&(o.options.length>1||1===o.options.length&&o.options[0].length!==o.matchLength)?this.setState(i({helperVisible:!0,top:l,left:u},o)):(h&&o.options.length||f(e.substr(o.matchStart,o.matchLength)),this.resetHelper())}else this.resetHelper()}},{key:"resetHelper",value:function(){this.setState({helperVisible:!1,selection:0})}},{key:"renderAutocompleteList",value:function(){var e=this,t=this.state,n=t.helperVisible,r=t.left,o=t.matchStart,a=t.matchLength,i=t.options,s=t.selection,l=t.top,u=t.value;if(!n)return null;var c=this.props,p=c.maxOptions,f=c.offsetX,h=c.offsetY;if(0===i.length)return null;if(s>=i.length)return this.setState({selection:0}),null;var g=0===p?i.length:p,b=i.slice(0,g).map(function(t,n){var r=t.toLowerCase().indexOf(u.substr(o,a).toLowerCase());return y.a.createElement("li",{className:n===s?"active":null,key:t,onClick:function(){e.handleSelection(n)},onMouseEnter:function(){e.setState({selection:n})}},t.slice(0,r),y.a.createElement("strong",null,t.substr(r,a)),t.slice(r+a))});return y.a.createElement("ul",{className:"react-autocomplete-input",style:{left:r+f,top:l+h}},b)}},{key:"render",value:function(){var e=this.props,t=e.Component,n=e.defaultValue,a=e.disabled,i=e.onBlur,s=e.value,l=o(e,["Component","defaultValue","disabled","onBlur","value"]),u=this.state.value,c=Object.assign({},l);Object.keys(this.constructor.propTypes).forEach(function(e){delete c[e]});var p="";return void 0!==s&&null!==s?p=s:u?p=u:n&&(p=n),y.a.createElement("span",null,y.a.createElement(t,r({disabled:a,onBlur:i,onChange:this.handleChange,onKeyDown:this.handleKeyDown,ref:this.refInput,value:p},c)),this.renderAutocompleteList())}}]),t}(y.a.Component);L.propTypes=k,L.defaultProps=P,t.default=L},function(e,t){e.exports=require("react")},function(e,t){e.exports=require("prop-types")},function(e,t){e.exports=require("textarea-caret")},function(e,t){e.exports=require("get-input-selection")},function(e,t){}]); | ||
module.exports=(()=>{"use strict";var e={353:(e,t,n)=>{n.r(t),n.d(t,{default:()=>w});const r=require("react");var o=n.n(r);const i=require("prop-types");var a=n.n(i);const s=require("textarea-caret");var l=n.n(s);const u=require("get-input-selection");var c=n.n(u);function p(){return(p=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}).apply(this,arguments)}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function b(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)}}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t){return!t||"object"!==g(t)&&"function"!=typeof t?y(e):t}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var O={Component:a().oneOfType([a().string,a().elementType]),defaultValue:a().string,disabled:a().bool,maxOptions:a().number,onBlur:a().func,onChange:a().func,onKeyDown:a().func,onRequestOptions:a().func,onSelect:a().func,options:a().arrayOf(a().string),regex:a().string,matchAny:a().bool,minChars:a().number,requestOnlyIfNoOptions:a().bool,spaceRemovers:a().arrayOf(a().string),spacer:a().string,trigger:a().string,value:a().string,offsetX:a().number,offsetY:a().number,passThroughEnter:a().bool},S=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(O,e);var t,n,i,a,s=(i=O,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=m(i);if(a){var n=m(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return d(this,e)});function O(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,O),(t=s.call(this,e)).isTrigger=t.isTrigger.bind(y(t)),t.getMatch=t.getMatch.bind(y(t)),t.handleChange=t.handleChange.bind(y(t)),t.handleKeyDown=t.handleKeyDown.bind(y(t)),t.handleResize=t.handleResize.bind(y(t)),t.handleSelection=t.handleSelection.bind(y(t)),t.updateCaretPosition=t.updateCaretPosition.bind(y(t)),t.updateHelper=t.updateHelper.bind(y(t)),t.resetHelper=t.resetHelper.bind(y(t)),t.renderAutocompleteList=t.renderAutocompleteList.bind(y(t)),t.state={helperVisible:!1,left:0,matchLength:0,matchStart:0,options:[],selection:0,top:0,value:null},t.recentValue=e.defaultValue,t.enableSpaceRemovers=!1,t.refInput=(0,r.createRef)(),t}return t=O,(n=[{key:"componentDidMount",value:function(){window.addEventListener("resize",this.handleResize)}},{key:"componentDidUpdate",value:function(e){var t=this.props.options,n=this.state.caret;t.length!==e.options.length&&this.updateHelper(this.recentValue,n,t)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.handleResize)}},{key:"getMatch",value:function(e,t,n){for(var r=this.props,o=r.trigger,i=r.matchAny,a=r.regex,s=new RegExp(a),l=o.length,u=o.match(s),c=t-1;c>=0;--c){var p=e.substring(c,t).match(s),f=-1;if(l>0){var h=u?c:c-l+1;if(h<0)return null;if(this.isTrigger(e,h)&&(f=h+l),!p&&f<0)return null}else{if(p&&c>0)continue;if(t-(f=0===c&&p?0:c+1)==0)return null}if(f>=0){var b=function(){var r=e.substring(f,t),o=n.filter((function(e){var t=e.toLowerCase().indexOf(r.toLowerCase());return-1!==t&&(i||0===t)})),a=r.length;return{v:{matchStart:f,matchLength:a,options:o}}}();if("object"===g(b))return b.v}}return null}},{key:"isTrigger",value:function(e,t){var n=this.props.trigger;return!n||!n.length||e.substr(t,n.length)===n}},{key:"handleChange",value:function(e){var t=this.props,n=t.onChange,r=t.options,o=t.spaceRemovers,i=t.spacer,a=t.value,s=this.recentValue,l=e.target.value,u=c()(e.target).end;if(l.length||this.setState({helperVisible:!1}),this.recentValue=l,this.setState({caret:u,value:e.target.value}),!l.length||!u)return n(e.target.value);if(this.enableSpaceRemovers&&o.length&&l.length>2&&i.length){for(var p=0;p<Math.max(s.length,l.length);++p)if(s[p]!==l[p]){if(p>=2&&l[p-1]===i&&-1===o.indexOf(l[p-2])&&-1!==o.indexOf(l[p])&&this.getMatch(l.substring(0,p-2),u-3,r)){var f="".concat(l.slice(0,p-1)).concat(l.slice(p,p+1)).concat(l.slice(p-1,p)).concat(l.slice(p+1));return this.updateCaretPosition(p+1),this.refInput.current.value=f,a||this.setState({value:f}),n(f)}break}this.enableSpaceRemovers=!1}return this.updateHelper(l,u,r),a||this.setState({value:e.target.value}),n(e.target.value)}},{key:"handleKeyDown",value:function(e){var t=this.state,n=t.helperVisible,r=t.options,o=t.selection,i=this.props,a=i.onKeyDown,s=i.passThroughEnter;if(n)switch(e.keyCode){case 27:e.preventDefault(),this.resetHelper();break;case 38:e.preventDefault(),this.setState({selection:(r.length+o-1)%r.length});break;case 40:e.preventDefault(),this.setState({selection:(o+1)%r.length});break;case 14:case 13:s||e.preventDefault(),this.handleSelection(o);break;case 9:this.handleSelection(o);break;default:a(e)}else a(e)}},{key:"handleResize",value:function(){this.setState({helperVisible:!1})}},{key:"handleSelection",value:function(e){var t=this.state,n=t.matchStart,r=t.matchLength,o=t.options,i=this.props,a=i.spacer,s=i.onSelect,l=o[e],u=this.recentValue,c=u.substring(0,n),p=u.substring(n+r),f={target:this.refInput.current};f.target.value="".concat(c).concat(l).concat(a).concat(p),this.handleChange(f),s(f.target.value),this.resetHelper(),this.updateCaretPosition(c.length+l.length+1),this.enableSpaceRemovers=!0}},{key:"updateCaretPosition",value:function(e){var t=this;this.setState({caret:e},(function(){return(0,u.setCaretPosition)(t.refInput.current,e)}))}},{key:"updateHelper",value:function(e,t,n){var r=this.refInput.current,o=this.getMatch(e,t,n);if(o){var i=l()(r,t),a=r.getBoundingClientRect(),s=i.top+r.offsetTop,u=Math.min(i.left+r.offsetLeft-10,r.offsetLeft+a.width-100),c=this.props,p=c.minChars,g=c.onRequestOptions,b=c.requestOnlyIfNoOptions;o.matchLength>=p&&(o.options.length>1||1===o.options.length&&o.options[0].length!==o.matchLength)?this.setState(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({helperVisible:!0,top:s,left:u},o)):(b&&o.options.length||g(e.substr(o.matchStart,o.matchLength)),this.resetHelper())}else this.resetHelper()}},{key:"resetHelper",value:function(){this.setState({helperVisible:!1,selection:0})}},{key:"renderAutocompleteList",value:function(){var e=this,t=this.state,n=t.helperVisible,r=t.left,i=t.matchStart,a=t.matchLength,s=t.options,l=t.selection,u=t.top,c=t.value;if(!n)return null;var p=this.props,f=p.maxOptions,h=p.offsetX,g=p.offsetY;if(0===s.length)return null;if(l>=s.length)return this.setState({selection:0}),null;var b=0===f?s.length:f,v=s.slice(0,b).map((function(t,n){var r=t.toLowerCase().indexOf(c.substr(i,a).toLowerCase());return o().createElement("li",{className:n===l?"active":null,key:t,onClick:function(){e.handleSelection(n)},onMouseEnter:function(){e.setState({selection:n})}},t.slice(0,r),o().createElement("strong",null,t.substr(r,a)),t.slice(r+a))}));return o().createElement("ul",{className:"react-autocomplete-input",style:{left:r+h,top:u+g}},v)}},{key:"render",value:function(){var e=this.props,t=e.Component,n=e.defaultValue,r=e.disabled,i=e.onBlur,a=e.value,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["Component","defaultValue","disabled","onBlur","value"]),l=this.state.value,u=Object.assign({},s);Object.keys(this.constructor.propTypes).forEach((function(e){delete u[e]}));var c="";return null!=a?c=a:l?c=l:n&&(c=n),o().createElement("span",null,o().createElement(t,p({disabled:r,onBlur:i,onChange:this.handleChange,onKeyDown:this.handleKeyDown,ref:this.refInput,value:c},u)),this.renderAutocompleteList())}}])&&b(t.prototype,n),O}(o().Component);S.propTypes=O,S.defaultProps={Component:"textarea",defaultValue:"",disabled:!1,maxOptions:6,onBlur:function(){},onChange:function(){},onKeyDown:function(){},onRequestOptions:function(){},onSelect:function(){},options:[],regex:"^[A-Za-z0-9\\-_]+$",matchAny:!1,minChars:0,requestOnlyIfNoOptions:!0,spaceRemovers:[",",".","!","?"],spacer:" ",trigger:"@",offsetX:0,offsetY:0,value:null,passThroughEnter:!1};const w=S}},t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}return n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(353)})(); |
{ | ||
"name": "react-autocomplete-input", | ||
"version": "1.0.14", | ||
"version": "1.0.15", | ||
"description": "Autocomplete input field for React", | ||
"main": "dist/bundle.js", | ||
"scripts": { | ||
"build": "NODE_ENV=production webpack -p", | ||
"build": "NODE_ENV=production webpack", | ||
"clean": "rimraf dist coverage lib", | ||
@@ -42,11 +42,11 @@ "lint": "eslint src --ext .js", | ||
"enzyme-adapter-react-16": "^1.7.1", | ||
"eslint": "^5.16.0", | ||
"eslint": "^7.14.0", | ||
"eslint-config-airbnb": "^17.1.0", | ||
"eslint-loader": "^2.1.1", | ||
"eslint-plugin-import": "^2.14.0", | ||
"eslint-plugin-jsx-a11y": "^6.1.2", | ||
"eslint-plugin-react": "^7.11.1", | ||
"extract-text-webpack-plugin": "^3.0.2", | ||
"eslint-webpack-plugin": "^2.4.1", | ||
"jsdom": "^13.1.0", | ||
"mocha": "^5.2.0", | ||
"mini-css-extract-plugin": "^1.3.1", | ||
"mocha": "^8.2.1", | ||
"nyc": "^14.1.1", | ||
@@ -59,3 +59,4 @@ "react": "^16.7.0", | ||
"style-loader": "^0.23.1", | ||
"webpack": "^3.12.0", | ||
"webpack": "^5.9.0", | ||
"webpack-cli": "^4.2.0", | ||
"webpack-node-externals": "^1.7.2" | ||
@@ -62,0 +63,0 @@ }, |
@@ -47,2 +47,6 @@ # react-autocomplete-input | ||
## onSelect : func | ||
#### Default value: `() => {}` | ||
Callback invoked upon selecting an option. Receives selection value as a parameter. | ||
## onRequestOptions : func | ||
@@ -121,2 +125,7 @@ #### Default value: `() => {}` | ||
## passThroughEnter: boolean | ||
#### Default value: false | ||
If true, then an enter / return keypress is passed on (after being used to autocomplete). | ||
Useful if you want to have the form submit as soon as a single value is chosen. | ||
# Styles Customization | ||
@@ -123,0 +132,0 @@ By default styles are defined in `"react-autocomplete-input/dist/bundle.css"`, however, you may define your custom styles instead for following entities: |
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
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
85059
142
31