4 lines
6.3 KiB
JavaScript
4 lines
6.3 KiB
JavaScript
import{i as e,t}from"./rolldown-runtime-BgaNhQyE.js";import{Ct as n,Dr as r,Ft as i,Q as ee,St as a,Vn as o,Wt as s,Z as c,ar as l,at as u,p as te,u as ne,xn as d,xt as re,yt as ie,zn as ae}from"./jsx-runtime-ADHq9IcL.js";import{f as oe,p as f}from"./tooltip-CRuv8UNz.js";import{m as p,o as m,p as h}from"./style-Der9vtsK.js";import{n as g,r as _}from"./es-DtKsFKpZ.js";var v=e(r()),y=e=>{let{componentCls:t,paddingLG:n}=e,r=`${t}-textarea`;return{[`textarea${t}`]:{maxWidth:`100%`,height:`auto`,minHeight:e.controlHeight,lineHeight:e.lineHeight,verticalAlign:`bottom`,transition:`all ${e.motionDurationSlow}`,resize:`vertical`,[`&${t}-mouse-active`]:{transition:`all ${e.motionDurationSlow}, height 0s, width 0s`}},[`${t}-textarea-affix-wrapper-resize-dirty`]:{width:`auto`},[r]:{position:`relative`,"&-show-count":{[`${t}-data-count`]:{position:`absolute`,bottom:e.calc(e.fontSize).mul(e.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:e.colorTextDescription,whiteSpace:`nowrap`,pointerEvents:`none`}},[`
|
|
&-allow-clear > ${t},
|
|
&-affix-wrapper${r}-has-feedback ${t}
|
|
`]:{paddingInlineEnd:n},[`&-affix-wrapper${t}-affix-wrapper`]:{padding:0,[`> textarea${t}`]:{fontSize:`inherit`,border:`none`,outline:`none`,background:`transparent`,minHeight:e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),"&:focus":{boxShadow:`none !important`}},[`${t}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${t}-clear-icon`]:{position:`absolute`,insetInlineEnd:e.paddingInline,insetBlockStart:e.paddingXS},[`${r}-suffix`]:{position:`absolute`,top:0,insetInlineEnd:e.paddingInline,bottom:0,zIndex:1,display:`inline-flex`,alignItems:`center`,margin:`auto`,pointerEvents:`none`}}},[`&-affix-wrapper${t}-affix-wrapper-rtl`]:{[`${t}-suffix`]:{[`${t}-data-count`]:{direction:`ltr`,insetInlineStart:0}}},[`&-affix-wrapper${t}-affix-wrapper-sm`]:{[`${t}-suffix`]:{[`${t}-clear-icon`]:{insetInlineEnd:e.paddingInlineSM}}}}}},se=s([`Input`,`TextArea`],e=>y(d(e,p(e))),h,{resetFont:!1}),b=(0,v.forwardRef)((e,t)=>{let{prefixCls:r,bordered:i=!0,size:s,disabled:d,status:p,allowClear:h,classNames:y,rootClassName:b,className:x,style:S,styles:C,variant:w,showCount:T,onMouseDown:E,onResize:D,...O}=e,{getPrefixCls:k,direction:A,allowClear:j,autoComplete:M,className:N,style:P,classNames:F,styles:I}=ae(`textArea`),L=v.useContext(u),R=d??L,{status:z,hasFeedback:B,feedbackIcon:V}=v.useContext(te),ce=oe(z,p),H=a(P),U=a(S),[W,G]=re([F,y],[I,H,C,U],{props:e}),K=v.useRef(null);v.useImperativeHandle(t,()=>({resizableTextArea:K.current?.resizableTextArea,focus:e=>{l(K.current?.resizableTextArea?.textArea,e)},blur:()=>K.current?.blur(),nativeElement:K.current?.nativeElement||null}));let q=k(`input`,r),J=ie(q),[Y,le]=m(q,b);se(q,J);let{compactSize:ue,compactItemClassnames:de}=c(q,A),X=ee(e=>s??ue??e),[fe,pe]=ne(`textArea`,w,i),me=_({allowClear:h,contextAllowClear:j,componentName:`TextArea`}),[Z,Q]=v.useState(!1),[he,ge]=v.useState(!1),$=e=>{Q(!0),E?.(e);let t=()=>{Q(!1),document.removeEventListener(`mouseup`,t)};document.addEventListener(`mouseup`,t)},_e=e=>{if(D?.(e),Z&&n(getComputedStyle)){let e=K.current?.nativeElement?.querySelector(`textarea`);e&&getComputedStyle(e).resize===`both`&&ge(!0)}};return v.createElement(g,{autoComplete:M,...O,style:G.root,styles:G,disabled:R,allowClear:me,className:o(le,J,x,b,de,N,W.root,{[`${q}-textarea-affix-wrapper-resize-dirty`]:he}),classNames:{...W,textarea:o({[`${q}-sm`]:X===`small`,[`${q}-lg`]:X===`large`},Y,W.textarea,Z&&`${q}-mouse-active`),variant:o({[`${q}-${fe}`]:pe},f(q,ce)),affixWrapper:o(`${q}-textarea-affix-wrapper`,{[`${q}-affix-wrapper-rtl`]:A===`rtl`,[`${q}-affix-wrapper-sm`]:X===`small`,[`${q}-affix-wrapper-lg`]:X===`large`,[`${q}-textarea-show-count`]:T||e.count?.show},Y)},prefixCls:q,suffix:B&&v.createElement(`span`,{className:`${q}-textarea-suffix`},V),showCount:T,ref:K,onResize:_e,onMouseDown:$})}),x=e(t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z`}}]},name:`edit`,theme:`outlined`}}))());function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S.apply(this,arguments)}var C=v.forwardRef((e,t)=>v.createElement(i,S({},e,{ref:t,icon:x.default}))),w=e(t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z`}}]},name:`enter`,theme:`outlined`}}))());function T(){return T=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},T.apply(this,arguments)}var E=v.forwardRef((e,t)=>v.createElement(i,T({},e,{ref:t,icon:w.default}))),D=e(t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z`}}]},name:`copy`,theme:`outlined`}}))());function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O.apply(this,arguments)}var k=v.forwardRef((e,t)=>v.createElement(i,O({},e,{ref:t,icon:D.default})));export{b as i,E as n,C as r,k as t}; |