Files
Nexus/web/app/assets/VTextarea-CV8U5DbY.js
T
Nexus Agent fb6a4be797 feat(commands): 推送日志第三视图与 CSV 导入模板
按对齐计划 Phase1:Commands 页增加推送日志筛选视图;补全 servers_import_template.csv;扩写功能指南 §12.6/12.8/12.10 与 acceptance_catalog。
2026-06-08 02:45:17 +08:00

1 line
5.1 KiB
JavaScript

import{$n as e,Cr as t,Mr as n,Sr as r,Tn as i,Tr as a,Zn as o,Zt as s,_t as c,a as l,bn as u,d,dr as f,en as p,er as m,f as h,fr as g,g as _,gn as v,i as y,jr as b,ln as x,mr as ee,o as S,or as C,p as te,pn as w,qn as T,r as E,rn as ne,s as D,ur as O,v as k,yn as A,zn as j,zr as M}from"./index-AmyXDl4i.js";var N=w({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,...y(),...j(D(),[`direction`]),...h()},`VTextarea`),P=x()({name:`VTextarea`,directives:{vIntersect:c},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(h,{attrs:y,emit:x,slots:w}){let D=p(h,`modelValue`),{isFocused:j,focus:N,blur:P}=te(h),{onIntersect:re}=E(h),ie=e(()=>typeof h.counterValue==`function`?h.counterValue(D.value):(D.value||``).toString().length),F=e(()=>{if(y.maxlength)return y.maxlength;if(!(!h.counter||typeof h.counter!=`number`&&typeof h.counter!=`string`))return h.counter}),I=b(),L=b(),R=n(``),z=b(),B=b(0),{platform:V}=s(),H=l(h),U=e(()=>h.persistentPlaceholder||j.value||h.active);function W(){H.isSuppressing.value&&H.update(),z.value!==document.activeElement&&z.value?.focus(),j.value||N()}function G(e){W(),x(`click:control`,e)}function K(e){x(`mousedown:control`,e)}function q(e){e.stopPropagation(),W(),f(()=>{D.value=``,v(h[`onClick:clear`],e)})}function J(e){let t=e.target;if(!h.modelModifiers?.trim){D.value=t.value;return}let n=t.value,r=t.selectionStart,i=t.selectionEnd;D.value=n,f(()=>{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=b(),X=b(Number(h.rows)),Z=e(()=>[`plain`,`underlined`].includes(h.variant));t(()=>{h.autoGrow||(X.value=Number(h.rows))});function Q(){f(()=>{if(!z.value)return;if(V.value.firefox){B.value=12;return}let{offsetWidth:e,clientWidth:t}=z.value;B.value=Math.max(0,e-t)}),h.autoGrow&&f(()=>{if(!Y.value||!L.value)return;let e=getComputedStyle(Y.value),t=getComputedStyle(L.value.$el),n=parseFloat(e.getPropertyValue(`--v-field-padding-top`))+parseFloat(e.getPropertyValue(`--v-input-padding-top`))+parseFloat(e.getPropertyValue(`--v-field-padding-bottom`)),r=Y.value.scrollHeight,i=parseFloat(e.lineHeight),a=Math.max(parseFloat(h.rows)*i+n,parseFloat(t.getPropertyValue(`--v-input-control-height`))),o=h.maxHeight?parseFloat(h.maxHeight):parseFloat(h.maxRows)*i+n||1/0,s=A(r??0,a,o);X.value=Math.floor((s-n)/i),R.value=u(s)})}ee(Q),r(D,Q),r(()=>h.rows,Q),r(()=>h.maxHeight,Q),r(()=>h.maxRows,Q),r(()=>h.density,Q),r(X,e=>{x(`update:rows`,e)});let $;return r(Y,e=>{e?($=new ResizeObserver(Q),$.observe(Y.value)):$?.disconnect()}),g(()=>{$?.disconnect()}),ne(()=>{let e=!!(w.counter||h.counter||h.counterValue),t=!!(e||w.details),[n,r]=i(y),{modelValue:s,...l}=S.filterProps(h),f={...d.filterProps(h),"onClick:clear":q};return C(S,O({ref:I,modelValue:D.value,"onUpdate:modelValue":e=>D.value=e,class:[`v-textarea v-text-field`,{"v-textarea--prefixed":h.prefix,"v-textarea--suffixed":h.suffix,"v-text-field--prefixed":h.prefix,"v-text-field--suffixed":h.suffix,"v-textarea--auto-grow":h.autoGrow,"v-textarea--no-resize":h.noResize||h.autoGrow,"v-input--plain-underlined":Z.value},h.class],style:[{"--v-textarea-max-height":h.maxHeight?u(h.maxHeight):void 0,"--v-textarea-scroll-bar-width":u(B.value)},h.style]},n,l,{centerAffix:X.value===1&&!Z.value,focused:j.value,indentDetails:h.indentDetails??!Z.value}),{...w,default:({id:e,isDisabled:t,isDirty:n,isReadonly:i,isValid:s,hasDetails:l})=>C(d,O({ref:L,style:{"--v-textarea-control-height":R.value},onClick:G,onMousedown:K,"onClick:prependInner":h[`onClick:prependInner`],"onClick:appendInner":h[`onClick:appendInner`]},f,{id:e.value,active:U.value||n.value,labelId:`${e.value}-label`,centerAffix:X.value===1&&!Z.value,dirty:n.value||h.dirty,disabled:t.value,focused:j.value,details:l.value,error:s.value===!1}),{...w,default:({props:{class:n,...s},controlRef:l})=>m(o,null,[h.prefix&&m(`span`,{class:`v-text-field__prefix`},[h.prefix]),a(m(`textarea`,O({ref:e=>z.value=l.value=e,class:n,value:D.value,onInput:J,autofocus:h.autofocus,readonly:i.value,disabled:t.value,placeholder:h.placeholder,rows:h.rows,name:H.fieldName.value,autocomplete:H.fieldAutocomplete.value,onFocus:W,onBlur:P,"aria-labelledby":`${e.value}-label`},s,r),null),[[c,{handler:re},null,{once:!0}]]),h.autoGrow&&a(m(`textarea`,{class:M([n,`v-textarea__sizer`]),id:`${s.id}-sizer`,"onUpdate:modelValue":e=>D.value=e,ref:Y,readonly:!0,"aria-hidden":`true`},null),[[T,D.value]]),h.suffix&&m(`span`,{class:`v-text-field__suffix`},[h.suffix])])}),details:t?t=>m(o,null,[w.details?.(t),e&&m(o,null,[m(`span`,null,null),C(_,{active:h.persistentCounter||j.value,value:ie.value,max:F.value,disabled:h.disabled},w.counter)])]):void 0})}),k({},I,L,z)}});export{P as t};