/
home
/
henzagold
/
apps
/
export
/
assets
/
File Upload :
llllll
Current File: /home/henzagold/apps/export/assets/TextArea.e2edb665.js
import{q as se,g as ee,_ as N,a as g,u as ve,n as B,c as Q}from"./useConfigInject.4c4c7261.js";import{t as te,a as de,C as ce,b as fe,r as U,f as ge}from"./Input.da3a7f9e.js";import{R as me}from"./index.8a507fee.js";import{w as R}from"./button.3a85187d.js";import{o as ae}from"./omit.edf4a919.js";import{d as ne,r as w,H as he,M as re,O as Z,A as xe,f as j,w as be,P as ie,c as $,Q as ze}from"./index.766b35e9.js";import{u as Se}from"./FormItemContext.e8f90a83.js";var pe=` min-height:0 !important; max-height:none !important; height:0 !important; visibility:hidden !important; overflow:hidden !important; position:absolute !important; z-index:-1000 !important; top:0 !important; right:0 !important `,ye=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],K={},z;function we(d){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=d.getAttribute("id")||d.getAttribute("data-reactid")||d.getAttribute("name");if(e&&K[r])return K[r];var n=window.getComputedStyle(d),m=n.getPropertyValue("box-sizing")||n.getPropertyValue("-moz-box-sizing")||n.getPropertyValue("-webkit-box-sizing"),c=parseFloat(n.getPropertyValue("padding-bottom"))+parseFloat(n.getPropertyValue("padding-top")),b=parseFloat(n.getPropertyValue("border-bottom-width"))+parseFloat(n.getPropertyValue("border-top-width")),v=ye.map(function(u){return"".concat(u,":").concat(n.getPropertyValue(u))}).join(";"),i={sizingStyle:v,paddingSize:c,borderSize:b,boxSizing:m};return e&&r&&(K[r]=i),i}function Ce(d){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;z||(z=document.createElement("textarea"),z.setAttribute("tab-index","-1"),z.setAttribute("aria-hidden","true"),document.body.appendChild(z)),d.getAttribute("wrap")?z.setAttribute("wrap",d.getAttribute("wrap")):z.removeAttribute("wrap");var m=we(d,e),c=m.paddingSize,b=m.borderSize,v=m.boxSizing,i=m.sizingStyle;z.setAttribute("style","".concat(i,";").concat(pe)),z.value=d.value||d.placeholder||"";var u=Number.MIN_SAFE_INTEGER,f=Number.MAX_SAFE_INTEGER,s=z.scrollHeight,S;if(v==="border-box"?s+=b:v==="content-box"&&(s-=c),r!==null||n!==null){z.value=" ";var E=z.scrollHeight-c;r!==null&&(u=E*r,v==="border-box"&&(u=u+c+b),s=Math.max(u,s)),n!==null&&(f=E*n,v==="border-box"&&(f=f+c+b),S=s>f?"":"hidden",s=Math.min(f,s))}return{height:"".concat(s,"px"),minHeight:"".concat(u,"px"),maxHeight:"".concat(f,"px"),overflowY:S,resize:"none"}}var L=0,J=1,Ae=2,Ee=ne({compatConfig:{MODE:3},name:"ResizableTextArea",inheritAttrs:!1,props:te(),setup:function(e,r){var n=r.attrs,m=r.emit,c=r.expose,b,v,i=w(),u=w({}),f=w(L);he(function(){R.cancel(b),R.cancel(v)});var s=function(){try{if(document.activeElement===i.value){var h=i.value.selectionStart,p=i.value.selectionEnd;i.value.setSelectionRange(h,p)}}catch{}},S=function(){var h=e.autoSize||e.autosize;if(!(!h||!i.value)){var p=h.minRows,F=h.maxRows;u.value=Ce(i.value,!1,p,F),f.value=J,R.cancel(v),v=R(function(){f.value=Ae,v=R(function(){f.value=L,s()})})}},E=function(){R.cancel(b),b=R(S)},C=function(h){if(f.value===L){m("resize",h);var p=e.autoSize||e.autosize;p&&E()}};se(e.autosize===void 0,"Input.TextArea","autosize is deprecated, please use autoSize instead.");var P=function(){var h=e.prefixCls,p=e.autoSize,F=e.autosize,Y=e.disabled,D=ae(e,["prefixCls","onPressEnter","autoSize","autosize","defaultValue","allowClear","type","lazy","maxlength","valueModifiers"]),k=ee(h,n.class,N({},"".concat(h,"-disabled"),Y)),V=[n.style,u.value,f.value===J?{overflowX:"hidden",overflowY:"hidden"}:null],I=g(g(g({},D),n),{},{style:V,class:k});return I.autofocus||delete I.autofocus,I.rows===0&&delete I.rows,j(me,{onResize:C,disabled:!(p||F)},{default:function(){return[be(j("textarea",g(g({},I),{},{ref:i}),null),[[de]])]}})};re(function(){return e.value},function(){Z(function(){S()})}),xe(function(){Z(function(){S()})});var T=ie();return c({resizeTextarea:S,textArea:i,instance:T}),function(){return P()}}});const Te=Ee;function oe(d,e){return B(d||"").slice(0,e).join("")}function W(d,e,r,n){var m=r;return d?m=oe(r,n):B(e||"").length<r.length&&B(r||"").length>n&&(m=e),m}const Me=ne({compatConfig:{MODE:3},name:"ATextarea",inheritAttrs:!1,props:te(),setup:function(e,r){var n=r.attrs,m=r.expose,c=r.emit,b=Se(),v=w(e.value===void 0?e.defaultValue:e.value),i=w(),u=w(""),f=ve("input",e),s=f.prefixCls,S=f.size,E=f.direction,C=$(function(){return e.showCount===""||e.showCount||!1}),P=$(function(){return Number(e.maxlength)>0}),T=w(!1),A=w(),h=w(0),p=function(t){T.value=!0,A.value=u.value,h.value=t.currentTarget.selectionStart,c("compositionstart",t)},F=function(t){T.value=!1;var a=t.currentTarget.value;if(P.value){var l,x=h.value>=e.maxlength+1||h.value===((l=A.value)===null||l===void 0?void 0:l.length);a=W(x,A.value,a,e.maxlength)}a!==u.value&&(V(a),U(t.currentTarget,t,G,a)),c("compositionend",t)},Y=ie();re(function(){return e.value},function(){"value"in Y.vnode.props;var o;v.value=(o=e.value)!==null&&o!==void 0?o:""});var D=function(t){var a;fe((a=i.value)===null||a===void 0?void 0:a.textArea,t)},k=function(){var t,a;(t=i.value)===null||t===void 0||(a=t.textArea)===null||a===void 0||a.blur()},V=function(t,a){v.value!==t&&(e.value===void 0?v.value=t:Z(function(){if(i.value.textArea.value!==u.value){var l,x,y;(l=i.value)===null||l===void 0||(x=(y=l.instance).update)===null||x===void 0||x.call(y)}}),Z(function(){a&&a()}))},I=function(t){t.keyCode===13&&c("pressEnter",t),c("keydown",t)},X=function(t){var a=e.onBlur;a==null||a(t),b.onFieldBlur()},G=function(t){c("update:value",t.target.value),c("change",t),c("input",t),b.onFieldChange()},le=function(t){U(i.value.textArea,t,G),V("",function(){D()})},q=function(t){var a=t.target.composing,l=t.target.value;if(T.value=!!(t.isComposing||a),!(T.value&&e.lazy||v.value===l)){if(P.value){var x=t.target,y=x.selectionStart>=e.maxlength+1||x.selectionStart===l.length||!x.selectionStart;l=W(y,u.value,l,e.maxlength)}U(t.currentTarget,t,G,l),V(l)}},ue=function(){var t,a,l,x=n.style,y=n.class,H=e.bordered,M=H===void 0?!0:H,_=g(g(g({},ae(e,["allowClear"])),n),{},{style:C.value?{}:x,class:(t={},N(t,"".concat(s.value,"-borderless"),!M),N(t,"".concat(y),y&&!C.value),N(t,"".concat(s.value,"-sm"),S.value==="small"),N(t,"".concat(s.value,"-lg"),S.value==="large"),t),showCount:null,prefixCls:s.value,onInput:q,onChange:q,onBlur:X,onKeydown:I,onCompositionstart:p,onCompositionend:F});return(a=e.valueModifiers)!==null&&a!==void 0&&a.lazy&&delete _.onInput,j(Te,g(g({},_),{},{id:(l=_.id)!==null&&l!==void 0?l:b.id.value,ref:i,maxlength:e.maxlength}),null)};return m({focus:D,blur:k,resizableTextArea:i}),ze(function(){var o=ge(v.value);!T.value&&P.value&&(e.value===null||e.value===void 0)&&(o=oe(o,e.maxlength)),u.value=o}),function(){var o=e.maxlength,t=e.bordered,a=t===void 0?!0:t,l=e.hidden,x=n.style,y=n.class,H=g(g(g({},e),n),{},{prefixCls:s.value,inputType:"text",handleReset:le,direction:E.value,bordered:a,style:C.value?void 0:x}),M=j(ce,g(g({},H),{},{value:u.value}),{element:ue});if(C.value){var _=B(u.value).length,O="";Q(C.value)==="object"?O=C.value.formatter({count:_,maxlength:o}):O="".concat(_).concat(P.value?" / ".concat(o):""),M=j("div",{hidden:l,class:ee("".concat(s.value,"-textarea"),N({},"".concat(s.value,"-textarea-rtl"),E.value==="rtl"),"".concat(s.value,"-textarea-show-count"),y),style:x,"data-count":Q(O)!=="object"?O:void 0},[M])}return M}}});export{Me as T};
Copyright ©2k19 -
Hexid
|
Tex7ure