"use strict";var W=Object.create;var i=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var S=Object.getPrototypeOf;var j=Object.prototype.hasOwnProperty;var c=(t,e)=>i(t,"name",{value:e,configurable:true});var k=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:true})};var d=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let a of D(e))if(!j.call(t,a)&&a!==r)i(t,a,{get:()=>e[a],enumerable:!(n=$(e,a))||n.enumerable})}return t};var o=(t,e,r)=>(r=t!=null?W(S(t)):{},d(e||!t||!t.__esModule?i(r,"default",{value:t,enumerable:true}):r,t));var q=t=>d(i({},"__esModule",{value:true}),t);var z={};k(z,{default:()=>B});module.exports=q(z);var s=require("react/jsx-runtime");var x=o(require("classnames"));var m=require("react");var g=o(require("react-jss"));var l=require("lodash");var u=o(require("../error"));var b=o(require("../label"));var L=o(require("../wrapper"));var T=o(require("./styles"));class f extends m.Component{textareaRef=(0,m.createRef)();componentDidMount(){const{data:e}=this.props;if(this.textareaRef?.current&&e){Object.keys(e).forEach(r=>{this.textareaRef.current.dataset[r]=e[r]})}}onChange(e){const{onChange:r=l.noop}=this.props;if(r){r(e)}}render(){const{classes:e,className:r,disabled:n=false,error:a,id:p,textareaClassName:h,label:C,showLabel:y=true,value:M,name:E,placeholder:F,spellCheck:N,onBlur:R=l.noop,onFocus:I=l.noop,minLength:v,maxLength:w,required:A,rows:H=5,noMargin:P}=this.props;return(0,s.jsxs)(L.default,{className:r,identifier:"franz-textarea",noMargin:P,children:[(0,s.jsx)(b.default,{title:C,showLabel:y,htmlFor:p,className:e.label,isRequired:A,children:(0,s.jsx)("div",{className:(0,x.default)({[`${h}`]:h,[`${e.wrapper}`]:true,[`${e.disabled}`]:n,[`${e.hasError}`]:a}),children:(0,s.jsx)("textarea",{id:p,name:E,placeholder:F,spellCheck:N,className:e.textarea,ref:this.textareaRef,onChange:this.onChange.bind(this),onFocus:I,onBlur:R,disabled:n,minLength:v,maxLength:w,rows:H,children:M})})}),a&&(0,s.jsx)(u.default,{message:a})]})}}c(f,"TextareaComponent");var B=(0,g.default)(T.default,{injectTheme:true})(f);
