Form-3e912ee1.js 35 KB

1
  1. import{aD as Re,d as fe,aB as he,o as T,c as D,t as U,Y as _,at as Q,g as N,J as O,cQ as $,az as dt,aA as J,aK as el,cR as tl,cS as ll,c2 as al,cT as ol,aO as ut,aC as Ve,aR as H,r as L,K as ne,bE as nl,f as k,a as R,ai as X,aN as xe,bx as sl,bY as il,cU as rl,aL as Le,aW as cl,cV as dl,e as Ee,c1 as pt,cW as ul,cX as pl,c4 as Ce,bD as ml,av as fl,cc as mt,cg as hl,am as Z,k as ft,cY as vl,cZ as gl,cm as ht,c_ as vt,ak as bl,b5 as gt,aS as yl,c$ as Sl,d0 as Vl,cl as bt,aU as xl,aj as Ie,P as De,v as de,w as A,O as ee,F as ue,n as Ke,q as te,Q as G,L as Ne,a3 as Cl,aH as Il,cv as wl,ah as yt,bc as St,U as Ol,d1 as _l,bb as kl,y as Tl,ba as Pl,d2 as Bl,d3 as zl,d4 as Ml,A as Rl,d5 as Ll,d6 as El,d7 as Dl,bz as Kl,d8 as Nl,h as Fl,d9 as Al,x as Wl,ag as Hl,da as Ul,ac as $l,db as jl,af as ve,H as ql,C as Ql,a0 as Gl,b8 as Yl,s as Jl,i as Xl,E as Zl,_ as ea,z as ta,c5 as la,__tla as aa}from"./index-2eab2d23.js";import{A as oa,C as Vt,E as na,f as sa,D as ia,i as xt,h as ra,__tla as ca}from"./el-virtual-list-197311ca.js";import{E as da,__tla as ua}from"./el-tree-select-4ae7c290.js";import{E as pa,__tla as ma}from"./el-time-select-5c827818.js";import{I as fa,__tla as ha}from"./InputPassword-37d35f11.js";import{_ as va,__tla as ga}from"./style.css_vue_type_style_index_0_src_true_lang-2706eaa9.js";import{__tla as ba}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_5dfa4534_lang-4db00aa5.js";import{_ as ya,__tla as Sa}from"./UploadImg-90fe71c2.js";import{_ as Va,__tla as xa}from"./UploadImgs-88de5939.js";import{_ as Ca,__tla as Ia}from"./UploadFile-09195073.js";import{c as wa,F as Oa,__tla as _a}from"./fixed-size-list-a23c3278.js";import{_ as ka}from"./_plugin-vue_export-helper-1b428a4d.js";let Ct,le,Ta=Promise.all([(()=>{try{return aa}catch{}})(),(()=>{try{return ca}catch{}})(),(()=>{try{return ua}catch{}})(),(()=>{try{return ma}catch{}})(),(()=>{try{return ha}catch{}})(),(()=>{try{return ga}catch{}})(),(()=>{try{return ba}catch{}})(),(()=>{try{return Sa}catch{}})(),(()=>{try{return xa}catch{}})(),(()=>{try{return Ia}catch{}})(),(()=>{try{return _a}catch{}})()]).then(async()=>{const se=(e,l,i)=>{const{itemSize:s}=e,{items:c,lastVisitedIndex:u}=i;if(l>u){let v=0;if(u>=0){const h=c[u];v=h.offset+h.size}for(let h=u+1;h<=l;h++){const d=s(h);c[h]={offset:v,size:d},v+=d}i.lastVisitedIndex=l}return c[l]},Fe=(e,l,i,s,c)=>{for(;i<=s;){const u=i+Math.floor((s-i)/2),v=se(e,u,l).offset;if(v===c)return u;v<c?i=u+1:v>c&&(s=u-1)}return Math.max(0,i-1)},It=(e,l,i,s)=>{const{total:c}=e;let u=1;for(;i<c&&se(e,i,l).offset<s;)i+=u,u*=2;return Fe(e,l,Math.floor(i/2),Math.min(i,c-1),s)},Ae=({total:e},{items:l,estimatedItemSize:i,lastVisitedIndex:s})=>{let c=0;if(s>=e&&(s=e-1),s>=0){const u=l[s];c=u.offset+u.size}return c+(e-s-1)*i},wt=wa({name:"ElDynamicSizeList",getItemOffset:(e,l,i)=>se(e,l,i).offset,getItemSize:(e,l,{items:i})=>i[l].size,getEstimatedTotalSize:Ae,getOffset:(e,l,i,s,c)=>{const{height:u,layout:v,width:h}=e,d=xt(v)?h:u,I=se(e,l,c),E=Ae(e,c),o=Math.max(0,Math.min(E-d,I.offset)),t=Math.max(0,I.offset-d+I.size);switch(i===ra&&(i=s>=t-d&&s<=o+d?oa:Vt),i){case sa:return o;case na:return t;case Vt:return Math.round(t+(o-t)/2);default:return s>=t&&s<=o?s:s<t?t:o}},getStartIndexForOffset:(e,l,i)=>((s,c,u)=>{const{items:v,lastVisitedIndex:h}=c;return(h>0?v[h].offset:0)>=u?Fe(s,c,0,h,u):It(s,c,Math.max(0,h),u)})(e,i,l),getStopIndexForStartIndex:(e,l,i,s)=>{const{height:c,total:u,layout:v,width:h}=e,d=xt(v)?h:c,I=se(e,l,s),E=i+d;let o=I.offset+I.size,t=l;for(;t<u-1&&o<E;)t++,o+=se(e,t,s).size;return t},initCache({estimatedItemSize:e=ia},l){const i={items:{},estimatedItemSize:e,lastVisitedIndex:-1,clearCacheAfterIndex:(s,c=!0)=>{var u,v;i.lastVisitedIndex=Math.min(i.lastVisitedIndex,s-1),(u=l.exposed)==null||u.getItemStyleCache(-1),c&&((v=l.proxy)==null||v.$forceUpdate())}};return i},clearCache:!1,validateProps:({itemSize:e})=>{}});var Ot=Re(fe({props:{item:{type:Object,required:!0},style:Object,height:Number},setup:()=>({ns:he("select")})}),[["render",function(e,l,i,s,c,u){return e.item.isTitle?(T(),D("div",{key:0,class:_(e.ns.be("group","title")),style:Q([e.style,{lineHeight:`${e.height}px`}])},U(e.item.label),7)):(T(),D("div",{key:1,class:_(e.ns.be("group","split")),style:Q(e.style)},[N("span",{class:_(e.ns.be("group","split-dash")),style:Q({top:e.height/2+"px"})},null,6)],6))}],["__file","/home/runner/work/element-plus/element-plus/packages/components/select-v2/src/group-item.vue"]]);const We={label:"label",value:"value",disabled:"disabled",options:"options"};function ge(e){const l=O(()=>({...We,...e.props}));return{aliasProps:l,getLabel:i=>$(i,l.value.label),getValue:i=>$(i,l.value.value),getDisabled:i=>$(i,l.value.disabled),getOptions:i=>$(i,l.value.options)}}const _t=dt({allowCreate:Boolean,autocomplete:{type:J(String),default:"none"},automaticDropdown:Boolean,clearable:Boolean,clearIcon:{type:el,default:tl},effect:{type:J(String),default:"light"},collapseTags:Boolean,collapseTagsTooltip:{type:Boolean,default:!1},maxCollapseTags:{type:Number,default:1},defaultFirstOption:Boolean,disabled:Boolean,estimatedOptionHeight:{type:Number,default:void 0},filterable:Boolean,filterMethod:Function,height:{type:Number,default:170},itemHeight:{type:Number,default:34},id:String,loading:Boolean,loadingText:String,label:String,modelValue:{type:J([Array,String,Number,Boolean,Object])},multiple:Boolean,multipleLimit:{type:Number,default:0},name:String,noDataText:String,noMatchText:String,remoteMethod:Function,reserveKeyword:{type:Boolean,default:!0},options:{type:J(Array),required:!0},placeholder:{type:String},teleported:ll.teleported,persistent:{type:Boolean,default:!0},popperClass:{type:String,default:""},popperOptions:{type:J(Object),default:()=>({})},remote:Boolean,size:al,props:{type:J(Object),default:()=>We},valueKey:{type:String,default:"value"},scrollbarAlwaysOn:{type:Boolean,default:!1},validateEvent:{type:Boolean,default:!0},placement:{type:J(String),values:ol,default:"bottom-start"}}),kt=dt({data:Array,disabled:Boolean,hovering:Boolean,item:{type:J(Object),required:!0},index:Number,style:Object,selected:Boolean,created:Boolean}),we=Symbol("ElSelectV2Injection"),Tt=fe({props:kt,emits:["select","hover"],setup(e,{emit:l}){const i=ut(we),s=he("select"),{hoverItem:c,selectOptionClick:u}=function(h,{emit:d}){return{hoverItem:()=>{h.disabled||d("hover",h.index)},selectOptionClick:()=>{h.disabled||d("select",h.item,h.index)}}}(e,{emit:l}),{getLabel:v}=ge(i.props);return{ns:s,hoverItem:c,selectOptionClick:u,getLabel:v}}}),Pt=["aria-selected"];var Bt=Re(Tt,[["render",function(e,l,i,s,c,u){return T(),D("li",{"aria-selected":e.selected,style:Q(e.style),class:_([e.ns.be("dropdown","option-item"),e.ns.is("selected",e.selected),e.ns.is("disabled",e.disabled),e.ns.is("created",e.created),{hover:e.hovering}]),onMouseenter:l[0]||(l[0]=(...v)=>e.hoverItem&&e.hoverItem(...v)),onClick:l[1]||(l[1]=H((...v)=>e.selectOptionClick&&e.selectOptionClick(...v),["stop"]))},[Ve(e.$slots,"default",{item:e.item,index:e.index,disabled:e.disabled},()=>[N("span",null,U(e.getLabel(e.item)),1)])],46,Pt)}],["__file","/home/runner/work/element-plus/element-plus/packages/components/select-v2/src/option-item.vue"]]),zt=fe({name:"ElSelectDropdown",props:{data:{type:Array,required:!0},hoveringIndex:Number,width:Number},setup(e,{slots:l,expose:i}){const s=ut(we),c=he("select"),{getLabel:u,getValue:v,getDisabled:h}=ge(s.props),d=L([]),I=L(),E=O(()=>e.data.length);ne(()=>E.value,()=>{var p,r;(r=(p=s.popper.value).updatePopper)==null||r.call(p)});const o=O(()=>nl(s.props.estimatedOptionHeight)),t=O(()=>o.value?{itemSize:s.props.itemHeight}:{estimatedSize:s.props.estimatedOptionHeight,itemSize:p=>d.value[p]}),x=(p,r)=>s.props.multiple?((V=[],m)=>{const{props:{valueKey:b}}=s;return xe(m)?V&&V.some(z=>sl($(z,b))===$(m,b)):V.includes(m)})(p,v(r)):((V,m)=>{if(xe(m)){const{valueKey:b}=s.props;return $(V,b)===$(m,b)}return V===m})(p,v(r)),S=(p,r)=>{const{disabled:V,multiple:m,multipleLimit:b}=s.props;return V||!r&&!!m&&b>0&&p.length>=b},w=p=>e.hoveringIndex===p;i({listRef:I,isSized:o,isItemDisabled:S,isItemHovering:w,isItemSelected:x,scrollToItem:p=>{const r=I.value;r&&r.scrollToItem(p)},resetScrollTop:()=>{const p=I.value;p&&p.resetScrollTop()}});const g=p=>{const{index:r,data:V,style:m}=p,b=R(o),{itemSize:z,estimatedSize:P}=R(t),{modelValue:K}=s.props,{onSelect:ae,onHover:ie}=s,j=V[r];if(j.type==="Group")return k(Ot,{item:j,style:m,height:b?z:P},null);const re=x(K,j),W=S(K,re),Y=w(r);return k(Bt,X(p,{selected:re,disabled:h(j)||W,created:!!j.created,hovering:Y,item:j,onSelect:ae,onHover:ie}),{default:_e=>{var pe;return((pe=l.default)==null?void 0:pe.call(l,_e))||k("span",null,[u(j)])}})},{onKeyboardNavigate:M,onKeyboardSelect:y}=s,B=p=>{const{code:r}=p,{tab:V,esc:m,down:b,up:z,enter:P}=il;switch(r!==V&&(p.preventDefault(),p.stopPropagation()),r){case V:case m:s.expanded=!1;break;case b:M("forward");break;case z:M("backward");break;case P:y()}};return()=>{var p;const{data:r,width:V}=e,{height:m,multiple:b,scrollbarAlwaysOn:z}=s.props;if(r.length===0)return k("div",{class:c.b("dropdown"),style:{width:`${V}px`}},[(p=l.empty)==null?void 0:p.call(l)]);const P=R(o)?Oa:wt;return k("div",{class:[c.b("dropdown"),c.is("multiple",b)]},[k(P,X({ref:I},R(t),{className:c.be("dropdown","list"),scrollbarAlwaysOn:z,data:r,height:m,width:V,total:r.length,onKeydown:B}),{default:K=>k(g,K,null)})])}}});function Mt(e,l){const{aliasProps:i,getLabel:s,getValue:c}=ge(e),u=L(0),v=L(null),h=O(()=>e.allowCreate&&e.filterable);return{createNewOption:function(d){if(h.value)if(d&&d.length>0&&!function(I){const E=o=>c(o)===I;return e.options&&e.options.some(E)||l.createdOptions.some(E)}(d)){const I={[i.value.value]:d,[i.value.label]:d,created:!0,[i.value.disabled]:!1};l.createdOptions.length>=u.value?l.createdOptions[u.value]=I:l.createdOptions.push(I)}else if(e.multiple)l.createdOptions.length=u.value;else{const I=v.value;l.createdOptions.length=0,I&&I.created&&l.createdOptions.push(I)}},removeNewOption:function(d){if(!h.value||!d||!d.created||d.created&&e.reserveKeyword&&l.inputValue===s(d))return;const I=l.createdOptions.findIndex(E=>c(E)===c(d));~I&&(l.createdOptions.splice(I,1),u.value--)},selectNewOption:function(d){h.value&&(e.multiple&&d.created?u.value++:v.value=d)},clearAllNewOption:function(){h.value&&(l.createdOptions.length=0,u.value=0)}}}const Rt={larget:51,default:42,small:33},Lt=(e,l)=>{const{t:i}=cl(),s=he("select-v2"),c=he("input"),{form:u,formItem:v}=dl(),{getLabel:h,getValue:d,getDisabled:I,getOptions:E}=ge(e),o=Ee({inputValue:"",displayInputValue:"",calculatedWidth:0,cachedPlaceholder:"",cachedOptions:[],createdOptions:[],createdLabel:"",createdSelected:!1,currentPlaceholder:"",hoveringIndex:-1,comboBoxHovering:!1,isOnComposition:!1,isSilentBlur:!1,isComposing:!1,inputLength:20,selectWidth:200,initialInputHeight:0,previousQuery:null,previousValue:void 0,query:"",selectedLabel:"",softFocus:!1,tagInMultiLine:!1}),t=L(-1),x=L(-1),S=L(null),w=L(null),g=L(null),M=L(null),y=L(null),B=L(null),p=L(null),r=L(!1),V=O(()=>e.disabled||(u==null?void 0:u.disabled)),m=O(()=>{const a=34*W.value.length;return a>e.height?e.height:a}),b=O(()=>!pt(e.modelValue)),z=O(()=>{const a=e.multiple?Array.isArray(e.modelValue)&&e.modelValue.length>0:b.value;return e.clearable&&!V.value&&o.comboBoxHovering&&a}),P=O(()=>e.remote&&e.filterable?"":ul),K=O(()=>P.value&&s.is("reverse",r.value)),ae=O(()=>(v==null?void 0:v.validateState)||""),ie=O(()=>pl[ae.value]),j=O(()=>e.remote?300:0),re=O(()=>{const a=W.value;return e.loading?e.loadingText||i("el.select.loading"):(!e.remote||o.inputValue!==""||a.length!==0)&&(e.filterable&&o.inputValue&&a.length>0?e.noMatchText||i("el.select.noMatch"):a.length===0?e.noDataText||i("el.select.noData"):null)}),W=O(()=>{const a=n=>{const f=o.inputValue,C=new RegExp(gl(f),"i");return!f||C.test(h(n)||"")};return e.loading?[]:[...e.options,...o.createdOptions].reduce((n,f)=>{const C=E(f);if(Ce(C)){const F=C.filter(a);F.length>0&&n.push({label:h(f),isTitle:!0,type:"Group"},...F,{type:"Group"})}else(e.remote||a(f))&&n.push(f);return n},[])}),Y=O(()=>{const a=new Map;return W.value.forEach((n,f)=>{a.set(ce(d(n)),{option:n,index:f})}),a}),_e=O(()=>W.value.every(a=>I(a))),pe=ml(),qe=O(()=>pe.value==="small"?"small":"default"),Wt=O(()=>{const a=B.value,n=qe.value||"default",f=a?Number.parseInt(getComputedStyle(a).paddingLeft):0,C=a?Number.parseInt(getComputedStyle(a).paddingRight):0;return o.selectWidth-C-f-Rt[n]}),Qe=()=>{var a;x.value=((a=y.value)==null?void 0:a.offsetWidth)||200},Ht=O(()=>({width:`${o.calculatedWidth===0?11:Math.ceil(o.calculatedWidth)+11}px`})),Ut=O(()=>Ce(e.modelValue)?e.modelValue.length===0&&!o.displayInputValue:!e.filterable||o.displayInputValue.length===0),$t=O(()=>{const a=e.placeholder||i("el.select.placeholder");return e.multiple||pt(e.modelValue)?a:o.selectedLabel}),jt=O(()=>{var a,n;return(n=(a=M.value)==null?void 0:a.popperRef)==null?void 0:n.contentRef}),Ge=O(()=>{if(e.multiple){const a=e.modelValue.length;if(e.modelValue.length>0&&Y.value.has(e.modelValue[a-1])){const{index:n}=Y.value.get(e.modelValue[a-1]);return n}}else if(e.modelValue&&Y.value.has(e.modelValue)){const{index:a}=Y.value.get(e.modelValue);return a}return-1}),Ye=O({get:()=>r.value&&re.value!==!1,set(a){r.value=a}}),qt=O(()=>o.cachedOptions.slice(0,e.maxCollapseTags)),Qt=O(()=>o.cachedOptions.slice(e.maxCollapseTags)),{createNewOption:Je,removeNewOption:ke,selectNewOption:Xe,clearAllNewOption:Te}=Mt(e,o),{handleCompositionStart:Gt,handleCompositionUpdate:Yt,handleCompositionEnd:Jt}=function(a){const n=L(!1);return{handleCompositionStart:()=>{n.value=!0},handleCompositionUpdate:f=>{const C=f.target.value,F=C[C.length-1]||"";n.value=!rl(F)},handleCompositionEnd:f=>{n.value&&(n.value=!1,Le(a)&&a(f))}}}(a=>ct(a)),Ze=()=>{var a,n,f;(n=(a=w.value)==null?void 0:a.focus)==null||n.call(a),(f=M.value)==null||f.updatePopper()},Pe=()=>{if(!e.automaticDropdown)return V.value?void 0:(o.isComposing&&(o.softFocus=!0),Z(()=>{var a,n;r.value=!r.value,(n=(a=w.value)==null?void 0:a.focus)==null||n.call(a)}))},et=()=>(e.filterable&&o.inputValue!==o.selectedLabel&&(o.query=o.selectedLabel),lt(o.inputValue),Z(()=>{Je(o.inputValue)})),tt=fl(et,j.value),lt=a=>{o.previousQuery!==a&&(o.previousQuery=a,e.filterable&&Le(e.filterMethod)?e.filterMethod(a):e.filterable&&e.remote&&Le(e.remoteMethod)&&e.remoteMethod(a))},me=a=>{l(ht,a),(n=>{mt(e.modelValue,n)||l(vt,n)})(a),o.previousValue=String(a)},at=(a=[],n)=>{if(!xe(n))return a.indexOf(n);const f=e.valueKey;let C=-1;return a.some((F,q)=>$(F,f)===$(n,f)&&(C=q,!0)),C},ce=a=>xe(a)?$(a,e.valueKey):a,Be=()=>Z(()=>{var a,n;if(!w.value)return;const f=B.value;y.value.height=f.offsetHeight,r.value&&re.value!==!1&&((n=(a=M.value)==null?void 0:a.updatePopper)==null||n.call(a))}),ot=()=>{var a,n;if(Xt(),Qe(),(n=(a=M.value)==null?void 0:a.updatePopper)==null||n.call(a),e.multiple)return Be()},Xt=()=>{const a=B.value;a&&(o.selectWidth=a.getBoundingClientRect().width)},nt=(a,n,f=!0)=>{var C,F;if(e.multiple){let q=e.modelValue.slice();const Se=at(q,d(a));Se>-1?(q=[...q.slice(0,Se),...q.slice(Se+1)],o.cachedOptions.splice(Se,1),ke(a)):(e.multipleLimit<=0||q.length<e.multipleLimit)&&(q=[...q,d(a)],o.cachedOptions.push(a),Xe(a),oe(n)),me(q),a.created&&(o.query="",lt(""),o.inputLength=20),e.filterable&&!e.reserveKeyword&&((F=(C=w.value).focus)==null||F.call(C),ye("")),e.filterable&&(o.calculatedWidth=p.value.getBoundingClientRect().width),Be(),Zt()}else t.value=n,o.selectedLabel=h(a),me(d(a)),r.value=!1,o.isComposing=!1,o.isSilentBlur=f,Xe(a),a.created||Te(),oe(n)},st=a=>(o.softFocus=!1,Z(()=>{var n,f;(f=(n=w.value)==null?void 0:n.blur)==null||f.call(n),p.value&&(o.calculatedWidth=p.value.getBoundingClientRect().width),o.isSilentBlur?o.isSilentBlur=!1:o.isComposing&&l("blur",a),o.isComposing=!1})),ye=a=>{o.displayInputValue=a,o.inputValue=a},it=(a,n=void 0)=>{const f=W.value;if(!["forward","backward"].includes(a)||V.value||f.length<=0||_e.value)return;if(!r.value)return Pe();n===void 0&&(n=o.hoveringIndex);let C=-1;a==="forward"?(C=n+1,C>=f.length&&(C=0)):a==="backward"&&(C=n-1,(C<0||C>=f.length)&&(C=f.length-1));const F=f[C];if(I(F)||F.type==="Group")return it(a,C);oe(C),ze(C)},oe=a=>{o.hoveringIndex=a},rt=()=>{o.hoveringIndex=-1},Zt=()=>{var a;const n=w.value;n&&((a=n.focus)==null||a.call(n))},ct=a=>{const n=a.target.value;if(ye(n),o.displayInputValue.length>0&&!r.value&&(r.value=!0),o.calculatedWidth=p.value.getBoundingClientRect().width,e.multiple&&Be(),!e.remote)return et();tt()},ze=a=>{g.value.scrollToItem(a)},Me=()=>{if(rt(),e.multiple)if(e.modelValue.length>0){let a=!1;o.cachedOptions.length=0,o.previousValue=e.modelValue.toString();for(const n of e.modelValue){const f=ce(n);if(Y.value.has(f)){const{index:C,option:F}=Y.value.get(f);o.cachedOptions.push(F),a||oe(C),a=!0}}}else o.cachedOptions=[],o.previousValue=void 0;else if(b.value){o.previousValue=e.modelValue;const a=W.value,n=a.findIndex(f=>ce(d(f))===ce(e.modelValue));~n?(o.selectedLabel=h(a[n]),oe(n)):o.selectedLabel=ce(e.modelValue)}else o.selectedLabel="",o.previousValue=void 0;Te(),Qe()};return ne(r,a=>{var n,f;l("visible-change",a),a?(f=(n=M.value).update)==null||f.call(n):(o.displayInputValue="",o.previousQuery=null,Je(""))}),ne(()=>e.modelValue,(a,n)=>{var f;a&&a.toString()===o.previousValue||Me(),!mt(a,n)&&e.validateEvent&&((f=v==null?void 0:v.validate)==null||f.call(v,"change").catch(C=>hl()))},{deep:!0}),ne(()=>e.options,()=>{const a=w.value;(!a||a&&document.activeElement!==a)&&Me()},{deep:!0}),ne(W,()=>g.value&&Z(g.value.resetScrollTop)),ne(()=>Ye.value,a=>{a||rt()}),ft(()=>{Me()}),vl(y,ot),{collapseTagSize:qe,currentPlaceholder:$t,expanded:r,emptyText:re,popupHeight:m,debounce:j,filteredOptions:W,iconComponent:P,iconReverse:K,inputWrapperStyle:Ht,popperSize:x,dropdownMenuVisible:Ye,hasModelValue:b,shouldShowPlaceholder:Ut,selectDisabled:V,selectSize:pe,showClearBtn:z,states:o,tagMaxWidth:Wt,nsSelectV2:s,nsInput:c,calculatorRef:p,controlRef:S,inputRef:w,menuRef:g,popper:M,selectRef:y,selectionRef:B,popperRef:jt,validateState:ae,validateIcon:ie,showTagList:qt,collapseTagList:Qt,debouncedOnInputChange:tt,deleteTag:(a,n)=>{let f=e.modelValue.slice();const C=at(f,d(n));if(C>-1&&!V.value)return f=[...e.modelValue.slice(0,C),...e.modelValue.slice(C+1)],o.cachedOptions.splice(C,1),me(f),l("remove-tag",d(n)),o.softFocus=!0,ke(n),Z(Ze);a.stopPropagation()},getLabel:h,getValue:d,getDisabled:I,getValueKey:ce,handleBlur:st,handleClear:()=>{let a;return a=Ce(e.modelValue)?[]:void 0,o.softFocus=!0,e.multiple?o.cachedOptions=[]:o.selectedLabel="",r.value=!1,me(a),l("clear"),Te(),Z(Ze)},handleClickOutside:()=>(r.value=!1,st()),handleDel:a=>{if(o.displayInputValue.length===0){a.preventDefault();const n=e.modelValue.slice();n.pop(),ke(o.cachedOptions.pop()),me(n)}},handleEsc:()=>{o.displayInputValue.length>0?ye(""):r.value=!1},handleFocus:a=>{const n=o.isComposing;o.isComposing=!0,o.softFocus?o.softFocus=!1:n||l("focus",a)},handleMenuEnter:()=>(o.inputValue=o.displayInputValue,Z(()=>{~Ge.value&&(oe(Ge.value),ze(o.hoveringIndex))})),handleResize:ot,toggleMenu:Pe,scrollTo:ze,onInput:ct,onKeyboardNavigate:it,onKeyboardSelect:()=>{if(!r.value)return Pe();~o.hoveringIndex&&W.value[o.hoveringIndex]&&nt(W.value[o.hoveringIndex],o.hoveringIndex,!1)},onSelect:nt,onHover:oe,onUpdateInputValue:ye,handleCompositionStart:Gt,handleCompositionEnd:Jt,handleCompositionUpdate:Yt}},Et=fe({name:"ElSelectV2",components:{ElSelectMenu:zt,ElTag:bl,ElTooltip:gt,ElIcon:yl},directives:{ClickOutside:Sl,ModelText:Vl},props:_t,emits:[ht,vt,"remove-tag","clear","visible-change","focus","blur"],setup(e,{emit:l}){const i=O(()=>{const{modelValue:c,multiple:u}=e,v=u?[]:void 0;return Ce(c)?u?c:v:u?v:c}),s=Lt(Ee({...bt(e),modelValue:i}),l);return xl(we,{props:Ee({...bt(e),height:s.popupHeight,modelValue:i}),popper:s.popper,onSelect:s.onSelect,onHover:s.onHover,onKeyboardNavigate:s.onKeyboardNavigate,onKeyboardSelect:s.onKeyboardSelect}),{...s,modelValue:i}}}),Dt={key:0},Kt=["id","autocomplete","aria-expanded","aria-labelledby","disabled","readonly","name","unselectable"],Nt=["textContent"],Ft=["id","aria-labelledby","aria-expanded","autocomplete","disabled","name","readonly","unselectable"],At=["textContent"];var be=Re(Et,[["render",function(e,l,i,s,c,u){const v=Ie("el-tag"),h=Ie("el-tooltip"),d=Ie("el-icon"),I=Ie("el-select-menu"),E=De("model-text"),o=De("click-outside");return de((T(),D("div",{ref:"selectRef",class:_([e.nsSelectV2.b(),e.nsSelectV2.m(e.selectSize)]),onClick:l[24]||(l[24]=H((...t)=>e.toggleMenu&&e.toggleMenu(...t),["stop"])),onMouseenter:l[25]||(l[25]=t=>e.states.comboBoxHovering=!0),onMouseleave:l[26]||(l[26]=t=>e.states.comboBoxHovering=!1)},[k(h,{ref:"popper",visible:e.dropdownMenuVisible,teleported:e.teleported,"popper-class":[e.nsSelectV2.e("popper"),e.popperClass],"gpu-acceleration":!1,"stop-popper-mouse-event":!1,"popper-options":e.popperOptions,"fallback-placements":["bottom-start","top-start","right","left"],effect:e.effect,placement:e.placement,pure:"",transition:`${e.nsSelectV2.namespace.value}-zoom-in-top`,trigger:"click",persistent:e.persistent,onBeforeShow:e.handleMenuEnter,onHide:l[23]||(l[23]=t=>e.states.inputValue=e.states.displayInputValue)},{default:A(()=>[N("div",{ref:"selectionRef",class:_([e.nsSelectV2.e("wrapper"),e.nsSelectV2.is("focused",e.states.isComposing||e.expanded),e.nsSelectV2.is("hovering",e.states.comboBoxHovering),e.nsSelectV2.is("filterable",e.filterable),e.nsSelectV2.is("disabled",e.selectDisabled)])},[e.$slots.prefix?(T(),D("div",Dt,[Ve(e.$slots,"prefix")])):ee("v-if",!0),e.multiple?(T(),D("div",{key:1,class:_(e.nsSelectV2.e("selection"))},[e.collapseTags&&e.modelValue.length>0?(T(),D(ue,{key:0},[(T(!0),D(ue,null,Ke(e.showTagList,t=>(T(),D("div",{key:e.getValueKey(e.getValue(t)),class:_(e.nsSelectV2.e("selected-item"))},[k(v,{closable:!e.selectDisabled&&!e.getDisabled(t),size:e.collapseTagSize,type:"info","disable-transitions":"",onClose:x=>e.deleteTag(x,t)},{default:A(()=>[N("span",{class:_(e.nsSelectV2.e("tags-text")),style:Q({maxWidth:`${e.tagMaxWidth}px`})},U(e.getLabel(t)),7)]),_:2},1032,["closable","size","onClose"])],2))),128)),N("div",{class:_(e.nsSelectV2.e("selected-item"))},[e.modelValue.length>e.maxCollapseTags?(T(),te(v,{key:0,closable:!1,size:e.collapseTagSize,type:"info","disable-transitions":""},{default:A(()=>[e.collapseTagsTooltip?(T(),te(h,{key:0,disabled:e.dropdownMenuVisible,"fallback-placements":["bottom","top","right","left"],effect:e.effect,placement:"bottom",teleported:!1},{default:A(()=>[N("span",{class:_(e.nsSelectV2.e("tags-text")),style:Q({maxWidth:`${e.tagMaxWidth}px`})}," + "+U(e.modelValue.length-e.maxCollapseTags),7)]),content:A(()=>[N("div",{class:_(e.nsSelectV2.e("selection"))},[(T(!0),D(ue,null,Ke(e.collapseTagList,t=>(T(),D("div",{key:e.getValueKey(e.getValue(t)),class:_(e.nsSelectV2.e("selected-item"))},[k(v,{closable:!e.selectDisabled&&!e.getDisabled(t),size:e.collapseTagSize,class:"in-tooltip",type:"info","disable-transitions":"",onClose:x=>e.deleteTag(x,t)},{default:A(()=>[N("span",{class:_(e.nsSelectV2.e("tags-text")),style:Q({maxWidth:`${e.tagMaxWidth}px`})},U(e.getLabel(t)),7)]),_:2},1032,["closable","size","onClose"])],2))),128))],2)]),_:1},8,["disabled","effect"])):(T(),D("span",{key:1,class:_(e.nsSelectV2.e("tags-text")),style:Q({maxWidth:`${e.tagMaxWidth}px`})}," + "+U(e.modelValue.length-e.maxCollapseTags),7))]),_:1},8,["size"])):ee("v-if",!0)],2)],64)):(T(!0),D(ue,{key:1},Ke(e.states.cachedOptions,t=>(T(),D("div",{key:e.getValueKey(e.getValue(t)),class:_(e.nsSelectV2.e("selected-item"))},[k(v,{closable:!e.selectDisabled&&!e.getDisabled(t),size:e.collapseTagSize,type:"info","disable-transitions":"",onClose:x=>e.deleteTag(x,t)},{default:A(()=>[N("span",{class:_(e.nsSelectV2.e("tags-text")),style:Q({maxWidth:`${e.tagMaxWidth}px`})},U(e.getLabel(t)),7)]),_:2},1032,["closable","size","onClose"])],2))),128)),N("div",{class:_([e.nsSelectV2.e("selected-item"),e.nsSelectV2.e("input-wrapper")]),style:Q(e.inputWrapperStyle)},[de(N("input",{id:e.id,ref:"inputRef",autocomplete:e.autocomplete,"aria-autocomplete":"list","aria-haspopup":"listbox",autocapitalize:"off","aria-expanded":e.expanded,"aria-labelledby":e.label,class:_([e.nsSelectV2.is(e.selectSize),e.nsSelectV2.e("combobox-input")]),disabled:e.disabled,role:"combobox",readonly:!e.filterable,spellcheck:"false",type:"text",name:e.name,unselectable:e.expanded?"on":void 0,"onUpdate:modelValue":l[0]||(l[0]=(...t)=>e.onUpdateInputValue&&e.onUpdateInputValue(...t)),onFocus:l[1]||(l[1]=(...t)=>e.handleFocus&&e.handleFocus(...t)),onBlur:l[2]||(l[2]=(...t)=>e.handleBlur&&e.handleBlur(...t)),onInput:l[3]||(l[3]=(...t)=>e.onInput&&e.onInput(...t)),onCompositionstart:l[4]||(l[4]=(...t)=>e.handleCompositionStart&&e.handleCompositionStart(...t)),onCompositionupdate:l[5]||(l[5]=(...t)=>e.handleCompositionUpdate&&e.handleCompositionUpdate(...t)),onCompositionend:l[6]||(l[6]=(...t)=>e.handleCompositionEnd&&e.handleCompositionEnd(...t)),onKeydown:[l[7]||(l[7]=G(H(t=>e.onKeyboardNavigate("backward"),["stop","prevent"]),["up"])),l[8]||(l[8]=G(H(t=>e.onKeyboardNavigate("forward"),["stop","prevent"]),["down"])),l[9]||(l[9]=G(H((...t)=>e.onKeyboardSelect&&e.onKeyboardSelect(...t),["stop","prevent"]),["enter"])),l[10]||(l[10]=G(H((...t)=>e.handleEsc&&e.handleEsc(...t),["stop","prevent"]),["esc"])),l[11]||(l[11]=G(H((...t)=>e.handleDel&&e.handleDel(...t),["stop"]),["delete"]))]},null,42,Kt),[[E,e.states.displayInputValue]]),e.filterable?(T(),D("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:_(e.nsSelectV2.e("input-calculator")),textContent:U(e.states.displayInputValue)},null,10,Nt)):ee("v-if",!0)],6)],2)):(T(),D(ue,{key:2},[N("div",{class:_([e.nsSelectV2.e("selected-item"),e.nsSelectV2.e("input-wrapper")])},[de(N("input",{id:e.id,ref:"inputRef","aria-autocomplete":"list","aria-haspopup":"listbox","aria-labelledby":e.label,"aria-expanded":e.expanded,autocapitalize:"off",autocomplete:e.autocomplete,class:_(e.nsSelectV2.e("combobox-input")),disabled:e.disabled,name:e.name,role:"combobox",readonly:!e.filterable,spellcheck:"false",type:"text",unselectable:e.expanded?"on":void 0,onCompositionstart:l[12]||(l[12]=(...t)=>e.handleCompositionStart&&e.handleCompositionStart(...t)),onCompositionupdate:l[13]||(l[13]=(...t)=>e.handleCompositionUpdate&&e.handleCompositionUpdate(...t)),onCompositionend:l[14]||(l[14]=(...t)=>e.handleCompositionEnd&&e.handleCompositionEnd(...t)),onFocus:l[15]||(l[15]=(...t)=>e.handleFocus&&e.handleFocus(...t)),onBlur:l[16]||(l[16]=(...t)=>e.handleBlur&&e.handleBlur(...t)),onInput:l[17]||(l[17]=(...t)=>e.onInput&&e.onInput(...t)),onKeydown:[l[18]||(l[18]=G(H(t=>e.onKeyboardNavigate("backward"),["stop","prevent"]),["up"])),l[19]||(l[19]=G(H(t=>e.onKeyboardNavigate("forward"),["stop","prevent"]),["down"])),l[20]||(l[20]=G(H((...t)=>e.onKeyboardSelect&&e.onKeyboardSelect(...t),["stop","prevent"]),["enter"])),l[21]||(l[21]=G(H((...t)=>e.handleEsc&&e.handleEsc(...t),["stop","prevent"]),["esc"]))],"onUpdate:modelValue":l[22]||(l[22]=(...t)=>e.onUpdateInputValue&&e.onUpdateInputValue(...t))},null,42,Ft),[[E,e.states.displayInputValue]])],2),e.filterable?(T(),D("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:_([e.nsSelectV2.e("selected-item"),e.nsSelectV2.e("input-calculator")]),textContent:U(e.states.displayInputValue)},null,10,At)):ee("v-if",!0)],64)),e.shouldShowPlaceholder?(T(),D("span",{key:3,class:_([e.nsSelectV2.e("placeholder"),e.nsSelectV2.is("transparent",e.multiple?e.modelValue.length===0:!e.hasModelValue)])},U(e.currentPlaceholder),3)):ee("v-if",!0),N("span",{class:_(e.nsSelectV2.e("suffix"))},[e.iconComponent?de((T(),te(d,{key:0,class:_([e.nsSelectV2.e("caret"),e.nsInput.e("icon"),e.iconReverse])},{default:A(()=>[(T(),te(Ne(e.iconComponent)))]),_:1},8,["class"])),[[Cl,!e.showClearBtn]]):ee("v-if",!0),e.showClearBtn&&e.clearIcon?(T(),te(d,{key:1,class:_([e.nsSelectV2.e("caret"),e.nsInput.e("icon")]),onClick:H(e.handleClear,["prevent","stop"])},{default:A(()=>[(T(),te(Ne(e.clearIcon)))]),_:1},8,["class","onClick"])):ee("v-if",!0),e.validateState&&e.validateIcon?(T(),te(d,{key:2,class:_([e.nsInput.e("icon"),e.nsInput.e("validateIcon")])},{default:A(()=>[(T(),te(Ne(e.validateIcon)))]),_:1},8,["class"])):ee("v-if",!0)],2)],2)]),content:A(()=>[k(I,{ref:"menuRef",data:e.filteredOptions,width:e.popperSize,"hovering-index":e.states.hoveringIndex,"scrollbar-always-on":e.scrollbarAlwaysOn},{default:A(t=>[Ve(e.$slots,"default",Il(wl(t)))]),empty:A(()=>[Ve(e.$slots,"empty",{},()=>[N("p",{class:_(e.nsSelectV2.e("empty"))},U(e.emptyText?e.emptyText:""),3)])]),_:3},8,["data","width","hovering-index","scrollbar-always-on"])]),_:3},8,["visible","teleported","popper-class","popper-options","effect","placement","transition","persistent","onBeforeShow"])],34)),[[o,e.handleClickOutside,e.popperRef]])}],["__file","/home/runner/work/element-plus/element-plus/packages/components/select-v2/src/select.vue"]]);be.install=e=>{e.component(be.name,be)};let Oe,He;Oe={Radio:yt,Checkbox:St,CheckboxButton:St,Input:Ol,Autocomplete:_l,InputNumber:kl,Select:Tl,Cascader:Pl,Switch:Bl,Slider:zl,TimePicker:Ml,DatePicker:Rl,Rate:Ll,ColorPicker:El,Transfer:Dl,Divider:Kl,TimeSelect:pa,SelectV2:be,TreeSelect:da,RadioButton:yt,InputPassword:fa,Editor:va,UploadImg:ya,UploadImgs:Va,UploadFile:Ca},le=(e,l="default",i)=>{if(!e||!Reflect.has(e,l)||!Nl(e[l]))return null;const s=e[l];return s?s(i):null},He=(e,l={},i)=>{const s={};for(const c in l)l[c]&&(s[c]=u=>le(e,`${i}-${c}`,u));return s};function Ue(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!la(e)}let $e,je;({getPrefixCls:$e}=Gl()),je=$e("form"),Ct=ka(fe({name:"Form",props:{schema:{type:Array,default:()=>[]},isCol:ve.bool.def(!1),model:{type:Object,default:()=>({})},autoSetPlaceholder:ve.bool.def(!0),isCustom:ve.bool.def(!1),labelWidth:ve.oneOfType([String,Number]).def("auto"),vLoading:ve.bool.def(!1)},emits:["register"],setup(e,{slots:l,expose:i,emit:s}){const c=L(),u=L({}),v=L({}),h=O(()=>{const t={...e};return Object.assign(t,R(v)),t}),d=L({});ft(()=>{var t;s("register",(t=R(c))==null?void 0:t.$parent,R(c))}),i({setValues:(t={})=>{d.value=Object.assign(R(d),t)},formModel:d,setProps:(t={})=>{v.value=Object.assign(R(v),t),u.value=t},delSchema:t=>{const{schema:x}=R(h),S=Yl(x,w=>w.field===t);S>-1&&x.splice(S,1)},addSchema:(t,x)=>{const{schema:S}=R(h);x===void 0?S.push(t):S.splice(x,0,t)},setSchema:t=>{const{schema:x}=R(h);for(const S of x)for(const w of t)S.field===w.field&&Jl(S,w.path,w.value)},getElFormRef:()=>R(c)}),ne(()=>R(h).schema,(t=[])=>{d.value=((x,S)=>{const w={...S};return x.map(g=>{if(g.hidden)delete w[g.field];else if(g.component&&g.component!=="Divider"){const M=Reflect.has(w,g.field);w[g.field]=M?w[g.field]:g.value!==void 0?g.value:""}}),w})(t,R(d))},{immediate:!0,deep:!0});const I=()=>{const{schema:t=[],isCol:x}=R(h);return t.filter(S=>!S.hidden).map(S=>{let w;return S.component==="Divider"?k(Oe.Divider,{contentPosition:"left",...S.componentProps},{default:()=>[S==null?void 0:S.label]}):x?k(Zl,((g={})=>({...g.span?{}:{xs:24,sm:12,md:12,lg:12,xl:12},...g}))(S.colProps),Ue(w=E(S))?w:{default:()=>[w]}):E(S)})},E=t=>{var g,M;const x=["SelectV2","Cascader","Transfer"],S={...He(l,(g=t==null?void 0:t.componentProps)==null?void 0:g.slots,t.field)};(t==null?void 0:t.component)!=="SelectV2"&&(t==null?void 0:t.component)!=="Cascader"&&((M=t==null?void 0:t.componentProps)!=null&&M.options)&&(S.default=()=>o(t));const w=((y,B)=>{const p={};return y[`${B}-error`]&&(p.error=r=>le(y,`${B}-error`,r)),y[`${B}-label`]&&(p.label=r=>le(y,`${B}-label`,r)),p})(l,t.field);return t!=null&&t.labelMessage&&(w.label=()=>k(ue,null,[k("span",null,[t.label]),k(gt,{placement:"right","raw-content":!0},{content:()=>de(k("span",null,null),[[De("dompurify-html"),t.labelMessage]]),default:()=>k(ea,{icon:"ep:warning",size:16,color:"var(--el-color-primary)",class:"relative top-1px ml-2px"},null)})])),k(ta,X(t.formItemProps||{},{prop:t.field,label:t.label||""}),{...w,default:()=>{var p,r,V;const y=Oe[t.component],{autoSetPlaceholder:B}=R(h);return l[t.field]?le(l,t.field,d.value):k(y,X({modelValue:d.value[t.field],"onUpdate:modelValue":m=>d.value[t.field]=m},B&&(m=>{var z,P;const{t:b}=Fl();return["Input","Autocomplete","InputNumber","InputPassword"].includes(m==null?void 0:m.component)?{placeholder:b("common.inputText")+m.label}:["Select","SelectV2","TimePicker","DatePicker","TimeSelect","TimeSelect"].includes(m==null?void 0:m.component)?["datetimerange","daterange","monthrange","datetimerange","daterange"].includes(((z=m==null?void 0:m.componentProps)==null?void 0:z.type)||((P=m==null?void 0:m.componentProps)==null?void 0:P.isRange))?{startPlaceholder:b("common.startTimeText"),endPlaceholder:b("common.endTimeText"),rangeSeparator:"-"}:{placeholder:b("common.selectText")+m.label}:{}})(t),(m=>{const b=["ColorPicker"].includes(m.component)?{...m.componentProps}:{clearable:!0,...m.componentProps};return b==null||delete b.slots,b})(t),{style:(p=t.componentProps)==null?void 0:p.style},x.includes(t==null?void 0:t.component)&&((r=t==null?void 0:t.componentProps)!=null&&r.options)?{options:((V=t==null?void 0:t.componentProps)==null?void 0:V.options)||[]}:{}),{...S})}})},o=t=>{switch(t.component){case"Select":case"SelectV2":const{renderSelectOptions:x}=(g=>{const M=(y,B)=>{var z,P,K,ae;const p=(P=(z=y==null?void 0:y.componentProps)==null?void 0:z.optionsAlias)==null?void 0:P.labelField,r=(ae=(K=y==null?void 0:y.componentProps)==null?void 0:K.optionsAlias)==null?void 0:ae.valueField,{label:V,value:m,...b}=B;return k(Wl,X(b,{label:p?B[p]:V,value:r?B[r]:m}),{default:()=>{var ie;return(ie=y==null?void 0:y.componentProps)!=null&&ie.optionsSlot?le(g,`${y.field}-option`,{item:B}):void 0}})};return{renderSelectOptions:y=>{var p,r,V,m;const B=(r=(p=y==null?void 0:y.componentProps)==null?void 0:p.optionsAlias)==null?void 0:r.labelField;return(m=(V=y==null?void 0:y.componentProps)==null?void 0:V.options)==null?void 0:m.map(b=>{var z;return(z=b==null?void 0:b.options)!=null&&z.length?k(Al,{label:b[B||"label"]},{default:()=>{var P;return(P=b==null?void 0:b.options)==null?void 0:P.map(K=>M(y,K))}}):M(y,b)})}}})(l);return x(t);case"Radio":case"RadioButton":const{renderRadioOptions:S}={renderRadioOptions:g=>{var p,r,V,m,b,z;const M=(r=(p=g==null?void 0:g.componentProps)==null?void 0:p.optionsAlias)==null?void 0:r.labelField,y=(m=(V=g==null?void 0:g.componentProps)==null?void 0:V.optionsAlias)==null?void 0:m.valueField,B=g.component==="Radio"?Hl:Ul;return(z=(b=g==null?void 0:g.componentProps)==null?void 0:b.options)==null?void 0:z.map(P=>{const{...K}=P;return k(B,X(K,{label:P[y||"value"]}),{default:()=>[P[M||"label"]]})})}};return S(t);case"Checkbox":case"CheckboxButton":const{renderCheckboxOptions:w}={renderCheckboxOptions:g=>{var p,r,V,m,b,z;const M=(r=(p=g==null?void 0:g.componentProps)==null?void 0:p.optionsAlias)==null?void 0:r.labelField,y=(m=(V=g==null?void 0:g.componentProps)==null?void 0:V.optionsAlias)==null?void 0:m.valueField,B=g.component==="Checkbox"?$l:jl;return(z=(b=g==null?void 0:g.componentProps)==null?void 0:b.options)==null?void 0:z.map(P=>{const{...K}=P;return k(B,X(K,{label:P[y||"value"]}),{default:()=>[P[M||"label"]]})})}};return w(t)}};return()=>de(k(Ql,X({ref:c},(()=>{const t=["schema","isCol","autoSetPlaceholder","isCustom","model"],x={...R(h)};for(const S in x)t.indexOf(S)!==-1&&delete x[S];return x})(),{model:e.isCustom?e.model:d,class:je}),{default:()=>{const{isCustom:t}=R(h);return t?le(l,"default"):(()=>{let x;const{isCol:S}=R(h);return S?k(Xl,{gutter:20},Ue(x=I())?x:{default:()=>[x]}):I()})()}}),[[ql,e.vLoading]])}}),[["__scopeId","data-v-39bc4695"]])});export{Ct as _,Ta as __tla,le as g};