!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")},6689:e=>{e.exports=require("react")}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,r),a.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};return(()=>{r.r(o),r.d(o,{default:()=>i});var e=r(8213),t=r.n(e),n=r(3838),a=r.n(n),l=r(6689),u=r.n(l);const s=["onChange","value","className","error","maxLength"],c=e=>{let{onChange:r,value:o,className:n,error:l,maxLength:c}=e,i=a()(e,s);const p=l&&""!==l,d=n||"form-control",f=Math.max(c-o.length,0);return u().createElement("div",null,u().createElement("textarea",t()({className:d+" "+(p?"error":""),value:o,onChange:e=>{var t,n;const a=!!((null==o?void 0:o.length)-(null===(t=e.target)||void 0===t||null===(n=t.value)||void 0===n?void 0:n.length));c&&!a||r(e),f&&r(e)},maxLength:c},i)),!!c&&u().createElement("p",null,u().createElement("i",null,"characters left: ",f)),p&&u().createElement("p",{className:"error-label"},l))};c.defaultProps={value:""};const i=c})(),o})()));
//# sourceMappingURL=textarea-input.js.map