/*! For license information please see f8ddfe8b976b94a546e8f16a1ae81c3f.js.LICENSE.txt */
"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([["sub-common/f8ddfe8b976b94a546e8f16a1ae81c3f"],{"./src/components/textareaEnhance/index.tsx":function(e,a,n){var t=n("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");var s=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");var o=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");var u=n("./node_modules/react/cjs/react.production.min.js");var l=n("./node_modules/classnames/index.js");var r=n.n(l);var c=n("./src/components/textareaEnhance/index.module.scss");var d=n("./node_modules/react/cjs/react-jsx-runtime.production.min.js");var i=function TextareaEnhance(e){var a=e.onChange,n=e.title,l=n===void 0?"":n,i=e.placeholder,f=i===void 0?"请输入":i,m=e.defaultValue,v=e.onlyRead,p=v===void 0?false:v;var x=(0,u.useState)({number:0,value:"",count:200,show:false}),h=(0,s["default"])(x,2),j=h[0],w=h[1];var b=function getDesc(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";var n=e;if(e.length>j.count){n=e.slice(0,j.count)}w((0,t["default"])((0,t["default"])({},j),{},{number:n.length,value:n}));a===null||a===void 0?void 0:a(n)};(0,u.useEffect)((function(){b(m)}),[m]);var _=function toggleShowRealTextarea(e){w((0,t["default"])((0,t["default"])({},j),{},{show:e}))};return(0,d.jsxs)(o.View,{className:c["default"].other_desc,children:[(0,d.jsx)(o.View,{className:c["default"].title,children:l}),(0,d.jsxs)(o.View,{className:c["default"].textarea,children:[j.show&&!p?(0,d.jsx)(o.Textarea,{autoFocus:true,value:j.value,onBlur:function onBlur(){return _(false)},className:c["default"].textarea_con,cursorSpacing:100,maxlength:j.count,onInput:function onInput(e){return b(e.detail.value)}}):(0,d.jsx)(o.View,{className:r()(c["default"].textarea_con_pretend,j.value&&c["default"].textarea_con_pretend_ed),onClick:function onClick(){return _(true)},children:j.value||f}),(0,d.jsx)(o.View,{className:c["default"].descDataNum,children:"".concat(j.number,"/").concat(j.count)})]})]})};a["default"]=(0,u.memo)(i)}}]);