Files
Nexus/web/app/assets/VTextarea-D3WIdRGI.js
T
Nexus Agent 0b2d7ac50d feat(scripts): 异步执行、全局进度看板与完成提示音设置
脚本 exec 立即返回 running 并在后台跑批次;/ws/alerts 推送 script_progress/complete;
新增 ScriptRunsPage、Telegram 汇总通知与可配置的浏览器完成提示音。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 07:07:02 +08:00

1 line
5.1 KiB
JavaScript

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