1 line
1.4 KiB
JavaScript
1 line
1.4 KiB
JavaScript
"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([[9575],{4255:function(e,n,a){var t=a(1413),c=a(9439),o=a(1515),u=a(7294),l=a(4184),s=a.n(l),r=a(1989),i=a(5893),d=function TextareaEnhance(e){var n=e.onChange,a=e.title,l=void 0===a?"":a,d=e.placeholder,h=void 0===d?"请输入":d,x=e.defaultValue,v=e.onlyRead,m=void 0!==v&&v,Z=(0,u.useState)({number:0,value:"",count:200,show:!1}),f=(0,c.Z)(Z,2),p=f[0],g=f[1],w=function getDesc(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",a=e;e.length>p.count&&(a=e.slice(0,p.count)),g((0,t.Z)((0,t.Z)({},p),{},{number:a.length,value:a})),null==n||n(a)};(0,u.useEffect)((function(){w(x)}),[x]);var N=function toggleShowRealTextarea(e){g((0,t.Z)((0,t.Z)({},p),{},{show:e}))};return(0,i.jsxs)(o.G7,{className:r.Z.other_desc,children:[(0,i.jsx)(o.G7,{className:r.Z.title,children:l}),(0,i.jsxs)(o.G7,{className:r.Z.textarea,children:[p.show&&!m?(0,i.jsx)(o.gx,{autoFocus:!0,value:p.value,onBlur:function onBlur(){return N(!1)},className:r.Z.textarea_con,cursorSpacing:100,maxlength:p.count,onInput:function onInput(e){return w(e.detail.value)}}):(0,i.jsx)(o.G7,{className:s()(r.Z.textarea_con_pretend,p.value&&r.Z.textarea_con_pretend_ed),onClick:function onClick(){return N(!0)},children:p.value||h}),(0,i.jsx)(o.G7,{className:r.Z.descDataNum,children:"".concat(p.number,"/").concat(p.count)})]})]})};n.Z=(0,u.memo)(d)}}]); |