You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
27 KiB
1 lines
27 KiB
import{z as nt,r as T,c as d,i as ye,d as K,ah as at,t as F,g as Se,k as re,P as ae,Q as $e,l as I,o as m,m as R,q as k,L as z,K as N,E as v,u as Ee,a3 as Me,R as oe,O as ol,A as G,D as $,M as ge,s as Le,b as A,_ as st,f as ne,am as ot,a as it,a8 as q,ai as rt,J as Q,H as L,G as P,F as Te,ab as ke,V as xe,a9 as te,an as ut,I as Re,ao as dt,p as il,X as ct}from"./vue.1762932289438.js";import{i as se,d as pt,u as el,e as ft,C as vt,E as bt}from"./popper.1762932289438.js";import{aJ as J,e as rl,$ as mt,a$ as Z,b3 as ht,k as Ce,l as ie,X as ul,P as gt,a5 as yt,al as St,b4 as Ct,b5 as Ot,b6 as wt,ab as ll,b7 as It,a6 as Vt,i as he,b8 as tl,h as Et,a1 as Tt,b9 as kt,U as Y,a0 as Rt,C as dl,a3 as Dt,ba as $t,f as W,a7 as Mt,O as nl,bb as Lt,a4 as Bt,bc as Nt,G as Pt,d as Wt,bd as zt,be as Ft,w as Kt,s as cl}from"./index.1762932289438.js";import{b as At,t as al,E as Ht}from"./tag.1762932289438.js";import{c as j}from"./form-item.1762932289438.js";function Ut(e,i,a,b){e.length;for(var p=a+1;p--;)if(i(e[p],p,e))return p;return-1}function Gt(e,i,a){var b=e==null?0:e.length;if(!b)return-1;var p=b-1;return Ut(e,At(i),p)}function jt(){const e=nt(),i=T(0),a=11,b=d(()=>({minWidth:`${Math.max(i.value,a)}px`}));return J(e,()=>{var S,t;i.value=(t=(S=e.value)==null?void 0:S.getBoundingClientRect().width)!=null?t:0}),{calculatorRef:e,calculatorWidth:i,inputStyle:b}}const pl=Symbol("ElSelectGroup"),Oe=Symbol("ElSelect"),De="ElOption",qt=rl({value:{type:[String,Number,Boolean,Object],required:!0},label:{type:[String,Number]},created:Boolean,disabled:Boolean});function Qt(e,i){const a=ye(Oe);a||mt(De,"usage: <el-select><el-option /></el-select/>");const b=ye(pl,{disabled:!1}),p=d(()=>f(j(a.props.modelValue),e.value)),S=d(()=>{var s;if(a.props.multiple){const c=j((s=a.props.modelValue)!=null?s:[]);return!p.value&&c.length>=a.props.multipleLimit&&a.props.multipleLimit>0}else return!1}),t=d(()=>{var s;return(s=e.label)!=null?s:K(e.value)?"":e.value}),C=d(()=>e.value||e.label||""),g=d(()=>e.disabled||i.groupDisabled||S.value),h=Se(),f=(s=[],c)=>{if(K(e.value)){const O=a.props.valueKey;return s&&s.some(V=>at(Z(V,O))===Z(c,O))}else return s&&s.includes(c)},r=()=>{!e.disabled&&!b.disabled&&(a.states.hoveringIndex=a.optionsArray.indexOf(h.proxy))},o=s=>{const c=new RegExp(ht(s),"i");i.visible=c.test(String(t.value))||e.created};return F(()=>t.value,()=>{!e.created&&!a.props.remote&&a.setSelected()}),F(()=>e.value,(s,c)=>{const{remote:O,valueKey:V}=a.props;if((O?s!==c:!se(s,c))&&(a.onOptionDestroy(c,h.proxy),a.onOptionCreate(h.proxy)),!e.created&&!O){if(V&&K(s)&&K(c)&&s[V]===c[V])return;a.setSelected()}}),F(()=>b.disabled,()=>{i.groupDisabled=b.disabled},{immediate:!0}),{select:a,currentLabel:t,currentValue:C,itemSelected:p,isDisabled:g,hoverItem:r,updateOption:o}}const Jt=re({name:De,componentName:De,props:qt,setup(e){const i=ie("select"),a=ul(),b=d(()=>[i.be("dropdown","item"),i.is("disabled",Ee(C)),i.is("selected",Ee(t)),i.is("hovering",Ee(o))]),p=oe({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:S,itemSelected:t,isDisabled:C,select:g,hoverItem:h,updateOption:f}=Qt(e,p),{visible:r,hover:o}=Me(p),s=Se().proxy;g.onOptionCreate(s),ol(()=>{const O=s.value;G(()=>{const{selected:V}=g.states,E=V.some(y=>y.value===s.value);g.states.cachedOptions.get(O)===s&&!E&&g.states.cachedOptions.delete(O)}),g.onOptionDestroy(O,s)});function c(){C.value||g.handleOptionSelect(s)}return{ns:i,id:a,containerKls:b,currentLabel:S,itemSelected:t,isDisabled:C,select:g,visible:r,hover:o,states:p,hoverItem:h,updateOption:f,selectOptionClick:c}}});function Xt(e,i){return ae((m(),I("li",{id:e.id,class:v(e.containerKls),role:"option","aria-disabled":e.isDisabled||void 0,"aria-selected":e.itemSelected,onMousemove:e.hoverItem,onClick:N(e.selectOptionClick,["stop"])},[R(e.$slots,"default",{},()=>[k("span",null,z(e.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMousemove","onClick"])),[[$e,e.visible]])}var Be=Ce(Jt,[["render",Xt],["__file","option.vue"]]);const Yt=re({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const e=ye(Oe),i=ie("select"),a=d(()=>e.props.popperClass),b=d(()=>e.props.multiple),p=d(()=>e.props.fitInputWidth),S=T("");function t(){var C;S.value=`${(C=e.selectRef)==null?void 0:C.offsetWidth}px`}return Le(()=>{t(),J(e.selectRef,t)}),{ns:i,minWidth:S,popperClass:a,isMultiple:b,isFitInputWidth:p}}});function Zt(e,i,a,b,p,S){return m(),I("div",{class:v([e.ns.b("dropdown"),e.ns.is("multiple",e.isMultiple),e.popperClass]),style:ge({[e.isFitInputWidth?"width":"minWidth"]:e.minWidth})},[e.$slots.header?(m(),I("div",{key:0,class:v(e.ns.be("dropdown","header"))},[R(e.$slots,"header")],2)):$("v-if",!0),R(e.$slots,"default"),e.$slots.footer?(m(),I("div",{key:1,class:v(e.ns.be("dropdown","footer"))},[R(e.$slots,"footer")],2)):$("v-if",!0)],6)}var _t=Ce(Yt,[["render",Zt],["__file","select-dropdown.vue"]]);const xt=(e,i)=>{const{t:a}=gt(),b=ul(),p=ie("select"),S=ie("input"),t=oe({inputValue:"",options:new Map,cachedOptions:new Map,optionValues:[],selected:[],selectionWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),C=T(),g=T(),h=T(),f=T(),r=T(),o=T(),s=T(),c=T(),O=T(),V=T(),E=T(),y=T(!1),B=T(),{form:ue,formItem:H}=yt(),{inputId:vl}=St(e,{formItemContext:H}),{valueOnClear:bl,isEmptyValue:ml}=Ct(e),{isComposing:Ne,handleCompositionStart:hl,handleCompositionUpdate:gl,handleCompositionEnd:yl}=Ot({afterComposition:l=>qe(l)}),_=d(()=>e.disabled||!!(ue!=null&&ue.disabled)),{wrapperRef:Pe,isFocused:We,handleBlur:Sl}=wt(r,{disabled:_,afterFocus(){e.automaticDropdown&&!y.value&&(y.value=!0,t.menuVisibleOnFocus=!0)},beforeBlur(l){var n,u;return((n=h.value)==null?void 0:n.isFocusInsideContent(l))||((u=f.value)==null?void 0:u.isFocusInsideContent(l))},afterBlur(){var l;y.value=!1,t.menuVisibleOnFocus=!1,e.validateEvent&&((l=H==null?void 0:H.validate)==null||l.call(H,"blur").catch(n=>ll()))}}),we=d(()=>A(e.modelValue)?e.modelValue.length>0:!ml(e.modelValue)),Cl=d(()=>{var l;return(l=ue==null?void 0:ue.statusIcon)!=null?l:!1}),Ol=d(()=>e.clearable&&!_.value&&t.inputHovering&&we.value),ze=d(()=>e.remote&&e.filterable&&!e.remoteShowSuffix?"":e.suffixIcon),wl=d(()=>p.is("reverse",!!(ze.value&&y.value))),Ie=d(()=>(H==null?void 0:H.validateState)||""),Il=d(()=>Ie.value&&It[Ie.value]),Vl=d(()=>e.remote?300:0),El=d(()=>e.remote&&!t.inputValue&&t.options.size===0),Tl=d(()=>e.loading?e.loadingText||a("el.select.loading"):e.filterable&&t.inputValue&&t.options.size>0&&x.value===0?e.noMatchText||a("el.select.noMatch"):t.options.size===0?e.noDataText||a("el.select.noData"):null),x=d(()=>D.value.filter(l=>l.visible).length),D=d(()=>{const l=Array.from(t.options.values()),n=[];return t.optionValues.forEach(u=>{const w=l.findIndex(M=>M.value===u);w>-1&&n.push(l[w])}),n.length>=l.length?n:l}),kl=d(()=>Array.from(t.cachedOptions.values())),Rl=d(()=>{const l=D.value.filter(n=>!n.created).some(n=>n.currentLabel===t.inputValue);return e.filterable&&e.allowCreate&&t.inputValue!==""&&!l}),Fe=()=>{e.filterable&&ne(e.filterMethod)||e.filterable&&e.remote&&ne(e.remoteMethod)||D.value.forEach(l=>{var n;(n=l.updateOption)==null||n.call(l,t.inputValue)})},Ke=Vt(),Dl=d(()=>["small"].includes(Ke.value)?"small":"default"),Ae=d({get(){return y.value&&!El.value},set(l){y.value=l}}),$l=d(()=>{if(e.multiple&&!he(e.modelValue))return j(e.modelValue).length===0&&!t.inputValue;const l=A(e.modelValue)?e.modelValue[0]:e.modelValue;return e.filterable||he(l)?!t.inputValue:!0}),Ml=d(()=>{var l;const n=(l=e.placeholder)!=null?l:a("el.select.placeholder");return e.multiple||!we.value?n:t.selectedLabel}),Ll=d(()=>tl?null:"mouseenter");F(()=>e.modelValue,(l,n)=>{e.multiple&&e.filterable&&!e.reserveKeyword&&(t.inputValue="",de("")),ce(),!se(l,n)&&e.validateEvent&&(H==null||H.validate("change").catch(u=>ll()))},{flush:"post",deep:!0}),F(()=>y.value,l=>{l?de(t.inputValue):(t.inputValue="",t.previousQuery=null,t.isBeforeHide=!0),i("visible-change",l)}),F(()=>t.options.entries(),()=>{Et&&(ce(),e.defaultFirstOption&&(e.filterable||e.remote)&&x.value&&He())},{flush:"post"}),F([()=>t.hoveringIndex,D],([l])=>{Tt(l)&&l>-1?B.value=D.value[l]||{}:B.value={},D.value.forEach(n=>{n.hover=B.value===n})}),st(()=>{t.isBeforeHide||Fe()});const de=l=>{t.previousQuery===l||Ne.value||(t.previousQuery=l,e.filterable&&ne(e.filterMethod)?e.filterMethod(l):e.filterable&&e.remote&&ne(e.remoteMethod)&&e.remoteMethod(l),e.defaultFirstOption&&(e.filterable||e.remote)&&x.value?G(He):G(Bl))},He=()=>{const l=D.value.filter(M=>M.visible&&!M.disabled&&!M.states.groupDisabled),n=l.find(M=>M.created),u=l[0],w=D.value.map(M=>M.value);t.hoveringIndex=Ye(w,n||u)},ce=()=>{if(e.multiple)t.selectedLabel="";else{const n=A(e.modelValue)?e.modelValue[0]:e.modelValue,u=Ue(n);t.selectedLabel=u.currentLabel,t.selected=[u];return}const l=[];he(e.modelValue)||j(e.modelValue).forEach(n=>{l.push(Ue(n))}),t.selected=l},Ue=l=>{let n;const u=ot(l);for(let X=t.cachedOptions.size-1;X>=0;X--){const U=kl.value[X];if(u?Z(U.value,e.valueKey)===Z(l,e.valueKey):U.value===l){n={value:l,currentLabel:U.currentLabel,get isDisabled(){return U.isDisabled}};break}}if(n)return n;const w=u?l.label:l??"";return{value:l,currentLabel:w}},Bl=()=>{t.hoveringIndex=D.value.findIndex(l=>t.selected.some(n=>ve(n)===ve(l)))},Nl=()=>{t.selectionWidth=Number.parseFloat(window.getComputedStyle(g.value).width)},Pl=()=>{t.collapseItemWidth=V.value.getBoundingClientRect().width},Ve=()=>{var l,n;(n=(l=h.value)==null?void 0:l.updatePopper)==null||n.call(l)},Ge=()=>{var l,n;(n=(l=f.value)==null?void 0:l.updatePopper)==null||n.call(l)},je=()=>{t.inputValue.length>0&&!y.value&&(y.value=!0),de(t.inputValue)},qe=l=>{if(t.inputValue=l.target.value,e.remote)Qe();else return je()},Qe=pt(()=>{je()},Vl.value),ee=l=>{se(e.modelValue,l)||i(dl,l)},Wl=l=>Gt(l,n=>{const u=t.cachedOptions.get(n);return u&&!u.disabled&&!u.states.groupDisabled}),zl=l=>{if(e.multiple&&l.code!==Rt.delete&&l.target.value.length<=0){const n=j(e.modelValue).slice(),u=Wl(n);if(u<0)return;const w=n[u];n.splice(u,1),i(Y,n),ee(n),i("remove-tag",w)}},Fl=(l,n)=>{const u=t.selected.indexOf(n);if(u>-1&&!_.value){const w=j(e.modelValue).slice();w.splice(u,1),i(Y,w),ee(w),i("remove-tag",n.value)}l.stopPropagation(),fe()},Je=l=>{l.stopPropagation();const n=e.multiple?[]:bl.value;if(e.multiple)for(const u of t.selected)u.isDisabled&&n.push(u.value);i(Y,n),ee(n),t.hoveringIndex=-1,y.value=!1,i("clear"),fe()},Xe=l=>{var n;if(e.multiple){const u=j((n=e.modelValue)!=null?n:[]).slice(),w=Ye(u,l);w>-1?u.splice(w,1):(e.multipleLimit<=0||u.length<e.multipleLimit)&&u.push(l.value),i(Y,u),ee(u),l.created&&de(""),e.filterable&&!e.reserveKeyword&&(t.inputValue="")}else i(Y,l.value),ee(l.value),y.value=!1;fe(),!y.value&&G(()=>{pe(l)})},Ye=(l,n)=>he(n)?-1:K(n.value)?l.findIndex(u=>se(Z(u,e.valueKey),ve(n))):l.indexOf(n.value),pe=l=>{var n,u,w,M,X;const U=A(l)?l[0]:l;let me=null;if(U!=null&&U.value){const le=D.value.filter(tt=>tt.value===U.value);le.length>0&&(me=le[0].$el)}if(h.value&&me){const le=(M=(w=(u=(n=h.value)==null?void 0:n.popperRef)==null?void 0:u.contentRef)==null?void 0:w.querySelector)==null?void 0:M.call(w,`.${p.be("dropdown","wrap")}`);le&&kt(le,me)}(X=E.value)==null||X.handleScroll()},Kl=l=>{t.options.set(l.value,l),t.cachedOptions.set(l.value,l)},Al=(l,n)=>{t.options.get(l)===n&&t.options.delete(l)},Hl=d(()=>{var l,n;return(n=(l=h.value)==null?void 0:l.popperRef)==null?void 0:n.contentRef}),Ul=()=>{t.isBeforeHide=!1,G(()=>{var l;(l=E.value)==null||l.update(),pe(t.selected)})},fe=()=>{var l;(l=r.value)==null||l.focus()},Gl=()=>{var l;if(y.value){y.value=!1,G(()=>{var n;return(n=r.value)==null?void 0:n.blur()});return}(l=r.value)==null||l.blur()},jl=l=>{Je(l)},ql=l=>{if(y.value=!1,We.value){const n=new FocusEvent("focus",l);G(()=>Sl(n))}},Ql=()=>{t.inputValue.length>0?t.inputValue="":y.value=!1},Ze=()=>{_.value||(tl&&(t.inputHovering=!0),t.menuVisibleOnFocus?t.menuVisibleOnFocus=!1:y.value=!y.value)},Jl=()=>{if(!y.value)Ze();else{const l=D.value[t.hoveringIndex];l&&!l.isDisabled&&Xe(l)}},ve=l=>K(l.value)?Z(l.value,e.valueKey):l.value,Xl=d(()=>D.value.filter(l=>l.visible).every(l=>l.isDisabled)),Yl=d(()=>e.multiple?e.collapseTags?t.selected.slice(0,e.maxCollapseTags):t.selected:[]),Zl=d(()=>e.multiple?e.collapseTags?t.selected.slice(e.maxCollapseTags):[]:[]),_e=l=>{if(!y.value){y.value=!0;return}if(!(t.options.size===0||x.value===0||Ne.value)&&!Xl.value){l==="next"?(t.hoveringIndex++,t.hoveringIndex===t.options.size&&(t.hoveringIndex=0)):l==="prev"&&(t.hoveringIndex--,t.hoveringIndex<0&&(t.hoveringIndex=t.options.size-1));const n=D.value[t.hoveringIndex];(n.isDisabled||!n.visible)&&_e(l),G(()=>pe(B.value))}},_l=()=>{if(!g.value)return 0;const l=window.getComputedStyle(g.value);return Number.parseFloat(l.gap||"6px")},xl=d(()=>{const l=_l();return{maxWidth:`${V.value&&e.maxCollapseTags===1?t.selectionWidth-t.collapseItemWidth-l:t.selectionWidth}px`}}),et=d(()=>({maxWidth:`${t.selectionWidth}px`})),lt=l=>{i("popup-scroll",l)};J(g,Nl),J(Pe,Ve),J(O,Ge),J(V,Pl);let be;return F(()=>Ae.value,l=>{l?be=J(c,Ve).stop:(be==null||be(),be=void 0)}),Le(()=>{ce()}),{inputId:vl,contentId:b,nsSelect:p,nsInput:S,states:t,isFocused:We,expanded:y,optionsArray:D,hoverOption:B,selectSize:Ke,filteredOptionsCount:x,updateTooltip:Ve,updateTagTooltip:Ge,debouncedOnInputChange:Qe,onInput:qe,deletePrevTag:zl,deleteTag:Fl,deleteSelected:Je,handleOptionSelect:Xe,scrollToOption:pe,hasModelValue:we,shouldShowPlaceholder:$l,currentPlaceholder:Ml,mouseEnterEventName:Ll,needStatusIcon:Cl,showClose:Ol,iconComponent:ze,iconReverse:wl,validateState:Ie,validateIcon:Il,showNewOption:Rl,updateOptions:Fe,collapseTagSize:Dl,setSelected:ce,selectDisabled:_,emptyText:Tl,handleCompositionStart:hl,handleCompositionUpdate:gl,handleCompositionEnd:yl,onOptionCreate:Kl,onOptionDestroy:Al,handleMenuEnter:Ul,focus:fe,blur:Gl,handleClearClick:jl,handleClickOutside:ql,handleEsc:Ql,toggleMenu:Ze,selectOption:Jl,getValueKey:ve,navigateOptions:_e,dropdownMenuVisible:Ae,showTagList:Yl,collapseTagList:Zl,popupScroll:lt,tagStyle:xl,collapseTagStyle:et,popperRef:Hl,inputRef:r,tooltipRef:h,tagTooltipRef:f,prefixRef:o,suffixRef:s,selectRef:C,wrapperRef:Pe,selectionRef:g,scrollbarRef:E,menuRef:c,tagMenuRef:O,collapseItemRef:V}};var en=re({name:"ElOptions",setup(e,{slots:i}){const a=ye(Oe);let b=[];return()=>{var p,S;const t=(p=i.default)==null?void 0:p.call(i),C=[];function g(h){A(h)&&h.forEach(f=>{var r,o,s,c;const O=(r=(f==null?void 0:f.type)||{})==null?void 0:r.name;O==="ElOptionGroup"?g(!it(f.children)&&!A(f.children)&&ne((o=f.children)==null?void 0:o.default)?(s=f.children)==null?void 0:s.default():f.children):O==="ElOption"?C.push((c=f.props)==null?void 0:c.value):A(f.children)&&g(f.children)})}return t.length&&g((S=t[0])==null?void 0:S.children),se(C,b)||(b=C,a&&(a.states.optionValues=C)),t}}});const ln=rl({name:String,id:String,modelValue:{type:W([Array,String,Number,Boolean,Object]),default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:Bt,effect:{type:W(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:W(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:{type:W(Function)},filterMethod:{type:W(Function)},multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:el.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:nl,default:Lt},fitInputWidth:Boolean,suffixIcon:{type:nl,default:Mt},tagType:{...al.type,default:"info"},tagEffect:{...al.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,showArrow:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:W(String),values:ft,default:"bottom-start"},fallbackPlacements:{type:W(Array),default:["bottom-start","top-start","right","left"]},tabindex:{type:[String,Number],default:0},appendTo:el.appendTo,options:{type:W(Array)},props:{type:W(Object)},...$t,...Dt(["ariaLabel"])});Nt.scroll;const sl="ElSelect",tn=re({name:sl,componentName:sl,components:{ElSelectMenu:_t,ElOption:Be,ElOptions:en,ElTag:Ht,ElScrollbar:Wt,ElTooltip:bt,ElIcon:Pt},directives:{ClickOutside:vt},props:ln,emits:[Y,dl,"remove-tag","clear","visible-change","focus","blur","popup-scroll"],setup(e,{emit:i,slots:a}){const b=Se();b.appContext.config.warnHandler=(...o)=>{!o[0]||o[0].includes('Slot "default" invoked outside of the render function')||console.warn(...o)};const p=d(()=>{const{modelValue:o,multiple:s}=e,c=s?[]:void 0;return A(o)?s?o:c:s?c:o}),S=oe({...Me(e),modelValue:p}),t=xt(S,i),{calculatorRef:C,inputStyle:g}=jt(),h=o=>o.reduce((s,c)=>(s.push(c),c.children&&c.children.length>0&&s.push(...h(c.children)),s),[]),f=o=>{zt(o||[]).forEach(c=>{var O;if(K(c)&&(c.type.name==="ElOption"||c.type.name==="ElTree")){const V=c.type.name;if(V==="ElTree"){const E=((O=c.props)==null?void 0:O.data)||[];h(E).forEach(B=>{B.currentLabel=B.label||(K(B.value)?"":B.value),t.onOptionCreate(B)})}else if(V==="ElOption"){const E={...c.props};E.currentLabel=E.label||(K(E.value)?"":E.value),t.onOptionCreate(E)}}})};F(()=>{var o;return(o=a.default)==null?void 0:o.call(a)},o=>{e.persistent||f(o)},{immediate:!0}),il(Oe,oe({props:S,states:t.states,selectRef:t.selectRef,optionsArray:t.optionsArray,setSelected:t.setSelected,handleOptionSelect:t.handleOptionSelect,onOptionCreate:t.onOptionCreate,onOptionDestroy:t.onOptionDestroy}));const r=d(()=>e.multiple?t.states.selected.map(o=>o.currentLabel):t.states.selectedLabel);return ol(()=>{b.appContext.config.warnHandler=void 0}),{...t,modelValue:p,selectedLabel:r,calculatorRef:C,inputStyle:g}}});function nn(e,i){const a=q("el-tag"),b=q("el-tooltip"),p=q("el-icon"),S=q("el-option"),t=q("el-options"),C=q("el-scrollbar"),g=q("el-select-menu"),h=rt("click-outside");return ae((m(),I("div",{ref:"selectRef",class:v([e.nsSelect.b(),e.nsSelect.m(e.selectSize)]),[dt(e.mouseEnterEventName)]:f=>e.states.inputHovering=!0,onMouseleave:f=>e.states.inputHovering=!1},[Q(b,{ref:"tooltipRef",visible:e.dropdownMenuVisible,placement:e.placement,teleported:e.teleported,"popper-class":[e.nsSelect.e("popper"),e.popperClass],"popper-options":e.popperOptions,"fallback-placements":e.fallbackPlacements,effect:e.effect,pure:"",trigger:"click",transition:`${e.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:e.persistent,"append-to":e.appendTo,"show-arrow":e.showArrow,offset:e.offset,onBeforeShow:e.handleMenuEnter,onHide:f=>e.states.isBeforeHide=!1},{default:L(()=>{var f;return[k("div",{ref:"wrapperRef",class:v([e.nsSelect.e("wrapper"),e.nsSelect.is("focused",e.isFocused),e.nsSelect.is("hovering",e.states.inputHovering),e.nsSelect.is("filterable",e.filterable),e.nsSelect.is("disabled",e.selectDisabled)]),onClick:N(e.toggleMenu,["prevent"])},[e.$slots.prefix?(m(),I("div",{key:0,ref:"prefixRef",class:v(e.nsSelect.e("prefix"))},[R(e.$slots,"prefix")],2)):$("v-if",!0),k("div",{ref:"selectionRef",class:v([e.nsSelect.e("selection"),e.nsSelect.is("near",e.multiple&&!e.$slots.prefix&&!!e.states.selected.length)])},[e.multiple?R(e.$slots,"tag",{key:0,data:e.states.selected,deleteTag:e.deleteTag,selectDisabled:e.selectDisabled},()=>[(m(!0),I(Te,null,ke(e.showTagList,r=>(m(),I("div",{key:e.getValueKey(r),class:v(e.nsSelect.e("selected-item"))},[Q(a,{closable:!e.selectDisabled&&!r.isDisabled,size:e.collapseTagSize,type:e.tagType,effect:e.tagEffect,"disable-transitions":"",style:ge(e.tagStyle),onClose:o=>e.deleteTag(o,r)},{default:L(()=>[k("span",{class:v(e.nsSelect.e("tags-text"))},[R(e.$slots,"label",{label:r.currentLabel,value:r.value},()=>[xe(z(r.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),e.collapseTags&&e.states.selected.length>e.maxCollapseTags?(m(),P(b,{key:0,ref:"tagTooltipRef",disabled:e.dropdownMenuVisible||!e.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:e.effect,placement:"bottom","popper-class":e.popperClass,teleported:e.teleported},{default:L(()=>[k("div",{ref:"collapseItemRef",class:v(e.nsSelect.e("selected-item"))},[Q(a,{closable:!1,size:e.collapseTagSize,type:e.tagType,effect:e.tagEffect,"disable-transitions":"",style:ge(e.collapseTagStyle)},{default:L(()=>[k("span",{class:v(e.nsSelect.e("tags-text"))}," + "+z(e.states.selected.length-e.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:L(()=>[k("div",{ref:"tagMenuRef",class:v(e.nsSelect.e("selection"))},[(m(!0),I(Te,null,ke(e.collapseTagList,r=>(m(),I("div",{key:e.getValueKey(r),class:v(e.nsSelect.e("selected-item"))},[Q(a,{class:"in-tooltip",closable:!e.selectDisabled&&!r.isDisabled,size:e.collapseTagSize,type:e.tagType,effect:e.tagEffect,"disable-transitions":"",onClose:o=>e.deleteTag(o,r)},{default:L(()=>[k("span",{class:v(e.nsSelect.e("tags-text"))},[R(e.$slots,"label",{label:r.currentLabel,value:r.value},()=>[xe(z(r.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","popper-class","teleported"])):$("v-if",!0)]):$("v-if",!0),k("div",{class:v([e.nsSelect.e("selected-item"),e.nsSelect.e("input-wrapper"),e.nsSelect.is("hidden",!e.filterable)])},[ae(k("input",{id:e.inputId,ref:"inputRef","onUpdate:modelValue":r=>e.states.inputValue=r,type:"text",name:e.name,class:v([e.nsSelect.e("input"),e.nsSelect.is(e.selectSize)]),disabled:e.selectDisabled,autocomplete:e.autocomplete,style:ge(e.inputStyle),tabindex:e.tabindex,role:"combobox",readonly:!e.filterable,spellcheck:"false","aria-activedescendant":((f=e.hoverOption)==null?void 0:f.id)||"","aria-controls":e.contentId,"aria-expanded":e.dropdownMenuVisible,"aria-label":e.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[te(N(r=>e.navigateOptions("next"),["stop","prevent"]),["down"]),te(N(r=>e.navigateOptions("prev"),["stop","prevent"]),["up"]),te(N(e.handleEsc,["stop","prevent"]),["esc"]),te(N(e.selectOption,["stop","prevent"]),["enter"]),te(N(e.deletePrevTag,["stop"]),["delete"])],onCompositionstart:e.handleCompositionStart,onCompositionupdate:e.handleCompositionUpdate,onCompositionend:e.handleCompositionEnd,onInput:e.onInput,onClick:N(e.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","tabindex","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[ut,e.states.inputValue]]),e.filterable?(m(),I("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:v(e.nsSelect.e("input-calculator")),textContent:z(e.states.inputValue)},null,10,["textContent"])):$("v-if",!0)],2),e.shouldShowPlaceholder?(m(),I("div",{key:1,class:v([e.nsSelect.e("selected-item"),e.nsSelect.e("placeholder"),e.nsSelect.is("transparent",!e.hasModelValue||e.expanded&&!e.states.inputValue)])},[e.hasModelValue?R(e.$slots,"label",{key:0,label:e.currentPlaceholder,value:e.modelValue},()=>[k("span",null,z(e.currentPlaceholder),1)]):(m(),I("span",{key:1},z(e.currentPlaceholder),1))],2)):$("v-if",!0)],2),k("div",{ref:"suffixRef",class:v(e.nsSelect.e("suffix"))},[e.iconComponent&&!e.showClose?(m(),P(p,{key:0,class:v([e.nsSelect.e("caret"),e.nsSelect.e("icon"),e.iconReverse])},{default:L(()=>[(m(),P(Re(e.iconComponent)))]),_:1},8,["class"])):$("v-if",!0),e.showClose&&e.clearIcon?(m(),P(p,{key:1,class:v([e.nsSelect.e("caret"),e.nsSelect.e("icon"),e.nsSelect.e("clear")]),onClick:e.handleClearClick},{default:L(()=>[(m(),P(Re(e.clearIcon)))]),_:1},8,["class","onClick"])):$("v-if",!0),e.validateState&&e.validateIcon&&e.needStatusIcon?(m(),P(p,{key:2,class:v([e.nsInput.e("icon"),e.nsInput.e("validateIcon"),e.nsInput.is("loading",e.validateState==="validating")])},{default:L(()=>[(m(),P(Re(e.validateIcon)))]),_:1},8,["class"])):$("v-if",!0)],2)],10,["onClick"])]}),content:L(()=>[Q(g,{ref:"menuRef"},{default:L(()=>[e.$slots.header?(m(),I("div",{key:0,class:v(e.nsSelect.be("dropdown","header")),onClick:N(()=>{},["stop"])},[R(e.$slots,"header")],10,["onClick"])):$("v-if",!0),ae(Q(C,{id:e.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":e.nsSelect.be("dropdown","wrap"),"view-class":e.nsSelect.be("dropdown","list"),class:v([e.nsSelect.is("empty",e.filteredOptionsCount===0)]),role:"listbox","aria-label":e.ariaLabel,"aria-orientation":"vertical",onScroll:e.popupScroll},{default:L(()=>[e.showNewOption?(m(),P(S,{key:0,value:e.states.inputValue,created:!0},null,8,["value"])):$("v-if",!0),Q(t,null,{default:L(()=>[R(e.$slots,"default",{},()=>[(m(!0),I(Te,null,ke(e.options,(f,r)=>{var o,s,c,O,V,E;return m(),P(S,{key:r,label:f[(s=(o=e.props)==null?void 0:o.label)!=null?s:"label"],value:f[(O=(c=e.props)==null?void 0:c.value)!=null?O:"value"],disabled:f[(E=(V=e.props)==null?void 0:V.disabled)!=null?E:"disabled"]},null,8,["label","value","disabled"])}),128))])]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label","onScroll"]),[[$e,e.states.options.size>0&&!e.loading]]),e.$slots.loading&&e.loading?(m(),I("div",{key:1,class:v(e.nsSelect.be("dropdown","loading"))},[R(e.$slots,"loading")],2)):e.loading||e.filteredOptionsCount===0?(m(),I("div",{key:2,class:v(e.nsSelect.be("dropdown","empty"))},[R(e.$slots,"empty",{},()=>[k("span",null,z(e.emptyText),1)])],2)):$("v-if",!0),e.$slots.footer?(m(),I("div",{key:3,class:v(e.nsSelect.be("dropdown","footer")),onClick:N(()=>{},["stop"])},[R(e.$slots,"footer")],10,["onClick"])):$("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","append-to","show-arrow","offset","onBeforeShow","onHide"])],16,["onMouseleave"])),[[h,e.handleClickOutside,e.popperRef]])}var an=Ce(tn,[["render",nn],["__file","select.vue"]]);const sn=re({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(e){const i=ie("select"),a=T(),b=Se(),p=T([]);il(pl,oe({...Me(e)}));const S=d(()=>p.value.some(h=>h.visible===!0)),t=h=>{var f;return h.type.name==="ElOption"&&!!((f=h.component)!=null&&f.proxy)},C=h=>{const f=j(h),r=[];return f.forEach(o=>{var s;ct(o)&&(t(o)?r.push(o.component.proxy):A(o.children)&&o.children.length?r.push(...C(o.children)):(s=o.component)!=null&&s.subTree&&r.push(...C(o.component.subTree)))}),r},g=()=>{p.value=C(b.subTree)};return Le(()=>{g()}),Ft(a,g,{attributes:!0,subtree:!0,childList:!0}),{groupRef:a,visible:S,ns:i}}});function on(e,i,a,b,p,S){return ae((m(),I("ul",{ref:"groupRef",class:v(e.ns.be("group","wrap"))},[k("li",{class:v(e.ns.be("group","title"))},z(e.label),3),k("li",null,[k("ul",{class:v(e.ns.b("group"))},[R(e.$slots,"default")],2)])],2)),[[$e,e.visible]])}var fl=Ce(sn,[["render",on],["__file","option-group.vue"]]);const fn=Kt(an,{Option:Be,OptionGroup:fl}),vn=cl(Be);cl(fl);export{fn as E,vn as a,Oe as s};
|
|
|