2026-08-18 15:43:27 +03:30
|
|
|
import{a4 as L,ad as y,al as W,a8 as v,aj as tn,d as ne,am as an,g as V,b as R,aM as rn,a2 as ue,E as fe,v as De,J as ke,W as Le,aq as ie,a7 as he,F as on,Q,Y as ye,h as le,aG as ze,ak as Ge,aQ as ln,a9 as un,ar as We,aw as dn}from"./index-64bb19a3.js";import{a as Ue,S as sn}from"./SearchOutlined-5a638563.js";import{o as X}from"./omit-41b1cee4.js";import{c as ee}from"./vnode-a1a3bc0f.js";import{a as He}from"./FormItemContext-78515ae9.js";import{B as cn}from"./index-7a73a23b.js";import{i as fn}from"./isPlainObject-908a4d4b.js";import{R as vn}from"./index-b5f90115.js";import{w as J}from"./_plugin-vue_export-helper-47756888.js";var Ze=function(){return{id:String,prefixCls:String,inputPrefixCls:String,defaultValue:L.oneOfType([L.string,L.number]),value:{type:[String,Number,Symbol],default:void 0},placeholder:{type:[String,Number]},autocomplete:String,type:{type:String,default:"text"},name:String,size:{type:String},disabled:{type:Boolean,default:void 0},readonly:{type:Boolean,default:void 0},addonBefore:L.any,addonAfter:L.any,prefix:L.any,suffix:L.any,autofocus:{type:Boolean,default:void 0},allowClear:{type:Boolean,default:void 0},lazy:{type:Boolean,default:!0},maxlength:Number,loading:{type:Boolean,default:void 0},bordered:{type:Boolean,default:void 0},showCount:{type:[Boolean,Object]},htmlSize:Number,onPressEnter:Function,onKeydown:Function,onKeyup:Function,onFocus:Function,onBlur:Function,onChange:Function,onInput:Function,"onUpdate:value":Function,valueModifiers:Object,hidden:Boolean}};const we=Ze;var Ye=function(){return y(y({},X(Ze(),["prefix","addonBefore","addonAfter","suffix"])),{},{rows:Number,autosize:{type:[Boolean,Object],default:void 0},autoSize:{type:[Boolean,Object],default:void 0},onResize:{type:Function},onCompositionstart:Function,onCompositionend:Function,valueModifiers:Object})};function qe(t,e,a,n,o){var x;return W(t,(x={},v(x,"".concat(t,"-sm"),a==="small"),v(x,"".concat(t,"-lg"),a==="large"),v(x,"".concat(t,"-disabled"),n),v(x,"".concat(t,"-rtl"),o==="rtl"),v(x,"".concat(t,"-borderless"),!e),x))}var re=function(e){return e!=null&&(Array.isArray(e)?tn(e).length:!0)};function gn(t){return re(t.prefix)||re(t.suffix)||re(t.allowClear)}function ve(t){return re(t.addonBefore)||re(t.addonAfter)}var mn=["text","input"];const Ke=ne({compatConfig:{MODE:3},name:"ClearableLabeledInput",inheritAttrs:!1,props:{prefixCls:String,inputType:L.oneOf(an("text","input")),value:L.any,defaultValue:L.any,allowClear:{type:Boolean,default:void 0},element:L.any,handleReset:Function,disabled:{type:Boolean,default:void 0},direction:{type:String},size:{type:String},suffix:L.any,prefix:L.any,addonBefore:L.any,addonAfter:L.any,readonly:{type:Boolean,default:void 0},focused:{type:Boolean,default:void 0},bordered:{type:Boolean,default:!0},triggerFocus:{type:Function},hidden:Boolean},setup:function(e,a){var n=a.slots,o=a.attrs,x=V(),S=function(u){var h;if((h=x.value)!==null&&h!==void 0&&h.contains(u.target)){var C=e.triggerFocus;C==null||C()}},l=function(u){var h,C=e.allowClear,w=e.value,s=e.disabled,c=e.readonly,p=e.handleReset,f=e.suffix,A=f===void 0?n.suffix:f;if(!C)return null;var M=!s&&!c&&w,I="".concat(u,"-clear-icon");return R(rn,{onClick:p,onMousedown:function(O){return O.preventDefault()},class:W((h={},v(h,"".concat(I,"-hidden"),!M),v(h,"".concat(I,"-has-suffix"),!!A),h),I),role:"button"},null)},m=function(u){var h,C=e.suffix,w=C===void 0?(h=n.suffix)===null||h===void 0?void 0:h.call(n):C,s=e.allowClear;return w||s?R("span",{class:"".concat(u,"-suffix")},[l(u),w]):null},z=function(u,h){var C,w,s,c=e.focused,p=e.value,f=e.prefix,A=f===void 0?(C=n.prefix)===null||C===void 0?void 0:C.call(n):f,M=e.size,I=e.suffix,$=I===void 0?(w=n.suffix)===null||w===void 0?void 0:w.call(n):I,O=e.disabled,D=e.allowClear,N=e.direction,Z=e.readonly,U=e.bordered,q=e.hidden,B=e.addonAfter,i=B===void 0?n.addonAfter:B,d=e.addonBefore,r=d===void 0?n.addonBefore:d,b=m(u);if(!gn({prefix:A,suffix:$,allowClear:D}))return ee(h,{value:p});var E=A?R("span",{class:"".concat(u,"-prefix")},[A]):null,F=W("".concat(u,"-affix-wrapper"),(s={},v(s,"".concat(u,"-affix-
|
|
|
|
|
`,Cn=["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"],pe={},H;function Sn(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=t.getAttribute("id")||t.getAttribute("data-reactid")||t.getAttribute("name");if(e&&pe[a])return pe[a];var n=window.getComputedStyle(t),o=n.getPropertyValue("box-sizing")||n.getPropertyValue("-moz-box-sizing")||n.getPropertyValue("-webkit-box-sizing"),x=parseFloat(n.getPropertyValue("padding-bottom"))+parseFloat(n.getPropertyValue("padding-top")),S=parseFloat(n.getPropertyValue("border-bottom-width"))+parseFloat(n.getPropertyValue("border-top-width")),l=Cn.map(function(z){return"".concat(z,":").concat(n.getPropertyValue(z))}).join(";"),m={sizingStyle:l,paddingSize:x,borderSize:S,boxSizing:o};return e&&a&&(pe[a]=m),m}function An(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;H||(H=document.createElement("textarea"),H.setAttribute("tab-index","-1"),H.setAttribute("aria-hidden","true"),document.body.appendChild(H)),t.getAttribute("wrap")?H.setAttribute("wrap",t.getAttribute("wrap")):H.removeAttribute("wrap");var o=Sn(t,e),x=o.paddingSize,S=o.borderSize,l=o.boxSizing,m=o.sizingStyle;H.setAttribute("style","".concat(m,";").concat(wn)),H.value=t.value||t.placeholder||"";var z=Number.MIN_SAFE_INTEGER,T=Number.MAX_SAFE_INTEGER,_=H.scrollHeight,P;if(l==="border-box"?_+=S:l==="content-box"&&(_-=x),a!==null||n!==null){H.value=" ";var u=H.scrollHeight-x;a!==null&&(z=u*a,l==="border-box"&&(z=z+x+S),_=Math.max(z,_)),n!==null&&(T=u*n,l==="border-box"&&(T=T+x+S),P=_>T?"":"hidden",_=Math.min(T,_))}return{height:"".concat(_,"px"),minHeight:"".concat(z,"px"),maxHeight:"".concat(T,"px"),overflowY:P,resize:"none"}}var be=0,Fe=1,zn=2,_n=ne({compatConfig:{MODE:3},name:"ResizableTextArea",inheritAttrs:!1,props:Ye(),setup:function(e,a){var n=a.attrs,o=a.emit,x=a.expose,S,l,m=V(),z=V({}),T=V(be);ke(function(){J.cancel(S),J.cancel(l)});var _=function(){try{if(document.activeElement===m.value){var c=m.value.selectionStart,p=m.value.selectionEnd;m.value.setSelectionRange(c,p)}}catch{}},P=function(){var c=e.autoSize||e.autosize;if(!(!c||!m.value)){var p=c.minRows,f=c.maxRows;z.value=An(m.value,!1,p,f),T.value=Fe,J.cancel(l),l=J(function(){T.value=zn,l=J(function(){T.value=be,_()})})}},u=function(){J.cancel(S),S=J(P)},h=function(c){if(T.value===be){o("resize",c);var p=e.autoSize||e.autosize;p&&u()}};ln(e.autosize===void 0,"Input.TextArea","autosize is deprecated, please use autoSize instead.");var C=function(){var c=e.prefixCls,p=e.autoSize,f=e.autosize,A=e.disabled,M=X(e,["prefixCls","onPressEnter","autoSize","autosize","defaultValue","allowClear","type","lazy","maxlength","valueModifiers"]),I=W(c,n.class,v({},"".concat(c,"-disabled"),A)),$=[n.style,z.value,T.value===Fe?{overflowX:"hidden",overflowY:"hidden"}:null],O=y(y(y({},M),n),{},{style:$,class:I});return O.autofocus||delete O.autofocus,O.rows===0&&delete O.rows,R(vn,{onResize:h,disabled:!(p||f)},{default:function(){return[Le(R("textarea",y(y({},O),{},{ref:m}),null),[[Ue]])]}})};fe(function(){return e.value},function(){Q(function(){P()})}),De(function(){Q(function(){P()})});var w=ye();return x({resizeTextarea:P,textArea:m,instance:w}),function(){return C()}}});const Bn=_n;function Xe(t,e){return ie(t||"").slice(0,e).join("")}function Ne(t,e,a,n){var o=a;return t?o=Xe(a,n):ie(e||"").length<a.length&&ie(a||"").length>n&&(o=e),o}const Pn=ne({compatConfig:{MODE:3},name:"ATextarea",inheritAttrs:!1,props:Ye(),setup:function(e,a){var n=a.attrs,o=a.expose,x=a.emit,S=He(),l=V(e.value===void 0?e.defaultValue:e.value),m=V(),z=V(""),T=ue("input",e),_=T.prefixCls,P=T.size,u=T.direction,h=le(function(){return e.showCount===""||e.showCount||!1}),C=le(function(){return Number(e.maxlength)>0}),w=V(!1),s=V(),c=V(0),p=function(i){w.value=
|