f127f07ab2
rdp_hosts 表与专用 API,在 3389远程页添加/连接,不再依赖子机列表。 Co-authored-by: Cursor <cursoragent@cursor.com>
1 line
5.1 KiB
JavaScript
1 line
5.1 KiB
JavaScript
import{E as e,Er as t,Ir as n,Ln as r,Mr as i,Nr as a,Pn as o,Qr as s,Rn as c,Rr as l,Un as u,Xr as d,Yr as f,br as p,fn as ee,fr as m,gr as h,hn as g,ii as _,kn as v,oi as y,pi as b,r as te,rr as x,vn as ne,wn as S,yr as C}from"./index-_6O5JL4W.js";import{a as w,c as T,i as E,l as D,m as O,o as k,r as A,s as j,u as M}from"./VTextField-CD7WwKb1.js";var N=v({autoGrow:Boolean,autofocus:Boolean,counter:[Boolean,Number,String],counterValue:Function,prefix:String,placeholder:String,persistentPlaceholder:Boolean,persistentCounter:Boolean,noResize:Boolean,rows:{type:[Number,String],default:5,validator:e=>!isNaN(parseFloat(e))},maxHeight:{type:[Number,String],validator:e=>!isNaN(parseFloat(e))},maxRows:{type:[Number,String],validator:e=>!isNaN(parseFloat(e))},suffix:String,modelModifiers:Object,...E(),...x(M(),[`direction`]),...j()},`VTextarea`),P=S()({name:`VTextarea`,directives:{vIntersect:e},inheritAttrs:!1,props:N(),emits:{"click:control":e=>!0,"mousedown:control":e=>!0,"update:focused":e=>!0,"update:modelValue":e=>!0,"update:rows":e=>!0},setup(v,{attrs:x,emit:S,slots:E}){let j=g(v,`modelValue`),{isFocused:M,focus:N,blur:P}=O(v),{onIntersect:F}=A(v),I=C(()=>typeof v.counterValue==`function`?v.counterValue(j.value):(j.value||``).toString().length),L=C(()=>{if(x.maxlength)return x.maxlength;if(!(!v.counter||typeof v.counter!=`number`&&typeof v.counter!=`string`))return v.counter}),R=_(),z=_(),B=y(``),V=_(),H=_(0),{platform:U}=ee(),W=w(v),G=C(()=>v.persistentPlaceholder||M.value||v.active);function K(){W.isSuppressing.value&&W.update(),V.value!==document.activeElement&&V.value?.focus(),M.value||N()}function q(e){K(),S(`click:control`,e)}function J(e){S(`mousedown:control`,e)}function re(e){e.stopPropagation(),K(),a(()=>{j.value=``,o(v[`onClick:clear`],e)})}function ie(e){let t=e.target;if(!v.modelModifiers?.trim){j.value=t.value;return}let n=t.value,r=t.selectionStart,i=t.selectionEnd;j.value=n,a(()=>{let e=0;n.trimStart().length===t.value.length&&(e=n.length-t.value.length),r!=null&&(t.selectionStart=r-e),i!=null&&(t.selectionEnd=i-e)})}let Y=_(),X=_(Number(v.rows)),Z=C(()=>[`plain`,`underlined`].includes(v.variant));d(()=>{v.autoGrow||(X.value=Number(v.rows))});function Q(){a(()=>{if(!V.value)return;if(U.value.firefox){H.value=12;return}let{offsetWidth:e,clientWidth:t}=V.value;H.value=Math.max(0,e-t)}),v.autoGrow&&a(()=>{if(!Y.value||!z.value)return;let e=getComputedStyle(Y.value),t=getComputedStyle(z.value.$el),n=parseFloat(e.getPropertyValue(`--v-field-padding-top`))+parseFloat(e.getPropertyValue(`--v-input-padding-top`))+parseFloat(e.getPropertyValue(`--v-field-padding-bottom`)),i=Y.value.scrollHeight,a=parseFloat(e.lineHeight),o=Math.max(parseFloat(v.rows)*a+n,parseFloat(t.getPropertyValue(`--v-input-control-height`))),s=v.maxHeight?parseFloat(v.maxHeight):parseFloat(v.maxRows)*a+n||1/0,l=r(i??0,o,s);X.value=Math.floor((l-n)/a),B.value=c(l)})}l(Q),f(j,Q),f(()=>v.rows,Q),f(()=>v.maxHeight,Q),f(()=>v.maxRows,Q),f(()=>v.density,Q),f(X,e=>{S(`update:rows`,e)});let $;return f(Y,e=>{e?($=new ResizeObserver(Q),$.observe(Y.value)):$?.disconnect()}),n(()=>{$?.disconnect()}),ne(()=>{let n=!!(E.counter||v.counter||v.counterValue),r=!!(n||E.details),[a,o]=u(x),{modelValue:l,...d}=D.filterProps(v),f={...k.filterProps(v),"onClick:clear":re};return t(D,i({ref:R,modelValue:j.value,"onUpdate:modelValue":e=>j.value=e,class:[`v-textarea v-text-field`,{"v-textarea--prefixed":v.prefix,"v-textarea--suffixed":v.suffix,"v-text-field--prefixed":v.prefix,"v-text-field--suffixed":v.suffix,"v-textarea--auto-grow":v.autoGrow,"v-textarea--no-resize":v.noResize||v.autoGrow,"v-input--plain-underlined":Z.value},v.class],style:[{"--v-textarea-max-height":v.maxHeight?c(v.maxHeight):void 0,"--v-textarea-scroll-bar-width":c(H.value)},v.style]},a,d,{centerAffix:X.value===1&&!Z.value,focused:M.value,indentDetails:v.indentDetails??!Z.value}),{...E,default:({id:n,isDisabled:r,isDirty:a,isReadonly:c,isValid:l,hasDetails:u})=>t(k,i({ref:z,style:{"--v-textarea-control-height":B.value},onClick:q,onMousedown:J,"onClick:prependInner":v[`onClick:prependInner`],"onClick:appendInner":v[`onClick:appendInner`]},f,{id:n.value,active:G.value||a.value,labelId:`${n.value}-label`,centerAffix:X.value===1&&!Z.value,dirty:a.value||v.dirty,disabled:r.value,focused:M.value,details:u.value,error:l.value===!1}),{...E,default:({props:{class:t,...a},controlRef:l})=>p(h,null,[v.prefix&&p(`span`,{class:`v-text-field__prefix`},[v.prefix]),s(p(`textarea`,i({ref:e=>V.value=l.value=e,class:t,value:j.value,onInput:ie,autofocus:v.autofocus,readonly:c.value,disabled:r.value,placeholder:v.placeholder,rows:v.rows,name:W.fieldName.value,autocomplete:W.fieldAutocomplete.value,onFocus:K,onBlur:P,"aria-labelledby":`${n.value}-label`},a,o),null),[[e,{handler:F},null,{once:!0}]]),v.autoGrow&&s(p(`textarea`,{class:b([t,`v-textarea__sizer`]),id:`${a.id}-sizer`,"onUpdate:modelValue":e=>j.value=e,ref:Y,readonly:!0,"aria-hidden":`true`},null),[[m,j.value]]),v.suffix&&p(`span`,{class:`v-text-field__suffix`},[v.suffix])])}),details:r?e=>p(h,null,[E.details?.(e),n&&p(h,null,[p(`span`,null,null),t(T,{active:v.persistentCounter||M.value,value:I.value,max:L.value,disabled:v.disabled},E.counter)])]):void 0})}),te({},R,z,V)}});export{P as t}; |