!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},6689:e=>{e.exports=require("react")}},t={};function n(a){var r=t[a];if(void 0!==r)return r.exports;var o=t[a]={exports:{}};return e[a](o,o.exports,n),o.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})}})(),(()=>{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})}})();var a={};return(()=>{n.r(a),n.d(a,{default:()=>c});var e=n(8213),t=n.n(e),r=n(3838),o=n.n(r),i=n(6689),s=n.n(i);const l=require("react-select/lib/Creatable");var u=n.n(l),p=n(4656),h=n.n(p);const d=["id","value","onChange"];class c extends s().Component{constructor(e){super(e),this.state={inputValue:""},this.handleChange=this.handleChange.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}handleChange(e){let t=!!this.props.hasOwnProperty("limit")&&this.props.limit;if(!t||t>=e.length){let t={target:{id:this.props.id,value:e,type:"freetextlist"}};this.props.onChange(t)}}handleInputChange(e){this.setState({inputValue:e})}handleKeyDown(e){const{inputValue:t}=this.state;let{value:n}=this.props;if(t)switch(e.key){case"Enter":case"Tab":this.setState({inputValue:""}),this.handleChange([...n,{label:t,value:t}]),e.preventDefault()}}render(){const{inputValue:e}=this.state;let n=this.props,{id:a,value:r,onChange:i}=n,l=o()(n,d);return s().createElement(u(),t()({components:{DropdownIndicator:null},inputValue:e,clearable:!0,isMulti:!0,menuContainerStyle:{display:"none"},onChange:this.handleChange,onInputChange:this.handleInputChange,onInputKeyDown:this.handleKeyDown,placeholder:h().translate("general.type_something"),value:r},l))}}})(),a})()));
//# sourceMappingURL=free-multi-text-input.js.map