Files
Nexus/web/app/assets/VTextarea-D4OKIgah.js
T
Your Name 51948469c2 build(frontend): track Vite output in Git for Gitea deploy
- Stop ignoring web/app/index.html and web/app/assets/
- Bundle index-DBKIQT7H.js from current vite build (~101MB assets)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 00:52:44 +08:00

1 line
5.1 KiB
JavaScript

import{Ar as e,Cr as t,Gn as n,Jn as r,Jt as i,Nn as a,Sr as o,Vn as s,Zt as c,_n as l,_r as u,a as d,ar as f,d as p,en as m,er as h,f as g,g as _,gn as v,gr as y,ht as b,i as x,lr as ee,o as S,on as C,or as w,p as T,pn as E,qn as D,r as O,s as k,sr as te,un as A,v as j,xn as M,yr as N}from"./index-BeKW-8Gh.js";var P=A({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,...x(),...a(k(),[`direction`]),...g()},`VTextarea`),F=C()({name:`VTextarea`,directives:{vIntersect:b},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:g,emit:x,slots:C}){let k=c(a,`modelValue`),{isFocused:A,focus:P,blur:F}=T(a),{onIntersect:I}=O(a),L=D(()=>typeof a.counterValue==`function`?a.counterValue(k.value):(k.value||``).toString().length),R=D(()=>{if(g.maxlength)return g.maxlength;if(!(!a.counter||typeof a.counter!=`number`&&typeof a.counter!=`string`))return a.counter}),z=o(),B=o(),V=t(``),H=o(),U=o(0),{platform:W}=i(),G=d(a),K=D(()=>a.persistentPlaceholder||A.value||a.active);function q(){G.isSuppressing.value&&G.update(),H.value!==document.activeElement&&H.value?.focus(),A.value||P()}function J(e){q(),x(`click:control`,e)}function ne(e){x(`mousedown:control`,e)}function re(e){e.stopPropagation(),q(),w(()=>{k.value=``,E(a[`onClick:clear`],e)})}function ie(e){let t=e.target;if(!a.modelModifiers?.trim){k.value=t.value;return}let n=t.value,r=t.selectionStart,i=t.selectionEnd;k.value=n,w(()=>{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=o(),X=o(Number(a.rows)),Z=D(()=>[`plain`,`underlined`].includes(a.variant));u(()=>{a.autoGrow||(X.value=Number(a.rows))});function Q(){w(()=>{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&&w(()=>{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=v(r??0,o,s);X.value=Math.floor((c-n)/i),V.value=l(c)})}ee(Q),y(k,Q),y(()=>a.rows,Q),y(()=>a.maxHeight,Q),y(()=>a.maxRows,Q),y(()=>a.density,Q),y(X,e=>{x(`update:rows`,e)});let $;return y(Y,e=>{e?($=new ResizeObserver(Q),$.observe(Y.value)):$?.disconnect()}),te(()=>{$?.disconnect()}),m(()=>{let t=!!(C.counter||a.counter||a.counterValue),i=!!(t||C.details),[o,c]=M(g),{modelValue:u,...d}=S.filterProps(a),m={...p.filterProps(a),"onClick:clear":re};return h(S,f({ref:z,modelValue:k.value,"onUpdate:modelValue":e=>k.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?l(a.maxHeight):void 0,"--v-textarea-scroll-bar-width":l(U.value)},a.style]},o,d,{centerAffix:X.value===1&&!Z.value,focused:A.value,indentDetails:a.indentDetails??!Z.value}),{...C,default:({id:t,isDisabled:i,isDirty:o,isReadonly:l,isValid:u,hasDetails:d})=>h(p,f({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||o.value,labelId:`${t.value}-label`,centerAffix:X.value===1&&!Z.value,dirty:o.value||a.dirty,disabled:i.value,focused:A.value,details:d.value,error:u.value===!1}),{...C,default:({props:{class:o,...u},controlRef:d})=>r(n,null,[a.prefix&&r(`span`,{class:`v-text-field__prefix`},[a.prefix]),N(r(`textarea`,f({ref:e=>H.value=d.value=e,class:o,value:k.value,onInput:ie,autofocus:a.autofocus,readonly:l.value,disabled:i.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,c),null),[[b,{handler:I},null,{once:!0}]]),a.autoGrow&&N(r(`textarea`,{class:e([o,`v-textarea__sizer`]),id:`${u.id}-sizer`,"onUpdate:modelValue":e=>k.value=e,ref:Y,readonly:!0,"aria-hidden":`true`},null),[[s,k.value]]),a.suffix&&r(`span`,{class:`v-text-field__suffix`},[a.suffix])])}),details:i?e=>r(n,null,[C.details?.(e),t&&r(n,null,[r(`span`,null,null),h(_,{active:a.persistentCounter||A.value,value:L.value,max:R.value,disabled:a.disabled},C.counter)])]):void 0})}),j({},z,B,H)}});export{F as t};