1 |
- import{cF as gl,cG as bl,cH as yl,d as ye,am as Sl,aF as Se,r as N,bk as Re,e as k,a as V,z as Ge,bn as xl,cI as Vl,P as Oe,bQ as Be,bp as wt,ao as le,cJ as Il,aH as Qe,o as $,c as q,t as se,a0 as L,ax as re,k as X,cK as ne,aD as Ct,aE as ue,bJ as wl,cL as Cl,cM as Ol,c6 as Tl,cN as kl,aU as Ot,aG as Ee,ba as ae,O as ve,bT as _l,i as W,ak as de,cO as Le,bf as Ml,bH as zl,cP as Pl,cc as Xe,bl as Rl,cQ as Bl,f as Ye,c5 as Tt,cR as El,cS as Ll,bX as De,bS as Dl,g as Fl,bL as kt,bP as Wl,cT as $l,cU as Nl,ca as _t,cV as Mt,al as Kl,aT as zt,aP as Hl,cW as Al,cX as Ul,c9 as Pt,as as jl,h as Fe,S as Je,D as xe,w as Z,l as pe,F as Ve,C as Ze,j as me,T as ce,a6 as ql,aL as Gl,ck as Ql,aj as Rt,aY as Bt,X as Xl,cY as Yl,aX as Jl,H as Zl,aW as ea,cZ as ta,c_ as la,c$ as aa,p as oa,d0 as sa,d1 as na,d2 as ia,bh as ra,d3 as ca,B as ua,d4 as da,G as pa,ai as ma,d5 as fa,ae as ha,d6 as va,ah as Te,M as ga,J as ba,a3 as ya,bW as Sa,y as xa,s as Va,E as Ia,_ as wa,I as Ca,bY as Oa,__tla as Ta}from"./index-1e808f2e.js";import{H as Et,V as ka,v as _a,I as Lt,S as Dt,u as Ma,i as ke,R as et,g as Ft,a as za,b as Wt,c as Pa,B as Ra,F as Ba,d as tt,A as lt,e as Ea,C as We,E as $t,f as Nt,h as Kt,D as La,__tla as Da}from"./el-virtual-list-c88c2cf8.js";import{E as Fa,__tla as Wa}from"./el-tree-select-e8e05888.js";import{E as $a,__tla as Na}from"./el-time-select-9e66b75c.js";import{I as Ka,__tla as Ha}from"./InputPassword-b3d7a3e7.js";import{_ as Aa,__tla as Ua}from"./style.css_vue_type_style_index_0_src_true_lang-507ff6a6.js";import{__tla as ja}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_5dfa4534_lang-b3df4382.js";import{_ as qa,__tla as Ga}from"./UploadImg-3538b5a5.js";import{_ as Qa,__tla as Xa}from"./UploadImgs-d9af51cb.js";import{_ as Ya,__tla as Ja}from"./UploadFile-5a50d6dd.js";import{_ as Za}from"./_plugin-vue_export-helper-1b428a4d.js";let Ht,fe,eo=Promise.all([(()=>{try{return Ta}catch{}})(),(()=>{try{return Da}catch{}})(),(()=>{try{return Wa}catch{}})(),(()=>{try{return Na}catch{}})(),(()=>{try{return Ha}catch{}})(),(()=>{try{return Ua}catch{}})(),(()=>{try{return ja}catch{}})(),(()=>{try{return Ga}catch{}})(),(()=>{try{return Xa}catch{}})(),(()=>{try{return Ja}catch{}})()]).then(async()=>{const At={[Et]:"deltaX",[ka]:"deltaY"},at=({name:e,getOffset:l,getItemSize:n,getItemOffset:i,getEstimatedTotalSize:d,getStartIndexForOffset:p,getStopIndexForStartIndex:v,initCache:m,clearCache:c,validateProps:O})=>ye({name:e??"ElVirtualList",props:_a,emits:[Lt,Dt],setup(h,{emit:o,expose:t}){O(h);const T=Sl(),I=Se("vl"),C=N(m(h,T)),g=Ma(),B=N(),w=N(),E=N(),r=N({isScrolling:!1,scrollDir:"forward",scrollOffset:Re(h.initScrollOffset)?h.initScrollOffset:0,updateRequested:!1,isScrollbarDragging:!1,scrollbarAlwaysOn:h.scrollbarAlwaysOn}),u=k(()=>{const{total:S,cache:_}=h,{isScrolling:R,scrollDir:K,scrollOffset:P}=V(r);if(S===0)return[0,0,0,0];const F=p(h,P,V(C)),A=v(h,F,P,V(C)),H=R&&K!==Ra?1:Math.max(1,_),oe=R&&K!==Ba?1:Math.max(1,_);return[Math.max(0,F-H),Math.max(0,Math.min(S-1,A+oe)),F,A]}),x=k(()=>d(h,V(C))),f=k(()=>ke(h.layout)),b=k(()=>[{position:"relative",["overflow-"+(f.value?"x":"y")]:"scroll",WebkitOverflowScrolling:"touch",willChange:"transform"},{direction:h.direction,height:Re(h.height)?`${h.height}px`:h.height,width:Re(h.width)?`${h.width}px`:h.width},h.style]),D=k(()=>{const S=V(x),_=V(f);return{height:_?"100%":`${S}px`,pointerEvents:V(r).isScrolling?"none":void 0,width:_?`${S}px`:"100%"}}),z=k(()=>f.value?h.width:h.height),{onWheel:U}=(({atEndEdge:S,atStartEdge:_,layout:R},K)=>{let P,F=0;const A=H=>H<0&&_.value||H>0&&S.value;return{hasReachedEdge:A,onWheel:H=>{gl(P);const oe=H[At[R.value]];A(F)&&A(F+oe)||(F+=oe,bl()||H.preventDefault(),P=yl(()=>{K(F),F=0}))}}})({atStartEdge:k(()=>r.value.scrollOffset<=0),atEndEdge:k(()=>r.value.scrollOffset>=x.value),layout:k(()=>h.layout)},S=>{var _,R;(R=(_=E.value).onMouseUp)==null||R.call(_),G(Math.min(r.value.scrollOffset+S,x.value-z.value))}),ee=()=>{const{total:S}=h;if(S>0){const[P,F,A,H]=V(u);o(Lt,P,F,A,H)}const{scrollDir:_,scrollOffset:R,updateRequested:K}=V(r);o(Dt,_,R,K)},G=S=>{(S=Math.max(S,0))!==V(r).scrollOffset&&(r.value={...V(r),scrollOffset:S,scrollDir:tt(V(r).scrollOffset,S),updateRequested:!0},le(te))},Q=(S,_=lt)=>{const{scrollOffset:R}=V(r);S=Math.max(0,Math.min(S,h.total-1)),G(l(h,S,_,R,V(C)))},te=()=>{r.value.isScrolling=!1,le(()=>{g.value(-1,null,null)})},j=()=>{const S=B.value;S&&(S.scrollTop=0)};Ge(()=>{if(!xl)return;const{initScrollOffset:S}=h,_=V(B);Re(S)&&_&&(V(f)?_.scrollLeft=S:_.scrollTop=S),ee()}),Vl(()=>{const{direction:S,layout:_}=h,{scrollOffset:R,updateRequested:K}=V(r),P=V(B);if(K&&P)if(_===Et)if(S===et)switch(Ft()){case Wt:P.scrollLeft=-R;break;case za:P.scrollLeft=R;break;default:{const{clientWidth:F,scrollWidth:A}=P;P.scrollLeft=A-F-R;break}}else P.scrollLeft=R;else P.scrollTop=R});const J={ns:I,clientSize:z,estimatedTotalSize:x,windowStyle:b,windowRef:B,innerRef:w,innerStyle:D,itemsToRender:u,scrollbarRef:E,states:r,getItemStyle:S=>{const{direction:_,itemSize:R,layout:K}=h,P=g.value(c&&R,c&&K,c&&_);let F;if(Il(P,String(S)))F=P[S];else{const A=i(h,S,V(C)),H=n(h,S,V(C)),oe=V(f),Ie=_===et,we=oe?A:0;P[S]=F={position:"absolute",left:Ie?void 0:`${we}px`,right:Ie?`${we}px`:void 0,top:oe?0:`${A}px`,height:oe?"100%":`${H}px`,width:oe?`${H}px`:"100%"}}return F},onScroll:S=>{V(f)?(_=>{const{clientWidth:R,scrollLeft:K,scrollWidth:P}=_.currentTarget,F=V(r);if(F.scrollOffset===K)return;const{direction:A}=h;let H=K;if(A===et)switch(Ft()){case Wt:H=-K;break;case Ea:H=P-R-K}H=Math.max(0,Math.min(H,P-R)),r.value={...F,isScrolling:!0,scrollDir:tt(F.scrollOffset,H),scrollOffset:H,updateRequested:!1},le(te)})(S):(_=>{const{clientHeight:R,scrollHeight:K,scrollTop:P}=_.currentTarget,F=V(r);if(F.scrollOffset===P)return;const A=Math.max(0,Math.min(P,K-R));r.value={...F,isScrolling:!0,scrollDir:tt(F.scrollOffset,A),scrollOffset:A,updateRequested:!1},le(te)})(S),ee()},onScrollbarScroll:(S,_)=>{const R=(x.value-z.value)/_*S;G(Math.min(x.value-z.value,R))},onWheel:U,scrollTo:G,scrollToItem:Q,resetScrollTop:j};return t({windowRef:B,innerRef:w,getItemStyleCache:g,scrollTo:G,scrollToItem:Q,resetScrollTop:j,states:r}),J},render(h){var o;const{$slots:t,className:T,clientSize:I,containerElement:C,data:g,getItemStyle:B,innerElement:w,itemsToRender:E,innerStyle:r,layout:u,total:x,onScroll:f,onScrollbarScroll:b,onWheel:D,states:z,useIsScrolling:U,windowStyle:ee,ns:G}=h,[Q,te]=E,j=Oe(C),J=Oe(w),S=[];if(x>0)for(let P=Q;P<=te;P++)S.push((o=t.default)==null?void 0:o.call(t,{data:g,key:P,index:P,isScrolling:U?z.isScrolling:void 0,style:B(P)}));const _=[Be(J,{style:r,ref:"innerRef"},wt(J)?S:{default:()=>S})],R=Be(Pa,{ref:"scrollbarRef",clientSize:I,layout:u,onScroll:b,ratio:100*I/this.estimatedTotalSize,scrollFrom:z.scrollOffset/(this.estimatedTotalSize-I),total:x}),K=Be(j,{class:[G.e("window"),T],style:ee,onScroll:f,onWheel:D,ref:"windowRef",key:0},wt(j)?[_]:{default:()=>[_]});return Be("div",{key:0,class:[G.e("wrapper"),z.scrollbarAlwaysOn?"always-on":""]},[K,R])}}),Ut=at({name:"ElFixedSizeList",getItemOffset:({itemSize:e},l)=>l*e,getItemSize:({itemSize:e})=>e,getEstimatedTotalSize:({total:e,itemSize:l})=>l*e,getOffset:({height:e,total:l,itemSize:n,layout:i,width:d},p,v,m)=>{const c=ke(i)?d:e,O=Math.max(0,l*n-c),h=Math.min(O,p*n),o=Math.max(0,(p+1)*n-c);switch(v===Kt&&(v=m>=o-c&&m<=h+c?lt:We),v){case Nt:return h;case $t:return o;case We:{const t=Math.round(o+(h-o)/2);return t<Math.ceil(c/2)?0:t>O+Math.floor(c/2)?O:t}default:return m>=o&&m<=h?m:m<o?o:h}},getStartIndexForOffset:({total:e,itemSize:l},n)=>Math.max(0,Math.min(e-1,Math.floor(n/l))),getStopIndexForStartIndex:({height:e,total:l,itemSize:n,layout:i,width:d},p,v)=>{const m=p*n,c=ke(i)?d:e,O=Math.ceil((c+v-m)/n);return Math.max(0,Math.min(l-1,p+O-1))},initCache(){},clearCache:!0,validateProps(){}}),ge=(e,l,n)=>{const{itemSize:i}=e,{items:d,lastVisitedIndex:p}=n;if(l>p){let v=0;if(p>=0){const m=d[p];v=m.offset+m.size}for(let m=p+1;m<=l;m++){const c=i(m);d[m]={offset:v,size:c},v+=c}n.lastVisitedIndex=l}return d[l]},ot=(e,l,n,i,d)=>{for(;n<=i;){const p=n+Math.floor((i-n)/2),v=ge(e,p,l).offset;if(v===d)return p;v<d?n=p+1:v>d&&(i=p-1)}return Math.max(0,n-1)},jt=(e,l,n,i)=>{const{total:d}=e;let p=1;for(;n<d&&ge(e,n,l).offset<i;)n+=p,p*=2;return ot(e,l,Math.floor(n/2),Math.min(n,d-1),i)},st=({total:e},{items:l,estimatedItemSize:n,lastVisitedIndex:i})=>{let d=0;if(i>=e&&(i=e-1),i>=0){const p=l[i];d=p.offset+p.size}return d+(e-i-1)*n},qt=at({name:"ElDynamicSizeList",getItemOffset:(e,l,n)=>ge(e,l,n).offset,getItemSize:(e,l,{items:n})=>n[l].size,getEstimatedTotalSize:st,getOffset:(e,l,n,i,d)=>{const{height:p,layout:v,width:m}=e,c=ke(v)?m:p,O=ge(e,l,d),h=st(e,d),o=Math.max(0,Math.min(h-c,O.offset)),t=Math.max(0,O.offset-c+O.size);switch(n===Kt&&(n=i>=t-c&&i<=o+c?lt:We),n){case Nt:return o;case $t:return t;case We:return Math.round(t+(o-t)/2);default:return i>=t&&i<=o?i:i<t?t:o}},getStartIndexForOffset:(e,l,n)=>((i,d,p)=>{const{items:v,lastVisitedIndex:m}=d;return(m>0?v[m].offset:0)>=p?ot(i,d,0,m,p):jt(i,d,Math.max(0,m),p)})(e,n,l),getStopIndexForStartIndex:(e,l,n,i)=>{const{height:d,total:p,layout:v,width:m}=e,c=ke(v)?m:d,O=ge(e,l,i),h=n+c;let o=O.offset+O.size,t=l;for(;t<p-1&&o<h;)t++,o+=ge(e,t,i).size;return t},initCache({estimatedItemSize:e=La},l){const n={items:{},estimatedItemSize:e,lastVisitedIndex:-1,clearCacheAfterIndex:(i,d=!0)=>{var p,v;n.lastVisitedIndex=Math.min(n.lastVisitedIndex,i-1),(p=l.exposed)==null||p.getItemStyleCache(-1),d&&((v=l.proxy)==null||v.$forceUpdate())}};return n},clearCache:!1,validateProps:({itemSize:e})=>{}});var Gt=Qe(ye({props:{item:{type:Object,required:!0},style:Object,height:Number},setup:()=>({ns:Se("select")})}),[["render",function(e,l,n,i,d,p){return e.item.isTitle?($(),q("div",{key:0,class:L(e.ns.be("group","title")),style:re([e.style,{lineHeight:`${e.height}px`}])},se(e.item.label),7)):($(),q("div",{key:1,class:L(e.ns.be("group","split")),style:re(e.style)},[X("span",{class:L(e.ns.be("group","split-dash")),style:re({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 nt={label:"label",value:"value",disabled:"disabled",options:"options"};function _e(e){const l=k(()=>({...nt,...e.props}));return{aliasProps:l,getLabel:n=>ne(n,l.value.label),getValue:n=>ne(n,l.value.value),getDisabled:n=>ne(n,l.value.disabled),getOptions:n=>ne(n,l.value.options)}}const Qt=Ct({allowCreate:Boolean,autocomplete:{type:ue(String),default:"none"},automaticDropdown:Boolean,clearable:Boolean,clearIcon:{type:wl,default:Cl},effect:{type:ue(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:ue([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:ue(Array),required:!0},placeholder:{type:String},teleported:Ol.teleported,persistent:{type:Boolean,default:!0},popperClass:{type:String,default:""},popperOptions:{type:ue(Object),default:()=>({})},remote:Boolean,size:Tl,props:{type:ue(Object),default:()=>nt},valueKey:{type:String,default:"value"},scrollbarAlwaysOn:{type:Boolean,default:!1},validateEvent:{type:Boolean,default:!0},placement:{type:ue(String),values:kl,default:"bottom-start"}}),Xt=Ct({data:Array,disabled:Boolean,hovering:Boolean,item:{type:ue(Object),required:!0},index:Number,style:Object,selected:Boolean,created:Boolean}),$e=Symbol("ElSelectV2Injection"),Yt=ye({props:Xt,emits:["select","hover"],setup(e,{emit:l}){const n=Ot($e),i=Se("select"),{hoverItem:d,selectOptionClick:p}=function(m,{emit:c}){return{hoverItem:()=>{m.disabled||c("hover",m.index)},selectOptionClick:()=>{m.disabled||c("select",m.item,m.index)}}}(e,{emit:l}),{getLabel:v}=_e(n.props);return{ns:i,hoverItem:d,selectOptionClick:p,getLabel:v}}}),Jt=["aria-selected"];var Zt=Qe(Yt,[["render",function(e,l,n,i,d,p){return $(),q("li",{"aria-selected":e.selected,style:re(e.style),class:L([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]=ae((...v)=>e.selectOptionClick&&e.selectOptionClick(...v),["stop"]))},[Ee(e.$slots,"default",{item:e.item,index:e.index,disabled:e.disabled},()=>[X("span",null,se(e.getLabel(e.item)),1)])],46,Jt)}],["__file","/home/runner/work/element-plus/element-plus/packages/components/select-v2/src/option-item.vue"]]),el=ye({name:"ElSelectDropdown",props:{data:{type:Array,required:!0},hoveringIndex:Number,width:Number},setup(e,{slots:l,expose:n}){const i=Ot($e),d=Se("select"),{getLabel:p,getValue:v,getDisabled:m}=_e(i.props),c=N([]),O=N(),h=k(()=>e.data.length);ve(()=>h.value,()=>{var r,u;(u=(r=i.popper.value).updatePopper)==null||u.call(r)});const o=k(()=>_l(i.props.estimatedOptionHeight)),t=k(()=>o.value?{itemSize:i.props.itemHeight}:{estimatedSize:i.props.estimatedOptionHeight,itemSize:r=>c.value[r]}),T=(r,u)=>i.props.multiple?((x=[],f)=>{const{props:{valueKey:b}}=i;return Le(f)?x&&x.some(D=>Ml(ne(D,b))===ne(f,b)):x.includes(f)})(r,v(u)):((x,f)=>{if(Le(f)){const{valueKey:b}=i.props;return ne(x,b)===ne(f,b)}return x===f})(r,v(u)),I=(r,u)=>{const{disabled:x,multiple:f,multipleLimit:b}=i.props;return x||!u&&!!f&&b>0&&r.length>=b},C=r=>e.hoveringIndex===r;n({listRef:O,isSized:o,isItemDisabled:I,isItemHovering:C,isItemSelected:T,scrollToItem:r=>{const u=O.value;u&&u.scrollToItem(r)},resetScrollTop:()=>{const r=O.value;r&&r.resetScrollTop()}});const g=r=>{const{index:u,data:x,style:f}=r,b=V(o),{itemSize:D,estimatedSize:z}=V(t),{modelValue:U}=i.props,{onSelect:ee,onHover:G}=i,Q=x[u];if(Q.type==="Group")return W(Gt,{item:Q,style:f,height:b?D:z},null);const te=T(U,Q),j=I(U,te),J=C(u);return W(Zt,de(r,{selected:te,disabled:m(Q)||j,created:!!Q.created,hovering:J,item:Q,onSelect:ee,onHover:G}),{default:S=>{var _;return((_=l.default)==null?void 0:_.call(l,S))||W("span",null,[p(Q)])}})},{onKeyboardNavigate:B,onKeyboardSelect:w}=i,E=r=>{const{code:u}=r,{tab:x,esc:f,down:b,up:D,enter:z}=zl;switch(u!==x&&(r.preventDefault(),r.stopPropagation()),u){case x:case f:i.expanded=!1;break;case b:B("forward");break;case D:B("backward");break;case z:w()}};return()=>{var r;const{data:u,width:x}=e,{height:f,multiple:b,scrollbarAlwaysOn:D}=i.props;if(u.length===0)return W("div",{class:d.b("dropdown"),style:{width:`${x}px`}},[(r=l.empty)==null?void 0:r.call(l)]);const z=V(o)?Ut:qt;return W("div",{class:[d.b("dropdown"),d.is("multiple",b)]},[W(z,de({ref:O},V(t),{className:d.be("dropdown","list"),scrollbarAlwaysOn:D,data:u,height:f,width:x,total:u.length,onKeydown:E}),{default:U=>W(g,U,null)})])}}});function tl(e,l){const{aliasProps:n,getLabel:i,getValue:d}=_e(e),p=N(0),v=N(null),m=k(()=>e.allowCreate&&e.filterable);return{createNewOption:function(c){if(m.value)if(c&&c.length>0&&!function(O){const h=o=>d(o)===O;return e.options&&e.options.some(h)||l.createdOptions.some(h)}(c)){const O={[n.value.value]:c,[n.value.label]:c,created:!0,[n.value.disabled]:!1};l.createdOptions.length>=p.value?l.createdOptions[p.value]=O:l.createdOptions.push(O)}else if(e.multiple)l.createdOptions.length=p.value;else{const O=v.value;l.createdOptions.length=0,O&&O.created&&l.createdOptions.push(O)}},removeNewOption:function(c){if(!m.value||!c||!c.created||c.created&&e.reserveKeyword&&l.inputValue===i(c))return;const O=l.createdOptions.findIndex(h=>d(h)===d(c));~O&&(l.createdOptions.splice(O,1),p.value--)},selectNewOption:function(c){m.value&&(e.multiple&&c.created?p.value++:v.value=c)},clearAllNewOption:function(){m.value&&(l.createdOptions.length=0,p.value=0)}}}const ll={larget:51,default:42,small:33},al=(e,l)=>{const{t:n}=Rl(),i=Se("select-v2"),d=Se("input"),{form:p,formItem:v}=Bl(),{getLabel:m,getValue:c,getDisabled:O,getOptions:h}=_e(e),o=Ye({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=N(-1),T=N(-1),I=N(null),C=N(null),g=N(null),B=N(null),w=N(null),E=N(null),r=N(null),u=N(!1),x=k(()=>e.disabled||(p==null?void 0:p.disabled)),f=k(()=>{const a=34*j.value.length;return a>e.height?e.height:a}),b=k(()=>!Tt(e.modelValue)),D=k(()=>{const a=e.multiple?Array.isArray(e.modelValue)&&e.modelValue.length>0:b.value;return e.clearable&&!x.value&&o.comboBoxHovering&&a}),z=k(()=>e.remote&&e.filterable?"":El),U=k(()=>z.value&&i.is("reverse",u.value)),ee=k(()=>(v==null?void 0:v.validateState)||""),G=k(()=>Ll[ee.value]),Q=k(()=>e.remote?300:0),te=k(()=>{const a=j.value;return e.loading?e.loadingText||n("el.select.loading"):(!e.remote||o.inputValue!==""||a.length!==0)&&(e.filterable&&o.inputValue&&a.length>0?e.noMatchText||n("el.select.noMatch"):a.length===0?e.noDataText||n("el.select.noData"):null)}),j=k(()=>{const a=s=>{const y=o.inputValue,M=new RegExp(Nl(y),"i");return!y||M.test(m(s)||"")};return e.loading?[]:[...e.options,...o.createdOptions].reduce((s,y)=>{const M=h(y);if(De(M)){const Y=M.filter(a);Y.length>0&&s.push({label:m(y),isTitle:!0,type:"Group"},...Y,{type:"Group"})}else(e.remote||a(y))&&s.push(y);return s},[])}),J=k(()=>{const a=new Map;return j.value.forEach((s,y)=>{a.set(be(c(s)),{option:s,index:y})}),a}),S=k(()=>j.value.every(a=>O(a))),_=Dl(),R=k(()=>_.value==="small"?"small":"default"),K=k(()=>{const a=E.value,s=R.value||"default",y=a?Number.parseInt(getComputedStyle(a).paddingLeft):0,M=a?Number.parseInt(getComputedStyle(a).paddingRight):0;return o.selectWidth-M-y-ll[s]}),P=()=>{var a;T.value=((a=w.value)==null?void 0:a.offsetWidth)||200},F=k(()=>({width:`${o.calculatedWidth===0?11:Math.ceil(o.calculatedWidth)+11}px`})),A=k(()=>De(e.modelValue)?e.modelValue.length===0&&!o.displayInputValue:!e.filterable||o.displayInputValue.length===0),H=k(()=>{const a=e.placeholder||n("el.select.placeholder");return e.multiple||Tt(e.modelValue)?a:o.selectedLabel}),oe=k(()=>{var a,s;return(s=(a=B.value)==null?void 0:a.popperRef)==null?void 0:s.contentRef}),Ie=k(()=>{if(e.multiple){const a=e.modelValue.length;if(e.modelValue.length>0&&J.value.has(e.modelValue[a-1])){const{index:s}=J.value.get(e.modelValue[a-1]);return s}}else if(e.modelValue&&J.value.has(e.modelValue)){const{index:a}=J.value.get(e.modelValue);return a}return-1}),we=k({get:()=>u.value&&te.value!==!1,set(a){u.value=a}}),ul=k(()=>o.cachedOptions.slice(0,e.maxCollapseTags)),dl=k(()=>o.cachedOptions.slice(e.maxCollapseTags)),{createNewOption:dt,removeNewOption:Ke,selectNewOption:pt,clearAllNewOption:He}=tl(e,o),{handleCompositionStart:pl,handleCompositionUpdate:ml,handleCompositionEnd:fl}=function(a){const s=N(!1);return{handleCompositionStart:()=>{s.value=!0},handleCompositionUpdate:y=>{const M=y.target.value,Y=M[M.length-1]||"";s.value=!Pl(Y)},handleCompositionEnd:y=>{s.value&&(s.value=!1,Xe(a)&&a(y))}}}(a=>It(a)),mt=()=>{var a,s,y;(s=(a=C.value)==null?void 0:a.focus)==null||s.call(a),(y=B.value)==null||y.updatePopper()},Ae=()=>{if(!e.automaticDropdown)return x.value?void 0:(o.isComposing&&(o.softFocus=!0),le(()=>{var a,s;u.value=!u.value,(s=(a=C.value)==null?void 0:a.focus)==null||s.call(a)}))},ft=()=>(e.filterable&&o.inputValue!==o.selectedLabel&&(o.query=o.selectedLabel),vt(o.inputValue),le(()=>{dt(o.inputValue)})),ht=Fl(ft,Q.value),vt=a=>{o.previousQuery!==a&&(o.previousQuery=a,e.filterable&&Xe(e.filterMethod)?e.filterMethod(a):e.filterable&&e.remote&&Xe(e.remoteMethod)&&e.remoteMethod(a))},Ce=a=>{l(_t,a),(s=>{kt(e.modelValue,s)||l(Mt,s)})(a),o.previousValue=String(a)},gt=(a=[],s)=>{if(!Le(s))return a.indexOf(s);const y=e.valueKey;let M=-1;return a.some((Y,ie)=>ne(Y,y)===ne(s,y)&&(M=ie,!0)),M},be=a=>Le(a)?ne(a,e.valueKey):a,Ue=()=>le(()=>{var a,s;if(!C.value)return;const y=E.value;w.value.height=y.offsetHeight,u.value&&te.value!==!1&&((s=(a=B.value)==null?void 0:a.updatePopper)==null||s.call(a))}),bt=()=>{var a,s;if(hl(),P(),(s=(a=B.value)==null?void 0:a.updatePopper)==null||s.call(a),e.multiple)return Ue()},hl=()=>{const a=E.value;a&&(o.selectWidth=a.getBoundingClientRect().width)},yt=(a,s,y=!0)=>{var M,Y;if(e.multiple){let ie=e.modelValue.slice();const Pe=gt(ie,c(a));Pe>-1?(ie=[...ie.slice(0,Pe),...ie.slice(Pe+1)],o.cachedOptions.splice(Pe,1),Ke(a)):(e.multipleLimit<=0||ie.length<e.multipleLimit)&&(ie=[...ie,c(a)],o.cachedOptions.push(a),pt(a),he(s)),Ce(ie),a.created&&(o.query="",vt(""),o.inputLength=20),e.filterable&&!e.reserveKeyword&&((Y=(M=C.value).focus)==null||Y.call(M),ze("")),e.filterable&&(o.calculatedWidth=r.value.getBoundingClientRect().width),Ue(),vl()}else t.value=s,o.selectedLabel=m(a),Ce(c(a)),u.value=!1,o.isComposing=!1,o.isSilentBlur=y,pt(a),a.created||He(),he(s)},St=a=>(o.softFocus=!1,le(()=>{var s,y;(y=(s=C.value)==null?void 0:s.blur)==null||y.call(s),r.value&&(o.calculatedWidth=r.value.getBoundingClientRect().width),o.isSilentBlur?o.isSilentBlur=!1:o.isComposing&&l("blur",a),o.isComposing=!1})),ze=a=>{o.displayInputValue=a,o.inputValue=a},xt=(a,s=void 0)=>{const y=j.value;if(!["forward","backward"].includes(a)||x.value||y.length<=0||S.value)return;if(!u.value)return Ae();s===void 0&&(s=o.hoveringIndex);let M=-1;a==="forward"?(M=s+1,M>=y.length&&(M=0)):a==="backward"&&(M=s-1,(M<0||M>=y.length)&&(M=y.length-1));const Y=y[M];if(O(Y)||Y.type==="Group")return xt(a,M);he(M),je(M)},he=a=>{o.hoveringIndex=a},Vt=()=>{o.hoveringIndex=-1},vl=()=>{var a;const s=C.value;s&&((a=s.focus)==null||a.call(s))},It=a=>{const s=a.target.value;if(ze(s),o.displayInputValue.length>0&&!u.value&&(u.value=!0),o.calculatedWidth=r.value.getBoundingClientRect().width,e.multiple&&Ue(),!e.remote)return ft();ht()},je=a=>{g.value.scrollToItem(a)},qe=()=>{if(Vt(),e.multiple)if(e.modelValue.length>0){let a=!1;o.cachedOptions.length=0,o.previousValue=e.modelValue.toString();for(const s of e.modelValue){const y=be(s);if(J.value.has(y)){const{index:M,option:Y}=J.value.get(y);o.cachedOptions.push(Y),a||he(M),a=!0}}}else o.cachedOptions=[],o.previousValue=void 0;else if(b.value){o.previousValue=e.modelValue;const a=j.value,s=a.findIndex(y=>be(c(y))===be(e.modelValue));~s?(o.selectedLabel=m(a[s]),he(s)):o.selectedLabel=be(e.modelValue)}else o.selectedLabel="",o.previousValue=void 0;He(),P()};return ve(u,a=>{var s,y;l("visible-change",a),a?(y=(s=B.value).update)==null||y.call(s):(o.displayInputValue="",o.previousQuery=null,dt(""))}),ve(()=>e.modelValue,(a,s)=>{var y;a&&a.toString()===o.previousValue||qe(),!kt(a,s)&&e.validateEvent&&((y=v==null?void 0:v.validate)==null||y.call(v,"change").catch(M=>Wl()))},{deep:!0}),ve(()=>e.options,()=>{const a=C.value;(!a||a&&document.activeElement!==a)&&qe()},{deep:!0}),ve(j,()=>g.value&&le(g.value.resetScrollTop)),ve(()=>we.value,a=>{a||Vt()}),Ge(()=>{qe()}),$l(w,bt),{collapseTagSize:R,currentPlaceholder:H,expanded:u,emptyText:te,popupHeight:f,debounce:Q,filteredOptions:j,iconComponent:z,iconReverse:U,inputWrapperStyle:F,popperSize:T,dropdownMenuVisible:we,hasModelValue:b,shouldShowPlaceholder:A,selectDisabled:x,selectSize:_,showClearBtn:D,states:o,tagMaxWidth:K,nsSelectV2:i,nsInput:d,calculatorRef:r,controlRef:I,inputRef:C,menuRef:g,popper:B,selectRef:w,selectionRef:E,popperRef:oe,validateState:ee,validateIcon:G,showTagList:ul,collapseTagList:dl,debouncedOnInputChange:ht,deleteTag:(a,s)=>{let y=e.modelValue.slice();const M=gt(y,c(s));if(M>-1&&!x.value)return y=[...e.modelValue.slice(0,M),...e.modelValue.slice(M+1)],o.cachedOptions.splice(M,1),Ce(y),l("remove-tag",c(s)),o.softFocus=!0,Ke(s),le(mt);a.stopPropagation()},getLabel:m,getValue:c,getDisabled:O,getValueKey:be,handleBlur:St,handleClear:()=>{let a;return a=De(e.modelValue)?[]:void 0,o.softFocus=!0,e.multiple?o.cachedOptions=[]:o.selectedLabel="",u.value=!1,Ce(a),l("clear"),He(),le(mt)},handleClickOutside:()=>(u.value=!1,St()),handleDel:a=>{if(o.displayInputValue.length===0){a.preventDefault();const s=e.modelValue.slice();s.pop(),Ke(o.cachedOptions.pop()),Ce(s)}},handleEsc:()=>{o.displayInputValue.length>0?ze(""):u.value=!1},handleFocus:a=>{const s=o.isComposing;o.isComposing=!0,o.softFocus?o.softFocus=!1:s||l("focus",a)},handleMenuEnter:()=>(o.inputValue=o.displayInputValue,le(()=>{~Ie.value&&(he(Ie.value),je(o.hoveringIndex))})),handleResize:bt,toggleMenu:Ae,scrollTo:je,onInput:It,onKeyboardNavigate:xt,onKeyboardSelect:()=>{if(!u.value)return Ae();~o.hoveringIndex&&j.value[o.hoveringIndex]&&yt(j.value[o.hoveringIndex],o.hoveringIndex,!1)},onSelect:yt,onHover:he,onUpdateInputValue:ze,handleCompositionStart:pl,handleCompositionEnd:fl,handleCompositionUpdate:ml}},ol=ye({name:"ElSelectV2",components:{ElSelectMenu:el,ElTag:Kl,ElTooltip:zt,ElIcon:Hl},directives:{ClickOutside:Al,ModelText:Ul},props:Qt,emits:[_t,Mt,"remove-tag","clear","visible-change","focus","blur"],setup(e,{emit:l}){const n=k(()=>{const{modelValue:d,multiple:p}=e,v=p?[]:void 0;return De(d)?p?d:v:p?v:d}),i=al(Ye({...Pt(e),modelValue:n}),l);return jl($e,{props:Ye({...Pt(e),height:i.popupHeight,modelValue:n}),popper:i.popper,onSelect:i.onSelect,onHover:i.onHover,onKeyboardNavigate:i.onKeyboardNavigate,onKeyboardSelect:i.onKeyboardSelect}),{...i,modelValue:n}}}),sl={key:0},nl=["id","autocomplete","aria-expanded","aria-labelledby","disabled","readonly","name","unselectable"],il=["textContent"],rl=["id","aria-labelledby","aria-expanded","autocomplete","disabled","name","readonly","unselectable"],cl=["textContent"];var Me=Qe(ol,[["render",function(e,l,n,i,d,p){const v=Fe("el-tag"),m=Fe("el-tooltip"),c=Fe("el-icon"),O=Fe("el-select-menu"),h=Je("model-text"),o=Je("click-outside");return xe(($(),q("div",{ref:"selectRef",class:L([e.nsSelectV2.b(),e.nsSelectV2.m(e.selectSize)]),onClick:l[24]||(l[24]=ae((...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)},[W(m,{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:Z(()=>[X("div",{ref:"selectionRef",class:L([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?($(),q("div",sl,[Ee(e.$slots,"prefix")])):pe("v-if",!0),e.multiple?($(),q("div",{key:1,class:L(e.nsSelectV2.e("selection"))},[e.collapseTags&&e.modelValue.length>0?($(),q(Ve,{key:0},[($(!0),q(Ve,null,Ze(e.showTagList,t=>($(),q("div",{key:e.getValueKey(e.getValue(t)),class:L(e.nsSelectV2.e("selected-item"))},[W(v,{closable:!e.selectDisabled&&!e.getDisabled(t),size:e.collapseTagSize,type:"info","disable-transitions":"",onClose:T=>e.deleteTag(T,t)},{default:Z(()=>[X("span",{class:L(e.nsSelectV2.e("tags-text")),style:re({maxWidth:`${e.tagMaxWidth}px`})},se(e.getLabel(t)),7)]),_:2},1032,["closable","size","onClose"])],2))),128)),X("div",{class:L(e.nsSelectV2.e("selected-item"))},[e.modelValue.length>e.maxCollapseTags?($(),me(v,{key:0,closable:!1,size:e.collapseTagSize,type:"info","disable-transitions":""},{default:Z(()=>[e.collapseTagsTooltip?($(),me(m,{key:0,disabled:e.dropdownMenuVisible,"fallback-placements":["bottom","top","right","left"],effect:e.effect,placement:"bottom",teleported:!1},{default:Z(()=>[X("span",{class:L(e.nsSelectV2.e("tags-text")),style:re({maxWidth:`${e.tagMaxWidth}px`})}," + "+se(e.modelValue.length-e.maxCollapseTags),7)]),content:Z(()=>[X("div",{class:L(e.nsSelectV2.e("selection"))},[($(!0),q(Ve,null,Ze(e.collapseTagList,t=>($(),q("div",{key:e.getValueKey(e.getValue(t)),class:L(e.nsSelectV2.e("selected-item"))},[W(v,{closable:!e.selectDisabled&&!e.getDisabled(t),size:e.collapseTagSize,class:"in-tooltip",type:"info","disable-transitions":"",onClose:T=>e.deleteTag(T,t)},{default:Z(()=>[X("span",{class:L(e.nsSelectV2.e("tags-text")),style:re({maxWidth:`${e.tagMaxWidth}px`})},se(e.getLabel(t)),7)]),_:2},1032,["closable","size","onClose"])],2))),128))],2)]),_:1},8,["disabled","effect"])):($(),q("span",{key:1,class:L(e.nsSelectV2.e("tags-text")),style:re({maxWidth:`${e.tagMaxWidth}px`})}," + "+se(e.modelValue.length-e.maxCollapseTags),7))]),_:1},8,["size"])):pe("v-if",!0)],2)],64)):($(!0),q(Ve,{key:1},Ze(e.states.cachedOptions,t=>($(),q("div",{key:e.getValueKey(e.getValue(t)),class:L(e.nsSelectV2.e("selected-item"))},[W(v,{closable:!e.selectDisabled&&!e.getDisabled(t),size:e.collapseTagSize,type:"info","disable-transitions":"",onClose:T=>e.deleteTag(T,t)},{default:Z(()=>[X("span",{class:L(e.nsSelectV2.e("tags-text")),style:re({maxWidth:`${e.tagMaxWidth}px`})},se(e.getLabel(t)),7)]),_:2},1032,["closable","size","onClose"])],2))),128)),X("div",{class:L([e.nsSelectV2.e("selected-item"),e.nsSelectV2.e("input-wrapper")]),style:re(e.inputWrapperStyle)},[xe(X("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:L([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]=ce(ae(t=>e.onKeyboardNavigate("backward"),["stop","prevent"]),["up"])),l[8]||(l[8]=ce(ae(t=>e.onKeyboardNavigate("forward"),["stop","prevent"]),["down"])),l[9]||(l[9]=ce(ae((...t)=>e.onKeyboardSelect&&e.onKeyboardSelect(...t),["stop","prevent"]),["enter"])),l[10]||(l[10]=ce(ae((...t)=>e.handleEsc&&e.handleEsc(...t),["stop","prevent"]),["esc"])),l[11]||(l[11]=ce(ae((...t)=>e.handleDel&&e.handleDel(...t),["stop"]),["delete"]))]},null,42,nl),[[h,e.states.displayInputValue]]),e.filterable?($(),q("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:L(e.nsSelectV2.e("input-calculator")),textContent:se(e.states.displayInputValue)},null,10,il)):pe("v-if",!0)],6)],2)):($(),q(Ve,{key:2},[X("div",{class:L([e.nsSelectV2.e("selected-item"),e.nsSelectV2.e("input-wrapper")])},[xe(X("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:L(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]=ce(ae(t=>e.onKeyboardNavigate("backward"),["stop","prevent"]),["up"])),l[19]||(l[19]=ce(ae(t=>e.onKeyboardNavigate("forward"),["stop","prevent"]),["down"])),l[20]||(l[20]=ce(ae((...t)=>e.onKeyboardSelect&&e.onKeyboardSelect(...t),["stop","prevent"]),["enter"])),l[21]||(l[21]=ce(ae((...t)=>e.handleEsc&&e.handleEsc(...t),["stop","prevent"]),["esc"]))],"onUpdate:modelValue":l[22]||(l[22]=(...t)=>e.onUpdateInputValue&&e.onUpdateInputValue(...t))},null,42,rl),[[h,e.states.displayInputValue]])],2),e.filterable?($(),q("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:L([e.nsSelectV2.e("selected-item"),e.nsSelectV2.e("input-calculator")]),textContent:se(e.states.displayInputValue)},null,10,cl)):pe("v-if",!0)],64)),e.shouldShowPlaceholder?($(),q("span",{key:3,class:L([e.nsSelectV2.e("placeholder"),e.nsSelectV2.is("transparent",e.multiple?e.modelValue.length===0:!e.hasModelValue)])},se(e.currentPlaceholder),3)):pe("v-if",!0),X("span",{class:L(e.nsSelectV2.e("suffix"))},[e.iconComponent?xe(($(),me(c,{key:0,class:L([e.nsSelectV2.e("caret"),e.nsInput.e("icon"),e.iconReverse])},{default:Z(()=>[($(),me(Oe(e.iconComponent)))]),_:1},8,["class"])),[[ql,!e.showClearBtn]]):pe("v-if",!0),e.showClearBtn&&e.clearIcon?($(),me(c,{key:1,class:L([e.nsSelectV2.e("caret"),e.nsInput.e("icon")]),onClick:ae(e.handleClear,["prevent","stop"])},{default:Z(()=>[($(),me(Oe(e.clearIcon)))]),_:1},8,["class","onClick"])):pe("v-if",!0),e.validateState&&e.validateIcon?($(),me(c,{key:2,class:L([e.nsInput.e("icon"),e.nsInput.e("validateIcon")])},{default:Z(()=>[($(),me(Oe(e.validateIcon)))]),_:1},8,["class"])):pe("v-if",!0)],2)],2)]),content:Z(()=>[W(O,{ref:"menuRef",data:e.filteredOptions,width:e.popperSize,"hovering-index":e.states.hoveringIndex,"scrollbar-always-on":e.scrollbarAlwaysOn},{default:Z(t=>[Ee(e.$slots,"default",Gl(Ql(t)))]),empty:Z(()=>[Ee(e.$slots,"empty",{},()=>[X("p",{class:L(e.nsSelectV2.e("empty"))},se(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"]]);Me.install=e=>{e.component(Me.name,Me)};let Ne,it;Ne={Radio:Rt,Checkbox:Bt,CheckboxButton:Bt,Input:Xl,Autocomplete:Yl,InputNumber:Jl,Select:Zl,Cascader:ea,Switch:ta,Slider:la,TimePicker:aa,DatePicker:oa,Rate:sa,ColorPicker:na,Transfer:ia,Divider:ra,TimeSelect:$a,SelectV2:Me,TreeSelect:Fa,RadioButton:Rt,InputPassword:Ka,Editor:Aa,UploadImg:qa,UploadImgs:Qa,UploadFile:Ya},fe=(e,l="default",n)=>{if(!e||!Reflect.has(e,l)||!ca(e[l]))return null;const i=e[l];return i?i(n):null},it=(e,l={},n)=>{const i={};for(const d in l)l[d]&&(i[d]=p=>fe(e,`${n}-${d}`,p));return i};function rt(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Oa(e)}let ct,ut;({getPrefixCls:ct}=ya()),ut=ct("form"),Ht=Za(ye({name:"Form",props:{schema:{type:Array,default:()=>[]},isCol:Te.bool.def(!1),model:{type:Object,default:()=>({})},autoSetPlaceholder:Te.bool.def(!0),isCustom:Te.bool.def(!1),labelWidth:Te.oneOfType([String,Number]).def("auto"),vLoading:Te.bool.def(!1)},emits:["register"],setup(e,{slots:l,expose:n,emit:i}){const d=N(),p=N({}),v=N({}),m=k(()=>{const t={...e};return Object.assign(t,V(v)),t}),c=N({});Ge(()=>{var t;i("register",(t=V(d))==null?void 0:t.$parent,V(d))}),n({setValues:(t={})=>{c.value=Object.assign(V(c),t)},formModel:c,setProps:(t={})=>{v.value=Object.assign(V(v),t),p.value=t},delSchema:t=>{const{schema:T}=V(m),I=Sa(T,C=>C.field===t);I>-1&&T.splice(I,1)},addSchema:(t,T)=>{const{schema:I}=V(m);T===void 0?I.push(t):I.splice(T,0,t)},setSchema:t=>{const{schema:T}=V(m);for(const I of T)for(const C of t)I.field===C.field&&xa(I,C.path,C.value)},getElFormRef:()=>V(d)}),ve(()=>V(m).schema,(t=[])=>{c.value=((T,I)=>{const C={...I};return T.map(g=>{if(g.hidden)delete C[g.field];else if(g.component&&g.component!=="Divider"){const B=Reflect.has(C,g.field);C[g.field]=B?C[g.field]:g.value!==void 0?g.value:""}}),C})(t,V(c))},{immediate:!0,deep:!0});const O=()=>{const{schema:t=[],isCol:T}=V(m);return t.filter(I=>!I.hidden).map(I=>{let C;return I.component==="Divider"?W(Ne.Divider,{contentPosition:"left",...I.componentProps},{default:()=>[I==null?void 0:I.label]}):T?W(Ia,((g={})=>({...g.span?{}:{xs:24,sm:12,md:12,lg:12,xl:12},...g}))(I.colProps),rt(C=h(I))?C:{default:()=>[C]}):h(I)})},h=t=>{var g,B;const T=["SelectV2","Cascader","Transfer"],I={...it(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"&&((B=t==null?void 0:t.componentProps)!=null&&B.options)&&(I.default=()=>o(t));const C=((w,E)=>{const r={};return w[`${E}-error`]&&(r.error=u=>fe(w,`${E}-error`,u)),w[`${E}-label`]&&(r.label=u=>fe(w,`${E}-label`,u)),r})(l,t.field);return t!=null&&t.labelMessage&&(C.label=()=>W(Ve,null,[W("span",null,[t.label]),W(zt,{placement:"right","raw-content":!0},{content:()=>xe(W("span",null,null),[[Je("dompurify-html"),t.labelMessage]]),default:()=>W(wa,{icon:"ep:warning",size:16,color:"var(--el-color-primary)",class:"relative top-1px ml-2px"},null)})])),W(Ca,de(t.formItemProps||{},{prop:t.field,label:t.label||""}),{...C,default:()=>{var r,u,x;const w=Ne[t.component],{autoSetPlaceholder:E}=V(m);return l[t.field]?fe(l,t.field,c.value):W(w,de({modelValue:c.value[t.field],"onUpdate:modelValue":f=>c.value[t.field]=f},E&&(f=>{var D,z;const{t:b}=ua();return["Input","Autocomplete","InputNumber","InputPassword"].includes(f==null?void 0:f.component)?{placeholder:b("common.inputText")+f.label}:["Select","SelectV2","TimePicker","DatePicker","TimeSelect","TimeSelect"].includes(f==null?void 0:f.component)?["datetimerange","daterange","monthrange","datetimerange","daterange"].includes(((D=f==null?void 0:f.componentProps)==null?void 0:D.type)||((z=f==null?void 0:f.componentProps)==null?void 0:z.isRange))?{startPlaceholder:b("common.startTimeText"),endPlaceholder:b("common.endTimeText"),rangeSeparator:"-"}:{placeholder:b("common.selectText")+f.label}:{}})(t),(f=>{const b=["ColorPicker"].includes(f.component)?{...f.componentProps}:{clearable:!0,...f.componentProps};return b==null||delete b.slots,b})(t),{style:(r=t.componentProps)==null?void 0:r.style},T.includes(t==null?void 0:t.component)&&((u=t==null?void 0:t.componentProps)!=null&&u.options)?{options:((x=t==null?void 0:t.componentProps)==null?void 0:x.options)||[]}:{}),{...I})}})},o=t=>{switch(t.component){case"Select":case"SelectV2":const{renderSelectOptions:T}=(g=>{const B=(w,E)=>{var D,z,U,ee;const r=(z=(D=w==null?void 0:w.componentProps)==null?void 0:D.optionsAlias)==null?void 0:z.labelField,u=(ee=(U=w==null?void 0:w.componentProps)==null?void 0:U.optionsAlias)==null?void 0:ee.valueField,{label:x,value:f,...b}=E;return W(pa,de(b,{label:r?E[r]:x,value:u?E[u]:f}),{default:()=>{var G;return(G=w==null?void 0:w.componentProps)!=null&&G.optionsSlot?fe(g,`${w.field}-option`,{item:E}):void 0}})};return{renderSelectOptions:w=>{var r,u,x,f;const E=(u=(r=w==null?void 0:w.componentProps)==null?void 0:r.optionsAlias)==null?void 0:u.labelField;return(f=(x=w==null?void 0:w.componentProps)==null?void 0:x.options)==null?void 0:f.map(b=>{var D;return(D=b==null?void 0:b.options)!=null&&D.length?W(da,{label:b[E||"label"]},{default:()=>{var z;return(z=b==null?void 0:b.options)==null?void 0:z.map(U=>B(w,U))}}):B(w,b)})}}})(l);return T(t);case"Radio":case"RadioButton":const{renderRadioOptions:I}={renderRadioOptions:g=>{var r,u,x,f,b,D;const B=(u=(r=g==null?void 0:g.componentProps)==null?void 0:r.optionsAlias)==null?void 0:u.labelField,w=(f=(x=g==null?void 0:g.componentProps)==null?void 0:x.optionsAlias)==null?void 0:f.valueField,E=g.component==="Radio"?ma:fa;return(D=(b=g==null?void 0:g.componentProps)==null?void 0:b.options)==null?void 0:D.map(z=>{const{...U}=z;return W(E,de(U,{label:z[w||"value"]}),{default:()=>[z[B||"label"]]})})}};return I(t);case"Checkbox":case"CheckboxButton":const{renderCheckboxOptions:C}={renderCheckboxOptions:g=>{var r,u,x,f,b,D;const B=(u=(r=g==null?void 0:g.componentProps)==null?void 0:r.optionsAlias)==null?void 0:u.labelField,w=(f=(x=g==null?void 0:g.componentProps)==null?void 0:x.optionsAlias)==null?void 0:f.valueField,E=g.component==="Checkbox"?ha:va;return(D=(b=g==null?void 0:g.componentProps)==null?void 0:b.options)==null?void 0:D.map(z=>{const{...U}=z;return W(E,de(U,{label:z[w||"value"]}),{default:()=>[z[B||"label"]]})})}};return C(t)}};return()=>xe(W(ba,de({ref:d},(()=>{const t=["schema","isCol","autoSetPlaceholder","isCustom","model"],T={...V(m)};for(const I in T)t.indexOf(I)!==-1&&delete T[I];return T})(),{model:e.isCustom?e.model:c,class:ut}),{default:()=>{const{isCustom:t}=V(m);return t?fe(l,"default"):(()=>{let T;const{isCol:I}=V(m);return I?W(Va,{gutter:20},rt(T=O())?T:{default:()=>[T]}):O()})()}}),[[ga,e.vLoading]])}}),[["__scopeId","data-v-39bc4695"]])});export{Ht as _,eo as __tla,fe as g};
|