Files
YG_FT/frontend/dist/assets/index-Bl2Fsjov.js
2026-07-24 14:36:11 +08:00

2 lines
14 KiB
JavaScript

import{aK as Je,j as d,N as wt,c4 as St,J as Ie,b as Ct,i as Ee,bQ as _e,aS as It,R as L,a5 as Et,bq as Nt,bZ as et,ak as je,d as zt,bR as Mt,bF as Pt,a as Ue,aQ as Ne,a7 as kt,D as ce,G as Vt,P as H,H as Tt,a9 as Lt,o as c,c as P,g as v,M as ze,n as h,f as o,h as ee,q as D,e as E,w as j,r as U,E as W,Y as We,aL as de,aU as K,al as fe,aa as ve,y as Y,bt as Rt,a3 as Ke,c5 as Bt,c6 as Ot,c7 as $t,a8 as Ft,l as At}from"./index-DS73WiJW.js";import{U as pe,C as Ye,I as Me,r as Gt,c as Xe}from"./raf-G_xTfKfR.js";import{u as Ht,a as Dt}from"./index-Cz3aNuv2.js";import{b as jt,d as Ut,e as Wt,c as Kt}from"./index-COtHB4lx.js";import{u as Yt}from"./index-CP7PpuwU.js";const Xt=["class","style"],qt=/^on[A-Z]/,Qt=(e={})=>{const{excludeListeners:r=!1,excludeKeys:I}=e,t=d(()=>((I==null?void 0:I.value)||[]).concat(Xt)),l=wt();return l?d(()=>{var u;return St(Object.entries((u=l.proxy)==null?void 0:u.$attrs).filter(([p])=>!t.value.includes(p)&&!(r&&qt.test(p))))}):(Je("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),d(()=>({})))};function Zt(e){let r;function I(){if(e.value==null)return;const{selectionStart:l,selectionEnd:u,value:p}=e.value;l==null||u==null||(r={selectionStart:l,selectionEnd:u,value:p,beforeTxt:p.slice(0,Math.max(0,l)),afterTxt:p.slice(Math.max(0,u))})}function t(){if(e.value==null||r==null)return;const{value:l}=e.value,{beforeTxt:u,afterTxt:p,selectionStart:g}=r;if(u==null||p==null||g==null)return;let N=l.length;if(l.endsWith(p))N=l.length-p.length;else if(l.startsWith(u))N=u.length;else{const R=u[g-1],b=l.indexOf(R,g-1);b!==-1&&(N=b+1)}e.value.setSelectionRange(N,N)}return[I,t]}const Jt=Ct({id:{type:String,default:void 0},size:It,disabled:{type:Boolean,default:void 0},modelValue:{type:L([String,Number,Object]),default:""},modelModifiers:{type:L(Object),default:()=>({})},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:L(String),default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:L([Boolean,Object]),default:!1},autocomplete:{type:L(String),default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,clearIcon:{type:Ee,default:_e},showPassword:Boolean,showWordLimit:Boolean,wordLimitPosition:{type:String,values:["inside","outside"],default:"inside"},suffixIcon:{type:Ee},prefixIcon:{type:Ee},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:L([Object,Array,String,Boolean]),default:()=>Et({})},countGraphemes:{type:L(Function)},autofocus:Boolean,rows:{type:Number,default:2},...Yt(["ariaLabel"]),inputmode:{type:L(String),default:void 0},name:String}),_t={[pe]:e=>Ie(e),input:e=>Ie(e),change:(e,r)=>Ie(e)&&(r instanceof Event||r===void 0),focus:e=>e instanceof FocusEvent,blur:e=>e instanceof FocusEvent,clear:e=>e===void 0||e instanceof MouseEvent,mouseleave:e=>e instanceof MouseEvent,mouseenter:e=>e instanceof MouseEvent,keydown:e=>e instanceof Event,compositionstart:e=>e instanceof CompositionEvent,compositionupdate:e=>e instanceof CompositionEvent,compositionend:e=>e instanceof CompositionEvent};Nt(_e);let y;const ea={height:"0",visibility:"hidden",overflow:et()?"":"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},ta=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],qe=e=>{const r=Number.parseFloat(e);return Number.isNaN(r)?e:r};function aa(e){const r=window.getComputedStyle(e),I=r.getPropertyValue("box-sizing"),t=Number.parseFloat(r.getPropertyValue("padding-bottom"))+Number.parseFloat(r.getPropertyValue("padding-top")),l=Number.parseFloat(r.getPropertyValue("border-bottom-width"))+Number.parseFloat(r.getPropertyValue("border-top-width"));return{contextStyle:ta.map(u=>[u,r.getPropertyValue(u)]),paddingSize:t,borderSize:l,boxSizing:I}}function Qe(e,r=1,I){var b;if(!y){y=document.createElement("textarea");let f=document.body;!et()&&e.parentNode&&(f=e.parentNode),f.appendChild(y)}const{paddingSize:t,borderSize:l,boxSizing:u,contextStyle:p}=aa(e);p.forEach(([f,m])=>y==null?void 0:y.style.setProperty(f,m)),Object.entries(ea).forEach(([f,m])=>y==null?void 0:y.style.setProperty(f,m,"important")),y.value=e.value||e.placeholder||"";let g=y.scrollHeight;const N={};u==="border-box"?g=g+l:u==="content-box"&&(g=g-t),y.value="";const R=y.scrollHeight-t;if(je(r)){let f=R*r;u==="border-box"&&(f=f+t+l),g=Math.max(f,g),N.minHeight=`${f}px`}if(je(I)){let f=R*I;u==="border-box"&&(f=f+t+l),g=Math.min(f,g)}return N.height=`${g}px`,(b=y.parentNode)==null||b.removeChild(y),y=void 0,N}const oa=["id","name","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","role","inputmode"],na=["id","name","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","role","inputmode"],Ze="ElInput";var sa=zt({name:Ze,inheritAttrs:!1,__name:"input",props:Jt,emits:_t,setup(e,{expose:r,emit:I}){const t=e,l=I,u=Mt(),p=Pt(),g=d(()=>[t.type==="textarea"?X.b():i.b(),i.m(tt.value),i.is("disabled",B.value),i.is("exceed",st.value),{[i.b("group")]:p.prepend||p.append,[i.m("prefix")]:p.prefix||t.prefixIcon,[i.m("suffix")]:p.suffix||t.suffixIcon||t.clearable||t.showPassword,[i.bm("suffix","password-clear")]:ne.value&&ge.value,[i.b("hidden")]:t.type==="hidden"},u.class]),N=d(()=>[i.e("wrapper"),i.is("focus",he.value)]),R=Qt(),b=d(()=>{var a;return(a=t.maxlength)==null?void 0:a.toString()}),{form:f,formItem:m}=jt(),{inputId:Pe}=Ut(t,{formItemContext:m}),tt=Wt(),B=Kt(),i=Ue("input"),X=Ue("textarea"),te=Ne(),M=Ne(),me=Y(!1),O=Y(!1),ke=Y(),Ve=Y(),ae=Ne(t.inputStyle),q=Y(""),oe=Y(),w=d(()=>te.value||M.value),{wrapperRef:at,isFocused:he,handleFocus:Te,handleBlur:Le}=Ht(w,{disabled:B,afterBlur(){var a;t.validateEvent&&((a=m==null?void 0:m.validate)==null||a.call(m,"blur").catch(K))}}),Re=d(()=>(f==null?void 0:f.statusIcon)??!1),Q=d(()=>(m==null?void 0:m.validateState)||""),Be=d(()=>Q.value&&Bt[Q.value]),ot=d(()=>O.value?Ot:$t),nt=d(()=>[u.style]),Oe=d(()=>[t.inputStyle,ae.value,{resize:t.resize},oe.value?{height:oe.value}:void 0]),k=d(()=>Ft(t.modelValue)?"":String(t.modelValue)),ye=d(()=>t.clearable&&!B.value&&!t.readonly),ne=d(()=>ye.value&&!!k.value&&(he.value||me.value)),ge=d(()=>t.showPassword&&!B.value&&!!k.value),$=d(()=>t.showWordLimit&&!!b.value&&(t.type==="text"||t.type==="textarea")&&!B.value&&!t.readonly&&!t.showPassword),be=d(()=>t.countGraphemes&&t.showWordLimit?t.countGraphemes(k.value):k.value.length),st=d(()=>!!$.value&&be.value>Number(b.value)),it=d(()=>!!p.suffix||!!t.suffixIcon||t.clearable||t.showPassword||$.value||!!Q.value&&Re.value),lt=d(()=>!!Object.keys(t.modelModifiers).length),[rt,ut]=Zt(te);let F;kt(M,a=>{if(ct(),!$.value&&!ye.value||t.resize!=="both"&&t.resize!=="horizontal")return;const{width:n}=a[0].target.getBoundingClientRect(),s=()=>{F=void 0,ke.value={right:`calc(100% - ${n-10}px)`},Ve.value={right:`calc(100% - ${n-11}px)`}};F&&Xe(F),F=Gt(s)});const Z=()=>{const{type:a,autosize:n}=t;if(!(!Rt||a!=="textarea"||!M.value))if(n){const s=Ke(n)?n.minRows:void 0,S=Ke(n)?n.maxRows:void 0,C=Qe(M.value,s,S);ae.value={overflowY:"hidden",...C},H(()=>{M.value.offsetHeight,ae.value=C})}else ae.value={minHeight:Qe(M.value).minHeight}},ct=(a=>{let n=!1;return()=>{var s;if(n||!t.autosize){t.resize!=="none"&&setTimeout(()=>{var S;oe.value=(S=M.value)==null?void 0:S.style.height});return}((s=M.value)==null?void 0:s.offsetParent)!==null&&(setTimeout(a),n=!0)}})(Z),A=()=>{const a=w.value,n=t.formatter?t.formatter(k.value):k.value;!a||a.value===n||t.type==="file"||(a.value=n)},$e=a=>{const{trim:n,number:s}=t.modelModifiers;return n&&(a=a.trim()),s&&(a=`${qe(a)}`),t.formatter&&t.parser&&(a=t.parser(a)),a},xe=async a=>{if(Ae.value)return;const{lazy:n}=t.modelModifiers;let{value:s}=a.target,S=!1;if(n){l(Me,s);return}if(s=$e(s),t.countGraphemes&&b.value!=null){const C=Number(b.value),re=t.countGraphemes(s),G=t.countGraphemes(q.value);if(re>C&&re>G)if(G>C)s=q.value,S=!0;else{const V=q.value,z=s;let x=0;for(;x<V.length&&x<z.length&&V[x]===z[x];)x++;let T=V.length,J=z.length;for(;T>x&&J>x&&V[T-1]===z[J-1];)T--,J--;const yt=z.slice(0,x),gt=V.slice(x,T),He=z.slice(x,J),bt=z.slice(J),xt=G-t.countGraphemes(gt),Se=Math.max(0,C-xt);let _="";if(Se>0)if(typeof Intl<"u"&&"Segmenter"in Intl){const Ce=new Intl.Segmenter(void 0,{granularity:"grapheme"});for(const{segment:ue}of Ce.segment(He)){const De=_+ue;if(t.countGraphemes(De)>Se)break;_=De}}else for(const Ce of Array.from(He)){const ue=_+Ce;if(t.countGraphemes(ue)>Se)break;_=ue}s=yt+_+bt,S=!0}}if(String(s)===k.value){if(t.formatter||S){const C=a.target,re=C.value,G=C.selectionStart,V=C.selectionEnd;if(A(),S&&w.value&&G!=null&&V!=null){const z=w.value.value,x=re.slice(Math.max(0,V));let T=Math.min(G,z.length);x&&z.endsWith(x)&&(T=z.length-x.length),w.value.setSelectionRange(T,T)}}return}q.value=s,rt(),l(pe,s),l(Me,s),await H(),(t.formatter&&t.parser||!lt.value)&&A(),ut()},Fe=async a=>{let{value:n}=a.target;n=$e(n),t.modelModifiers.lazy&&l(pe,n),l(Ye,n,a),await H(),A()},{isComposing:Ae,handleCompositionStart:se,handleCompositionUpdate:ie,handleCompositionEnd:le}=Dt({emit:l,afterComposition:xe}),dt=()=>{O.value=!O.value},ft=()=>{var a;return(a=w.value)==null?void 0:a.focus()},vt=()=>{var a;return(a=w.value)==null?void 0:a.blur()},pt=a=>{me.value=!1,l("mouseleave",a)},mt=a=>{me.value=!0,l("mouseenter",a)},Ge=a=>{l("keydown",a)},ht=()=>{var a;(a=w.value)==null||a.select()},we=a=>{l(pe,""),l(Ye,""),l("clear",a),l(Me,"")};return ce(()=>t.modelValue,()=>{var a;H(()=>{Z(),t.autosize&&(oe.value=void 0)}),t.validateEvent&&((a=m==null?void 0:m.validate)==null||a.call(m,"change").catch(K))}),ce(()=>k.value,a=>{q.value=a},{immediate:!0}),ce(k,a=>{if(!w.value)return;const{trim:n,number:s}=t.modelModifiers,S=w.value.value,C=(s||t.type==="number")&&!/^0\d/.test(S)?`${qe(S)}`:S;C!==a&&(document.activeElement===w.value&&w.value.type!=="range"&&n&&C.trim()===a||A())}),ce(()=>t.type,async()=>{await H(),A(),Z()}),Vt(()=>{!t.formatter&&t.parser&&Je(Ze,"If you set the parser, you also need to set the formatter."),A(),H(Z)}),Tt(()=>{F&&Xe(F)}),r({input:te,textarea:M,ref:w,textareaStyle:Oe,autosize:Lt(t,"autosize"),isComposing:Ae,passwordVisible:O,focus:ft,blur:vt,select:ht,clear:we,resizeTextarea:Z}),(a,n)=>(c(),P("div",{class:h([g.value,{[o(i).bm("group","append")]:a.$slots.append,[o(i).bm("group","prepend")]:a.$slots.prepend}]),style:fe(nt.value),onMouseenter:mt,onMouseleave:pt},[v(" input "),e.type!=="textarea"?(c(),P(ze,{key:0},[v(" prepend slot "),a.$slots.prepend?(c(),P("div",{key:0,class:h(o(i).be("group","prepend"))},[ee(a.$slots,"prepend")],2)):v("v-if",!0),D("div",{ref_key:"wrapperRef",ref:at,class:h(N.value)},[v(" prefix slot "),a.$slots.prefix||e.prefixIcon?(c(),P("span",{key:0,class:h(o(i).e("prefix"))},[D("span",{class:h(o(i).e("prefix-inner"))},[ee(a.$slots,"prefix"),e.prefixIcon?(c(),E(o(W),{key:0,class:h(o(i).e("icon"))},{default:j(()=>[(c(),E(U(e.prefixIcon)))]),_:1},8,["class"])):v("v-if",!0)],2)],2)):v("v-if",!0),D("input",We({id:o(Pe),ref_key:"input",ref:te,class:o(i).e("inner")},o(R),{name:e.name,minlength:e.countGraphemes?void 0:e.minlength,maxlength:e.countGraphemes?void 0:b.value,type:e.showPassword?O.value?"text":"password":e.type,disabled:o(B),readonly:e.readonly,autocomplete:e.autocomplete,tabindex:e.tabindex,"aria-label":e.ariaLabel,placeholder:e.placeholder,style:e.inputStyle,form:e.form,autofocus:e.autofocus,role:e.containerRole,inputmode:e.inputmode,onCompositionstart:n[0]||(n[0]=(...s)=>o(se)&&o(se)(...s)),onCompositionupdate:n[1]||(n[1]=(...s)=>o(ie)&&o(ie)(...s)),onCompositionend:n[2]||(n[2]=(...s)=>o(le)&&o(le)(...s)),onInput:xe,onChange:Fe,onKeydown:Ge}),null,16,oa),v(" suffix slot "),it.value?(c(),P("span",{key:1,class:h(o(i).e("suffix"))},[D("span",{class:h(o(i).e("suffix-inner"))},[ye.value?(c(),E(o(W),{key:0,class:h([o(i).e("icon"),o(i).e("clear")]),style:fe({visibility:ne.value?"visible":"hidden"}),onMousedown:de(o(K),["prevent"]),onClick:we},{default:j(()=>[(c(),E(U(e.clearIcon)))]),_:1},8,["class","style","onMousedown"])):v("v-if",!0),!ne.value||!ge.value||!$.value?(c(),P(ze,{key:1},[ee(a.$slots,"suffix"),e.suffixIcon?(c(),E(o(W),{key:0,class:h(o(i).e("icon"))},{default:j(()=>[(c(),E(U(e.suffixIcon)))]),_:1},8,["class"])):v("v-if",!0)],64)):v("v-if",!0),ge.value?(c(),E(o(W),{key:2,class:h([o(i).e("icon"),o(i).e("password")]),onClick:dt,onMousedown:de(o(K),["prevent"]),onMouseup:de(o(K),["prevent"])},{default:j(()=>[ee(a.$slots,"password-icon",{visible:O.value},()=>[(c(),E(U(ot.value)))])]),_:3},8,["class","onMousedown","onMouseup"])):v("v-if",!0),$.value?(c(),P("span",{key:3,class:h([o(i).e("count"),o(i).is("outside",e.wordLimitPosition==="outside")])},[D("span",{class:h(o(i).e("count-inner"))},ve(be.value)+" / "+ve(b.value),3)],2)):v("v-if",!0),Q.value&&Be.value&&Re.value?(c(),E(o(W),{key:4,class:h([o(i).e("icon"),o(i).e("validateIcon"),o(i).is("loading",Q.value==="validating")])},{default:j(()=>[(c(),E(U(Be.value)))]),_:1},8,["class"])):v("v-if",!0)],2)],2)):v("v-if",!0)],2),v(" append slot "),a.$slots.append?(c(),P("div",{key:1,class:h(o(i).be("group","append"))},[ee(a.$slots,"append")],2)):v("v-if",!0)],64)):(c(),P(ze,{key:1},[v(" textarea "),D("textarea",We({id:o(Pe),ref_key:"textarea",ref:M,class:[o(X).e("inner"),o(i).is("focus",o(he)),o(X).is("clearable",e.clearable)]},o(R),{name:e.name,minlength:e.countGraphemes?void 0:e.minlength,maxlength:e.countGraphemes?void 0:b.value,tabindex:e.tabindex,disabled:o(B),readonly:e.readonly,autocomplete:e.autocomplete,style:Oe.value,"aria-label":e.ariaLabel,placeholder:e.placeholder,form:e.form,autofocus:e.autofocus,rows:e.rows,role:e.containerRole,inputmode:e.inputmode,onCompositionstart:n[3]||(n[3]=(...s)=>o(se)&&o(se)(...s)),onCompositionupdate:n[4]||(n[4]=(...s)=>o(ie)&&o(ie)(...s)),onCompositionend:n[5]||(n[5]=(...s)=>o(le)&&o(le)(...s)),onInput:xe,onFocus:n[6]||(n[6]=(...s)=>o(Te)&&o(Te)(...s)),onBlur:n[7]||(n[7]=(...s)=>o(Le)&&o(Le)(...s)),onChange:Fe,onKeydown:Ge}),null,16,na),ne.value?(c(),E(o(W),{key:0,class:h([o(X).e("icon"),o(X).e("clear")]),style:fe(Ve.value),onMousedown:de(o(K),["prevent"]),onClick:we},{default:j(()=>[(c(),E(U(e.clearIcon)))]),_:1},8,["class","style","onMousedown"])):v("v-if",!0),$.value?(c(),P("span",{key:1,style:fe(ke.value),class:h([o(i).e("count"),o(i).is("outside",e.wordLimitPosition==="outside")])},ve(be.value)+" / "+ve(b.value),7)):v("v-if",!0)],64))],38))}}),ia=sa;const va=At(ia);export{va as E,Qt as u};