!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},6689:e=>{e.exports=require("react")}},r={};function t(o){var a=r[o];if(void 0!==a)return a.exports;var n=r[o]={exports:{}};return e[o](n,n.exports,t),n.exports}(()=>{t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r}})(),(()=>{t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})}})(),(()=>{t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};return(()=>{t.r(o),t.d(o,{default:()=>p});var e=t(8213),r=t.n(e),a=t(3838),n=t.n(a),s=t(6689),l=t.n(s);const i=["onChange","value","className","error","ariaLabelledBy","containerClassName"];class p extends l().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}componentDidUpdate(e,r,t){this.props.value!==e.value&&(this.input.value=this.props.value)}handleChange(e){this.props.onChange(e)}render(){let e=this.props,{onChange:t,value:o,className:a,error:s,ariaLabelledBy:p,containerClassName:u}=e,c=n()(e,i),d=this.props.hasOwnProperty("error")&&""!==s,h=this.props.hasOwnProperty("className")?a:"form-control",f=this.props.hasOwnProperty("containerClassName")?u:"container-form-control";return l().createElement("div",{className:f},l().createElement("input",r()({className:`${h} ${d?"error":""}`,ref:e=>{this.input=e},defaultValue:o,"aria-labelledby":p,onChange:this.handleChange},c)),d&&l().createElement("p",{className:"error-label"},s))}}p.defaultProps={ariaLabelledBy:null}})(),o})()));
//# sourceMappingURL=text-input.js.map