@acedatacloud/nexior 3.24.0 → 3.24.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{Auth-U3yYMWPb.js → Auth-DTWbVCp6.js} +1 -1
- package/dist/assets/{BotPlaceholder-DKPNFbIr.js → BotPlaceholder-BgP8q68w.js} +1 -1
- package/dist/assets/{Callback-CVMoquq2.js → Callback-Cb9A2lu5.js} +1 -1
- package/dist/assets/{Console-CTJZPHmF.js → Console-DKm795jt.js} +1 -1
- package/dist/assets/{Conversation-BS7L0VcC.js → Conversation-Dk0fhTtm.js} +2 -2
- package/dist/assets/{CopyToClipboard-CzE5Qyes.js → CopyToClipboard-C_xMmtDc.js} +1 -1
- package/dist/assets/{Detail-C3oYMO6J.js → Detail-DrLS-v5M.js} +1 -1
- package/dist/assets/{EditArray-C1bpV3sz.js → EditArray-ClJUMpk4.js} +1 -1
- package/dist/assets/{Extra-DbeIRzak.js → Extra-DIxRDCsF.js} +1 -1
- package/dist/assets/{FilePreview-CDzbEEK9.js → FilePreview-Br7iuVJu.js} +1 -1
- package/dist/assets/{History-CIxJTX4E.js → History-DCtkx2Uv.js} +1 -1
- package/dist/assets/{ImagePreview-VnpfW9Pj.js → ImagePreview-D_L90Mc7.js} +1 -1
- package/dist/assets/{ImageWrapper-C2PohC6W.js → ImageWrapper-Pritl6ia.js} +1 -1
- package/dist/assets/{Index-BkVsyXyu.js → Index--R6Mez1e.js} +1 -1
- package/dist/assets/{Index-BDLsUrH_.js → Index-3BrY7GTD.js} +1 -1
- package/dist/assets/{Index-CHJJxQZZ.js → Index-BGpRIRnJ.js} +1 -1
- package/dist/assets/{Index-BZdHsOL7.js → Index-BKRMsAnb.js} +1 -1
- package/dist/assets/{Index-DNUO_WLR.js → Index-BOd6hidv.js} +1 -1
- package/dist/assets/{Index-BfanYqxM.js → Index-C7oPQwl1.js} +1 -1
- package/dist/assets/Index-CByCCg-O.css +1 -0
- package/dist/assets/{Index-QhofBqyo.js → Index-CIQ_Kr5J.js} +1 -1
- package/dist/assets/{Index-DYEsXBUc.js → Index-CXaW3ysi.js} +1 -1
- package/dist/assets/{Index-c9YVJIU8.js → Index-CtvpUe3c.js} +1 -1
- package/dist/assets/{Index-DNxQOH2I.js → Index-CxLpwFuf.js} +1 -1
- package/dist/assets/{Index-BqnAzyak.js → Index-DGBKmiyr.js} +1 -1
- package/dist/assets/Index-DIoE-xqc.js +1 -0
- package/dist/assets/{Index-DxTCv_hq.js → Index-DY2ratY8.js} +1 -1
- package/dist/assets/Index-DkScbE8t.js +1 -0
- package/dist/assets/Index-H2tBAlzy.css +1 -0
- package/dist/assets/{Index-UvepuNe-.js → Index-Ky0a79So.js} +1 -1
- package/dist/assets/{Index-D-RFeTM-.js → Index-uEyIppRg.js} +1 -1
- package/dist/assets/{InfoIcon-htaT17q9.js → InfoIcon-cglftkH2.js} +1 -1
- package/dist/assets/{Invitees-BFsoobgF.js → Invitees-Bp3ntf_X.js} +1 -1
- package/dist/assets/{List-DX0aA1uB.js → List-DnT5KyyU.js} +1 -1
- package/dist/assets/{List-D3J3Rfhh.js → List-cBcRn9xk.js} +1 -1
- package/dist/assets/{List-X5PnY5tK.js → List-sD7bv3K1.js} +1 -1
- package/dist/assets/{Login-DSWYve0k.js → Login-Bqwz79l3.js} +1 -1
- package/dist/assets/{Main-DnQIo5_J.js → Main-CVFNdoBS.js} +1 -1
- package/dist/assets/{Navigator-CFx-t1E0.js → Navigator-DZb9560y.js} +1 -1
- package/dist/assets/{NoTasks-DHdI1Frr.js → NoTasks-B6hLJrko.js} +1 -1
- package/dist/assets/{Pagination-DcQVmu45.js → Pagination-BYFbwkF0.js} +1 -1
- package/dist/assets/{Status-C3EStxoL.js → Status-CsL--y5f.js} +1 -1
- package/dist/assets/{Subscribe-C7U8Yb7_.js → Subscribe-DIcCgCzT.js} +1 -1
- package/dist/assets/{VideoPlayer-DCap_X2q.js → VideoPlayer-CjCdW8Fe.js} +1 -1
- package/dist/assets/{_baseClone-B6o0klpv.js → _baseClone-DiKhUhxc.js} +1 -1
- package/dist/assets/{_baseIteratee-Bk7QROEW.js → _baseIteratee-7W3vde5j.js} +1 -1
- package/dist/assets/{_initCloneObject-iRvJrG7M.js → _initCloneObject-CwAtjxb1.js} +1 -1
- package/dist/assets/{castArray-CoJ3z4SB.js → castArray-7tYrhn6A.js} +1 -1
- package/dist/assets/{debounce-CEE_CsrA.js → debounce-09KXX3DN.js} +1 -1
- package/dist/assets/{distribution-pW96wtpU.js → distribution-tLpcb6Nq.js} +1 -1
- package/dist/assets/{dropdown-CfSu6_B-.js → dropdown-UbXA6R_N.js} +1 -1
- package/dist/assets/{index-BZHTBEqD.js → index-3k3mWDTk.js} +1 -1
- package/dist/assets/{index-Czog4o5z.js → index-7746Wyq5.js} +1 -1
- package/dist/assets/{index-DNzgGVij.js → index-B-7UQmSa.js} +1 -1
- package/dist/assets/{index-z-6wtqoM.js → index-BAMr6BWr.js} +1 -1
- package/dist/assets/{index-Colfa9sv.js → index-BCo-Le3_.js} +1 -1
- package/dist/assets/{index-DTBHHHz_.js → index-BQWF6H8D.js} +1 -1
- package/dist/assets/{index-CLOiWNZO.js → index-BX6sU3GX.js} +1 -1
- package/dist/assets/{index--xRF9A-K.js → index-BbDlaK5a.js} +1 -1
- package/dist/assets/{index-CLwJbfYs.js → index-BjMVMy9y.js} +33 -33
- package/dist/assets/{index-d2CvBCAu.js → index-Bk6FKSGz.js} +1 -1
- package/dist/assets/{index-AT7DtKgl.js → index-BzF_Ko5s.js} +1 -1
- package/dist/assets/{index-BU5-qzoD.js → index-CCO_ODiz.js} +1 -1
- package/dist/assets/{index-H2WJr-nr.js → index-CEhCMEW7.js} +1 -1
- package/dist/assets/{index-Cs65NgP9.js → index-CEpvbqDt.js} +1 -1
- package/dist/assets/{index-C1s2diPf.js → index-CQ2bsd-r.js} +1 -1
- package/dist/assets/{index-CGrkkZd-.js → index-CgDmoqKO.js} +1 -1
- package/dist/assets/{index-O2tEst1s.js → index-Ckr3Af0G.js} +1 -1
- package/dist/assets/{index-Dc0-osYE.js → index-D19A578F.js} +1 -1
- package/dist/assets/{index-BR8qEo0P.js → index-DURkl1eZ.js} +1 -1
- package/dist/assets/{index-B_qlJ-la.js → index-DXfYQh0Z.js} +1 -1
- package/dist/assets/{index-DNuWNnk-.js → index-Dagq6Y2s.js} +1 -1
- package/dist/assets/{index-DITqxnfk.js → index-DulF_7UO.js} +1 -1
- package/dist/assets/{index-Cg60JDEK.js → index-DvTCiu3P.js} +1 -1
- package/dist/assets/{index-DbY2GEPa.js → index-DxLDQU_A.js} +1 -1
- package/dist/assets/{index-DHn59BRx.js → index-OiDdq1JS.js} +1 -1
- package/dist/assets/{index-BkA1qQd3.js → index-SyQbsg8v.js} +1 -1
- package/dist/assets/{index-D3gVuWw7.js → index-WJgswFMW.js} +1 -1
- package/dist/assets/{index-MlWSSchD.js → index-bryRJW_X.js} +1 -1
- package/dist/assets/{index-CQvuK-4v.js → index-ifdCUgG7.js} +1 -1
- package/dist/assets/{index.es-BLCm9UT-.js → index.es-B6L7VFNr.js} +1 -1
- package/dist/assets/{isEqual-DQdO_K1-.js → isEqual-Df5ippj8.js} +1 -1
- package/dist/assets/{isPlainObject-BsyTgoxK.js → isPlainObject-BF8_keIM.js} +1 -1
- package/dist/assets/{order-CeKvimTq.js → order-DXkvQhpi.js} +1 -1
- package/dist/assets/{price-CZSDhLnN.js → price-CG10y7sa.js} +1 -1
- package/dist/assets/{strings-WMZYwrQD.js → strings-C0ATdFxF.js} +1 -1
- package/dist/assets/{typescript-CoKqfRJS.js → typescript-DXZhO2KE.js} +1 -1
- package/dist/assets/{use-form-item-CRDWzFx1.js → use-form-item-CZJno9cW.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/Index-Bqvjazj0.js +0 -1
- package/dist/assets/Index-DPQ747pA.css +0 -1
- package/dist/assets/Index-PQerfBmJ.css +0 -1
- package/dist/assets/Index-eWhLfJGA.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ca as Se,c7 as de,c8 as Re,d4 as Oe,aL as ae,d as V,bv as $e,e9 as q,aE as fe,bT as xe,cI as Be,as as J,ay as H,_ as be,aw as re,bN as ie,a as X,au as T,aF as D,ax as ve,b as me,o as pe,f as ke,n as he,e as B,bO as ne,bl as Y,c as K,c1 as Ae,k as m,E as W,bd as Fe,be as Le,aR as F,bc as ze,bq as Me,at as Ve,r as se,ea as Ie,cq as ge,aT as ye,av as De,u as Ke,a$ as ce,bP as Ue,eb as Ge,J as qe,y as We,K as He,w as Ye,g as Je}from"./index-CLwJbfYs.js";import{m as le,b as oe,e as Xe,f as Qe}from"./typescript-CoKqfRJS.js";import{c as L}from"./strings-WMZYwrQD.js";import{g as Ze,b as je}from"./_baseClone-B6o0klpv.js";import{c as et}from"./_initCloneObject-iRvJrG7M.js";import{i as tt}from"./isPlainObject-BsyTgoxK.js";import{f as at}from"./index-AT7DtKgl.js";function nt(e,t,s){var u=-1,a=e.length;t<0&&(t=-t>a?0:a+t),s=s>a?a:s,s<0&&(s+=a),a=t>s?0:s-t>>>0,t>>>=0;for(var l=Array(a);++u<a;)l[u]=e[u+t];return l}function st(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function lt(e,t){return t.length<2?e:Se(e,nt(t,0,-1))}function ot(e,t){return t=de(t,e),e=lt(e,t),e==null||delete e[Re(st(t))]}function rt(e){return tt(e)?void 0:e}var it=1,ct=2,ut=4,dt=at(function(e,t){var s={};if(e==null)return s;var u=!1;t=Oe(t,function(l){return l=de(l,e),u||(u=l.length>1),l}),et(e,Ze(e),s),u&&(s=je(s,it|ct|ut,rt));for(var a=t.length;a--;)ot(s,t[a]);return s});const ft=(e,t,s)=>xe(e.subTree).filter(l=>{var P;return Be(l)&&((P=l.type)==null?void 0:P.name)===t&&!!l.component}).map(l=>l.component.uid).map(l=>s[l]).filter(l=>!!l),bt=(e,t)=>{const s=ae({}),u=ae([]),a=new WeakMap,l=v=>{s.value[v.uid]=v,q(s),fe(()=>{const d=v.getVnode().el,n=d.parentNode;if(!a.has(n)){a.set(n,[]);const f=n.insertBefore.bind(n);n.insertBefore=(y,c)=>(a.get(n).some(N=>y===N||c===N)&&q(s),f(y,c))}a.get(n).push(d)})},P=v=>{delete s.value[v.uid],q(s);const d=v.getVnode().el,n=d.parentNode,f=a.get(n),y=f.indexOf(d);f.splice(y,1)},p=()=>{u.value=ft(e,t,s.value)},g=v=>v.render(),h=V({setup(v,{slots:d}){return()=>(p(),d.default?$e(g,{render:d.default}):null)}});return{children:u,addChild:l,removeChild:P,ChildrenSorter:h}},Q=Symbol("tabsRootContextKey"),vt=J({tabs:{type:H(Array),default:()=>le([])},tabRefs:{type:H(Object),default:()=>le({})}}),_e="ElTabBar",mt=V({name:_e}),pt=V({...mt,props:vt,setup(e,{expose:t}){const s=e,u=re(Q);u||ie(_e,"<el-tabs><el-tab-bar /></el-tabs>");const a=X("tabs"),l=T(),P=T(),p=()=>{let n=0,f=0;const y=["top","bottom"].includes(u.props.tabPosition)?"width":"height",c=y==="width"?"x":"y",R=c==="x"?"left":"top";return s.tabs.every(N=>{if(ne(N.paneName))return!1;const r=s.tabRefs[N.paneName];if(!r)return!1;if(!N.active)return!0;n=r[`offset${L(R)}`],f=r[`client${L(y)}`];const C=window.getComputedStyle(r);return y==="width"&&(f-=Number.parseFloat(C.paddingLeft)+Number.parseFloat(C.paddingRight),n+=Number.parseFloat(C.paddingLeft)),!1}),{[y]:`${f}px`,transform:`translate${L(c)}(${n}px)`}},g=()=>P.value=p(),h=[],v=()=>{h.forEach(n=>n.stop()),h.length=0,Object.values(s.tabRefs).forEach(n=>{h.push(oe(n,g))})};D(()=>s.tabs,async()=>{await Y(),g(),v()},{immediate:!0});const d=oe(l,()=>g());return ve(()=>{h.forEach(n=>n.stop()),h.length=0,d.stop()}),t({ref:l,update:g}),(n,f)=>(pe(),me("div",{ref_key:"barRef",ref:l,class:he([B(a).e("active-bar"),B(a).is(B(u).props.tabPosition)]),style:ke(P.value)},null,6))}});var ht=be(pt,[["__file","tab-bar.vue"]]);const gt=J({panes:{type:H(Array),default:()=>le([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),yt={tabClick:(e,t,s)=>s instanceof Event,tabRemove:(e,t)=>t instanceof Event},ue="ElTabNav",_t=V({name:ue,props:gt,emits:yt,setup(e,{expose:t,emit:s}){const u=re(Q);u||ie(ue,"<el-tabs><tab-nav /></el-tabs>");const a=X("tabs"),l=Xe(),P=Qe(),p=T(),g=T(),h=T(),v=T({}),d=T(),n=T(!1),f=T(0),y=T(!1),c=T(!0),R=ae(),N=K(()=>["top","bottom"].includes(u.props.tabPosition)?"width":"height"),r=K(()=>({transform:`translate${N.value==="width"?"X":"Y"}(-${f.value}px)`})),C=()=>{if(!p.value)return;const i=p.value[`offset${L(N.value)}`],b=f.value;if(!b)return;const o=b>i?b-i:0;f.value=o},S=()=>{if(!p.value||!g.value)return;const i=g.value[`offset${L(N.value)}`],b=p.value[`offset${L(N.value)}`],o=f.value;if(i-o<=b)return;const E=i-o>b*2?o+b:i-b;f.value=E},k=async()=>{const i=g.value;if(!n.value||!h.value||!p.value||!i)return;await Y();const b=v.value[e.currentName];if(!b)return;const o=p.value,E=["top","bottom"].includes(u.props.tabPosition),_=b.getBoundingClientRect(),w=o.getBoundingClientRect(),U=E?i.offsetWidth-w.width:i.offsetHeight-w.height,A=f.value;let $=A;E?(_.left<w.left&&($=A-(w.left-_.left)),_.right>w.right&&($=A+_.right-w.right)):(_.top<w.top&&($=A-(w.top-_.top)),_.bottom>w.bottom&&($=A+(_.bottom-w.bottom))),$=Math.max($,0),f.value=Math.min($,U)},z=()=>{var i;if(!g.value||!p.value)return;e.stretch&&((i=d.value)==null||i.update());const b=g.value[`offset${L(N.value)}`],o=p.value[`offset${L(N.value)}`],E=f.value;o<b?(n.value=n.value||{},n.value.prev=E,n.value.next=E+o<b,b-E<o&&(f.value=b-o)):(n.value=!1,E>0&&(f.value=0))},I=i=>{let b=0;switch(i.code){case F.left:case F.up:b=-1;break;case F.right:case F.down:b=1;break;default:return}const o=Array.from(i.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)"));let _=o.indexOf(i.target)+b;_<0?_=o.length-1:_>=o.length&&(_=0),o[_].focus({preventScroll:!0}),o[_].click(),M()},M=()=>{c.value&&(y.value=!0)},O=()=>y.value=!1,Z=(i,b)=>{v.value[b]=i},Te=async()=>{await Y();const i=v.value[e.currentName];i?.focus({preventScroll:!0})};return D(l,i=>{i==="hidden"?c.value=!1:i==="visible"&&setTimeout(()=>c.value=!0,50)}),D(P,i=>{i?setTimeout(()=>c.value=!0,50):c.value=!1}),oe(h,z),fe(()=>setTimeout(()=>k(),0)),Ae(()=>z()),t({scrollToActiveTab:k,removeFocus:O,focusActiveTab:Te,tabListRef:g,tabBarRef:d,scheduleRender:()=>q(R)}),()=>{const i=n.value?[m("span",{class:[a.e("nav-prev"),a.is("disabled",!n.value.prev)],onClick:C},[m(W,null,{default:()=>[m(Fe,null,null)]})]),m("span",{class:[a.e("nav-next"),a.is("disabled",!n.value.next)],onClick:S},[m(W,null,{default:()=>[m(Le,null,null)]})])]:null,b=e.panes.map((o,E)=>{var _,w,U,A;const $=o.uid,j=o.props.disabled,G=(w=(_=o.props.name)!=null?_:o.index)!=null?w:`${E}`,ee=!j&&(o.isClosable||e.editable);o.index=`${E}`;const Pe=ee?m(W,{class:"is-icon-close",onClick:x=>s("tabRemove",o,x)},{default:()=>[m(ze,null,null)]}):null,Ee=((A=(U=o.slots).label)==null?void 0:A.call(U))||o.props.label,we=!j&&o.active?0:-1;return m("div",{ref:x=>Z(x,G),class:[a.e("item"),a.is(u.props.tabPosition),a.is("active",o.active),a.is("disabled",j),a.is("closable",ee),a.is("focus",y.value)],id:`tab-${G}`,key:`tab-${$}`,"aria-controls":`pane-${G}`,role:"tab","aria-selected":o.active,tabindex:we,onFocus:()=>M(),onBlur:()=>O(),onClick:x=>{O(),s("tabClick",o,G,x)},onKeydown:x=>{ee&&(x.code===F.delete||x.code===F.backspace)&&s("tabRemove",o,x)}},[Ee,Pe])});return R.value,m("div",{ref:h,class:[a.e("nav-wrap"),a.is("scrollable",!!n.value),a.is(u.props.tabPosition)]},[i,m("div",{class:a.e("nav-scroll"),ref:p},[e.panes.length>0?m("div",{class:[a.e("nav"),a.is(u.props.tabPosition),a.is("stretch",e.stretch&&["top","bottom"].includes(u.props.tabPosition))],ref:g,style:r.value,role:"tablist",onKeydown:I},[e.type?null:m(ht,{ref:d,tabs:[...e.panes],tabRefs:v.value},null),b]):null])])}}}),Nt=J({type:{type:String,values:["card","border-card",""],default:""},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:H(Function),default:()=>!0},stretch:Boolean}),te=e=>Me(e)||Ve(e),Ct={[ge]:e=>te(e),tabClick:(e,t)=>t instanceof Event,tabChange:e=>te(e),edit:(e,t)=>["remove","add"].includes(t),tabRemove:e=>te(e),tabAdd:()=>!0},Tt=V({name:"ElTabs",props:Nt,emits:Ct,setup(e,{emit:t,slots:s,expose:u}){var a;const l=X("tabs"),P=K(()=>["left","right"].includes(e.tabPosition)),{children:p,addChild:g,removeChild:h,ChildrenSorter:v}=bt(ye(),"ElTabPane"),d=T(),n=T((a=e.modelValue)!=null?a:"0"),f=async(r,C=!1)=>{var S,k,z,I;if(!(n.value===r||ne(r)))try{let M;if(e.beforeLeave){const O=e.beforeLeave(r,n.value);M=O instanceof Promise?await O:O}else M=!0;if(M!==!1){const O=(S=p.value.find(Z=>Z.paneName===n.value))==null?void 0:S.isFocusInsidePane();n.value=r,C&&(t(ge,r),t("tabChange",r)),(z=(k=d.value)==null?void 0:k.removeFocus)==null||z.call(k),O&&((I=d.value)==null||I.focusActiveTab())}}catch{}},y=(r,C,S)=>{r.props.disabled||(t("tabClick",r,S),f(C,!0))},c=(r,C)=>{r.props.disabled||ne(r.props.name)||(C.stopPropagation(),t("edit",r.props.name,"remove"),t("tabRemove",r.props.name))},R=()=>{t("edit",void 0,"add"),t("tabAdd")},N=r=>{const C=r.el.firstChild,S=["bottom","right"].includes(e.tabPosition)?r.children[0].el:r.children[1].el;C!==S&&C.before(S)};return D(()=>e.modelValue,r=>f(r)),D(n,async()=>{var r;await Y(),(r=d.value)==null||r.scrollToActiveTab()}),De(Q,{props:e,currentName:n,registerPane:g,unregisterPane:h,nav$:d}),u({currentName:n,get tabNavRef(){return dt(d.value,["scheduleRender"])}}),()=>{const r=s["add-icon"],C=e.editable||e.addable?m("div",{class:[l.e("new-tab"),P.value&&l.e("new-tab-vertical")],tabindex:"0",onClick:R,onKeydown:I=>{[F.enter,F.numpadEnter].includes(I.code)&&R()}},[r?se(s,"add-icon"):m(W,{class:l.is("icon-plus")},{default:()=>[m(Ie,null,null)]})]):null,S=()=>m(_t,{ref:d,currentName:n.value,editable:e.editable,type:e.type,panes:p.value,stretch:e.stretch,onTabClick:y,onTabRemove:c},null),k=m("div",{class:[l.e("header"),P.value&&l.e("header-vertical"),l.is(e.tabPosition)]},[m(v,null,{default:S,$stable:!0}),C]),z=m("div",{class:l.e("content")},[se(s,"default")]);return m("div",{class:[l.b(),l.m(e.tabPosition),{[l.m("card")]:e.type==="card",[l.m("border-card")]:e.type==="border-card"}],onVnodeMounted:N,onVnodeUpdated:N},[z,k])}}});var Pt=Tt;const Et=J({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),Ne="ElTabPane",wt=V({name:Ne}),St=V({...wt,props:Et,setup(e){const t=e,s=ye(),u=Ke(),a=re(Q);a||ie(Ne,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const l=X("tab-pane"),P=T(),p=T(),g=K(()=>t.closable||a.props.closable),h=ce(()=>{var c;return a.currentName.value===((c=t.name)!=null?c:p.value)}),v=T(h.value),d=K(()=>{var c;return(c=t.name)!=null?c:p.value}),n=ce(()=>!t.lazy||v.value||h.value),f=()=>{var c;return(c=P.value)==null?void 0:c.contains(document.activeElement)};D(h,c=>{c&&(v.value=!0)});const y=Ue({uid:s.uid,getVnode:()=>s.vnode,slots:u,props:t,paneName:d,active:h,index:p,isClosable:g,isFocusInsidePane:f});return a.registerPane(y),ve(()=>{a.unregisterPane(y)}),Ge(()=>{var c;u.label&&((c=a.nav$.value)==null||c.scheduleRender())}),(c,R)=>B(n)?qe((pe(),me("div",{key:0,id:`pane-${B(d)}`,ref_key:"paneRef",ref:P,class:he(B(l).b()),role:"tabpanel","aria-hidden":!B(h),"aria-labelledby":`tab-${B(d)}`},[se(c.$slots,"default")],10,["id","aria-hidden","aria-labelledby"])),[[He,B(h)]]):We("v-if",!0)}});var Ce=be(St,[["__file","tab-pane.vue"]]);const Ft=Je(Pt,{TabPane:Ce}),Lt=Ye(Ce);export{Lt as E,Ft as a};
|
|
1
|
+
import{ca as Se,c7 as de,c8 as Re,d4 as Oe,aL as ae,d as V,bv as $e,e9 as q,aE as fe,bT as xe,cI as Be,as as J,ay as H,_ as be,aw as re,bN as ie,a as X,au as T,aF as D,ax as ve,b as me,o as pe,f as ke,n as he,e as B,bO as ne,bl as Y,c as K,c1 as Ae,k as m,E as W,bd as Fe,be as Le,aR as F,bc as ze,bq as Me,at as Ve,r as se,ea as Ie,cq as ge,aT as ye,av as De,u as Ke,a$ as ce,bP as Ue,eb as Ge,J as qe,y as We,K as He,w as Ye,g as Je}from"./index-BjMVMy9y.js";import{m as le,b as oe,e as Xe,f as Qe}from"./typescript-DXZhO2KE.js";import{c as L}from"./strings-C0ATdFxF.js";import{g as Ze,b as je}from"./_baseClone-DiKhUhxc.js";import{c as et}from"./_initCloneObject-CwAtjxb1.js";import{i as tt}from"./isPlainObject-BF8_keIM.js";import{f as at}from"./index-BzF_Ko5s.js";function nt(e,t,s){var u=-1,a=e.length;t<0&&(t=-t>a?0:a+t),s=s>a?a:s,s<0&&(s+=a),a=t>s?0:s-t>>>0,t>>>=0;for(var l=Array(a);++u<a;)l[u]=e[u+t];return l}function st(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function lt(e,t){return t.length<2?e:Se(e,nt(t,0,-1))}function ot(e,t){return t=de(t,e),e=lt(e,t),e==null||delete e[Re(st(t))]}function rt(e){return tt(e)?void 0:e}var it=1,ct=2,ut=4,dt=at(function(e,t){var s={};if(e==null)return s;var u=!1;t=Oe(t,function(l){return l=de(l,e),u||(u=l.length>1),l}),et(e,Ze(e),s),u&&(s=je(s,it|ct|ut,rt));for(var a=t.length;a--;)ot(s,t[a]);return s});const ft=(e,t,s)=>xe(e.subTree).filter(l=>{var P;return Be(l)&&((P=l.type)==null?void 0:P.name)===t&&!!l.component}).map(l=>l.component.uid).map(l=>s[l]).filter(l=>!!l),bt=(e,t)=>{const s=ae({}),u=ae([]),a=new WeakMap,l=v=>{s.value[v.uid]=v,q(s),fe(()=>{const d=v.getVnode().el,n=d.parentNode;if(!a.has(n)){a.set(n,[]);const f=n.insertBefore.bind(n);n.insertBefore=(y,c)=>(a.get(n).some(N=>y===N||c===N)&&q(s),f(y,c))}a.get(n).push(d)})},P=v=>{delete s.value[v.uid],q(s);const d=v.getVnode().el,n=d.parentNode,f=a.get(n),y=f.indexOf(d);f.splice(y,1)},p=()=>{u.value=ft(e,t,s.value)},g=v=>v.render(),h=V({setup(v,{slots:d}){return()=>(p(),d.default?$e(g,{render:d.default}):null)}});return{children:u,addChild:l,removeChild:P,ChildrenSorter:h}},Q=Symbol("tabsRootContextKey"),vt=J({tabs:{type:H(Array),default:()=>le([])},tabRefs:{type:H(Object),default:()=>le({})}}),_e="ElTabBar",mt=V({name:_e}),pt=V({...mt,props:vt,setup(e,{expose:t}){const s=e,u=re(Q);u||ie(_e,"<el-tabs><el-tab-bar /></el-tabs>");const a=X("tabs"),l=T(),P=T(),p=()=>{let n=0,f=0;const y=["top","bottom"].includes(u.props.tabPosition)?"width":"height",c=y==="width"?"x":"y",R=c==="x"?"left":"top";return s.tabs.every(N=>{if(ne(N.paneName))return!1;const r=s.tabRefs[N.paneName];if(!r)return!1;if(!N.active)return!0;n=r[`offset${L(R)}`],f=r[`client${L(y)}`];const C=window.getComputedStyle(r);return y==="width"&&(f-=Number.parseFloat(C.paddingLeft)+Number.parseFloat(C.paddingRight),n+=Number.parseFloat(C.paddingLeft)),!1}),{[y]:`${f}px`,transform:`translate${L(c)}(${n}px)`}},g=()=>P.value=p(),h=[],v=()=>{h.forEach(n=>n.stop()),h.length=0,Object.values(s.tabRefs).forEach(n=>{h.push(oe(n,g))})};D(()=>s.tabs,async()=>{await Y(),g(),v()},{immediate:!0});const d=oe(l,()=>g());return ve(()=>{h.forEach(n=>n.stop()),h.length=0,d.stop()}),t({ref:l,update:g}),(n,f)=>(pe(),me("div",{ref_key:"barRef",ref:l,class:he([B(a).e("active-bar"),B(a).is(B(u).props.tabPosition)]),style:ke(P.value)},null,6))}});var ht=be(pt,[["__file","tab-bar.vue"]]);const gt=J({panes:{type:H(Array),default:()=>le([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),yt={tabClick:(e,t,s)=>s instanceof Event,tabRemove:(e,t)=>t instanceof Event},ue="ElTabNav",_t=V({name:ue,props:gt,emits:yt,setup(e,{expose:t,emit:s}){const u=re(Q);u||ie(ue,"<el-tabs><tab-nav /></el-tabs>");const a=X("tabs"),l=Xe(),P=Qe(),p=T(),g=T(),h=T(),v=T({}),d=T(),n=T(!1),f=T(0),y=T(!1),c=T(!0),R=ae(),N=K(()=>["top","bottom"].includes(u.props.tabPosition)?"width":"height"),r=K(()=>({transform:`translate${N.value==="width"?"X":"Y"}(-${f.value}px)`})),C=()=>{if(!p.value)return;const i=p.value[`offset${L(N.value)}`],b=f.value;if(!b)return;const o=b>i?b-i:0;f.value=o},S=()=>{if(!p.value||!g.value)return;const i=g.value[`offset${L(N.value)}`],b=p.value[`offset${L(N.value)}`],o=f.value;if(i-o<=b)return;const E=i-o>b*2?o+b:i-b;f.value=E},k=async()=>{const i=g.value;if(!n.value||!h.value||!p.value||!i)return;await Y();const b=v.value[e.currentName];if(!b)return;const o=p.value,E=["top","bottom"].includes(u.props.tabPosition),_=b.getBoundingClientRect(),w=o.getBoundingClientRect(),U=E?i.offsetWidth-w.width:i.offsetHeight-w.height,A=f.value;let $=A;E?(_.left<w.left&&($=A-(w.left-_.left)),_.right>w.right&&($=A+_.right-w.right)):(_.top<w.top&&($=A-(w.top-_.top)),_.bottom>w.bottom&&($=A+(_.bottom-w.bottom))),$=Math.max($,0),f.value=Math.min($,U)},z=()=>{var i;if(!g.value||!p.value)return;e.stretch&&((i=d.value)==null||i.update());const b=g.value[`offset${L(N.value)}`],o=p.value[`offset${L(N.value)}`],E=f.value;o<b?(n.value=n.value||{},n.value.prev=E,n.value.next=E+o<b,b-E<o&&(f.value=b-o)):(n.value=!1,E>0&&(f.value=0))},I=i=>{let b=0;switch(i.code){case F.left:case F.up:b=-1;break;case F.right:case F.down:b=1;break;default:return}const o=Array.from(i.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)"));let _=o.indexOf(i.target)+b;_<0?_=o.length-1:_>=o.length&&(_=0),o[_].focus({preventScroll:!0}),o[_].click(),M()},M=()=>{c.value&&(y.value=!0)},O=()=>y.value=!1,Z=(i,b)=>{v.value[b]=i},Te=async()=>{await Y();const i=v.value[e.currentName];i?.focus({preventScroll:!0})};return D(l,i=>{i==="hidden"?c.value=!1:i==="visible"&&setTimeout(()=>c.value=!0,50)}),D(P,i=>{i?setTimeout(()=>c.value=!0,50):c.value=!1}),oe(h,z),fe(()=>setTimeout(()=>k(),0)),Ae(()=>z()),t({scrollToActiveTab:k,removeFocus:O,focusActiveTab:Te,tabListRef:g,tabBarRef:d,scheduleRender:()=>q(R)}),()=>{const i=n.value?[m("span",{class:[a.e("nav-prev"),a.is("disabled",!n.value.prev)],onClick:C},[m(W,null,{default:()=>[m(Fe,null,null)]})]),m("span",{class:[a.e("nav-next"),a.is("disabled",!n.value.next)],onClick:S},[m(W,null,{default:()=>[m(Le,null,null)]})])]:null,b=e.panes.map((o,E)=>{var _,w,U,A;const $=o.uid,j=o.props.disabled,G=(w=(_=o.props.name)!=null?_:o.index)!=null?w:`${E}`,ee=!j&&(o.isClosable||e.editable);o.index=`${E}`;const Pe=ee?m(W,{class:"is-icon-close",onClick:x=>s("tabRemove",o,x)},{default:()=>[m(ze,null,null)]}):null,Ee=((A=(U=o.slots).label)==null?void 0:A.call(U))||o.props.label,we=!j&&o.active?0:-1;return m("div",{ref:x=>Z(x,G),class:[a.e("item"),a.is(u.props.tabPosition),a.is("active",o.active),a.is("disabled",j),a.is("closable",ee),a.is("focus",y.value)],id:`tab-${G}`,key:`tab-${$}`,"aria-controls":`pane-${G}`,role:"tab","aria-selected":o.active,tabindex:we,onFocus:()=>M(),onBlur:()=>O(),onClick:x=>{O(),s("tabClick",o,G,x)},onKeydown:x=>{ee&&(x.code===F.delete||x.code===F.backspace)&&s("tabRemove",o,x)}},[Ee,Pe])});return R.value,m("div",{ref:h,class:[a.e("nav-wrap"),a.is("scrollable",!!n.value),a.is(u.props.tabPosition)]},[i,m("div",{class:a.e("nav-scroll"),ref:p},[e.panes.length>0?m("div",{class:[a.e("nav"),a.is(u.props.tabPosition),a.is("stretch",e.stretch&&["top","bottom"].includes(u.props.tabPosition))],ref:g,style:r.value,role:"tablist",onKeydown:I},[e.type?null:m(ht,{ref:d,tabs:[...e.panes],tabRefs:v.value},null),b]):null])])}}}),Nt=J({type:{type:String,values:["card","border-card",""],default:""},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:H(Function),default:()=>!0},stretch:Boolean}),te=e=>Me(e)||Ve(e),Ct={[ge]:e=>te(e),tabClick:(e,t)=>t instanceof Event,tabChange:e=>te(e),edit:(e,t)=>["remove","add"].includes(t),tabRemove:e=>te(e),tabAdd:()=>!0},Tt=V({name:"ElTabs",props:Nt,emits:Ct,setup(e,{emit:t,slots:s,expose:u}){var a;const l=X("tabs"),P=K(()=>["left","right"].includes(e.tabPosition)),{children:p,addChild:g,removeChild:h,ChildrenSorter:v}=bt(ye(),"ElTabPane"),d=T(),n=T((a=e.modelValue)!=null?a:"0"),f=async(r,C=!1)=>{var S,k,z,I;if(!(n.value===r||ne(r)))try{let M;if(e.beforeLeave){const O=e.beforeLeave(r,n.value);M=O instanceof Promise?await O:O}else M=!0;if(M!==!1){const O=(S=p.value.find(Z=>Z.paneName===n.value))==null?void 0:S.isFocusInsidePane();n.value=r,C&&(t(ge,r),t("tabChange",r)),(z=(k=d.value)==null?void 0:k.removeFocus)==null||z.call(k),O&&((I=d.value)==null||I.focusActiveTab())}}catch{}},y=(r,C,S)=>{r.props.disabled||(t("tabClick",r,S),f(C,!0))},c=(r,C)=>{r.props.disabled||ne(r.props.name)||(C.stopPropagation(),t("edit",r.props.name,"remove"),t("tabRemove",r.props.name))},R=()=>{t("edit",void 0,"add"),t("tabAdd")},N=r=>{const C=r.el.firstChild,S=["bottom","right"].includes(e.tabPosition)?r.children[0].el:r.children[1].el;C!==S&&C.before(S)};return D(()=>e.modelValue,r=>f(r)),D(n,async()=>{var r;await Y(),(r=d.value)==null||r.scrollToActiveTab()}),De(Q,{props:e,currentName:n,registerPane:g,unregisterPane:h,nav$:d}),u({currentName:n,get tabNavRef(){return dt(d.value,["scheduleRender"])}}),()=>{const r=s["add-icon"],C=e.editable||e.addable?m("div",{class:[l.e("new-tab"),P.value&&l.e("new-tab-vertical")],tabindex:"0",onClick:R,onKeydown:I=>{[F.enter,F.numpadEnter].includes(I.code)&&R()}},[r?se(s,"add-icon"):m(W,{class:l.is("icon-plus")},{default:()=>[m(Ie,null,null)]})]):null,S=()=>m(_t,{ref:d,currentName:n.value,editable:e.editable,type:e.type,panes:p.value,stretch:e.stretch,onTabClick:y,onTabRemove:c},null),k=m("div",{class:[l.e("header"),P.value&&l.e("header-vertical"),l.is(e.tabPosition)]},[m(v,null,{default:S,$stable:!0}),C]),z=m("div",{class:l.e("content")},[se(s,"default")]);return m("div",{class:[l.b(),l.m(e.tabPosition),{[l.m("card")]:e.type==="card",[l.m("border-card")]:e.type==="border-card"}],onVnodeMounted:N,onVnodeUpdated:N},[z,k])}}});var Pt=Tt;const Et=J({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),Ne="ElTabPane",wt=V({name:Ne}),St=V({...wt,props:Et,setup(e){const t=e,s=ye(),u=Ke(),a=re(Q);a||ie(Ne,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const l=X("tab-pane"),P=T(),p=T(),g=K(()=>t.closable||a.props.closable),h=ce(()=>{var c;return a.currentName.value===((c=t.name)!=null?c:p.value)}),v=T(h.value),d=K(()=>{var c;return(c=t.name)!=null?c:p.value}),n=ce(()=>!t.lazy||v.value||h.value),f=()=>{var c;return(c=P.value)==null?void 0:c.contains(document.activeElement)};D(h,c=>{c&&(v.value=!0)});const y=Ue({uid:s.uid,getVnode:()=>s.vnode,slots:u,props:t,paneName:d,active:h,index:p,isClosable:g,isFocusInsidePane:f});return a.registerPane(y),ve(()=>{a.unregisterPane(y)}),Ge(()=>{var c;u.label&&((c=a.nav$.value)==null||c.scheduleRender())}),(c,R)=>B(n)?qe((pe(),me("div",{key:0,id:`pane-${B(d)}`,ref_key:"paneRef",ref:P,class:he(B(l).b()),role:"tabpanel","aria-hidden":!B(h),"aria-labelledby":`tab-${B(d)}`},[se(c.$slots,"default")],10,["id","aria-hidden","aria-labelledby"])),[[He,B(h)]]):We("v-if",!0)}});var Ce=be(St,[["__file","tab-pane.vue"]]);const Ft=Je(Pt,{TabPane:Ce}),Lt=Ye(Ce);export{Lt as E,Ft as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bX as R,c as d,aw as U,bY as X,bx as H,bZ as F,au as M,u as O,aC as Y,as as Z,ay as q,b_ as J,bR as E,b$ as L,a as z,_ as D,d as B,i as y,o as g,j as $,b as x,y as P,F as Q,r as k,e as u,E as T,n as N,bh as w,aH as W,av as tt,bP as et,aX as G,g as ot,w as at}from"./index-
|
|
1
|
+
import{bX as R,c as d,aw as U,bY as X,bx as H,bZ as F,au as M,u as O,aC as Y,as as Z,ay as q,b_ as J,bR as E,b$ as L,a as z,_ as D,d as B,i as y,o as g,j as $,b as x,y as P,F as Q,r as k,e as u,E as T,n as N,bh as w,aH as W,av as tt,bP as et,aX as G,g as ot,w as at}from"./index-BjMVMy9y.js";import{u as nt}from"./use-form-item-CZJno9cW.js";import{T as lt}from"./index-r5W6hzzQ.js";const j=Symbol("buttonGroupContextKey"),st=(t,c)=>{R({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},d(()=>t.type==="text"));const n=U(j,void 0),a=X("button"),{form:s}=nt(),l=H(d(()=>n?.size)),o=F(),b=M(),v=O(),m=d(()=>{var e;return t.type||n?.type||((e=a.value)==null?void 0:e.type)||""}),p=d(()=>{var e,r,i;return(i=(r=t.autoInsertSpace)!=null?r:(e=a.value)==null?void 0:e.autoInsertSpace)!=null?i:!1}),h=d(()=>{var e,r,i;return(i=(r=t.plain)!=null?r:(e=a.value)==null?void 0:e.plain)!=null?i:!1}),S=d(()=>{var e,r,i;return(i=(r=t.round)!=null?r:(e=a.value)==null?void 0:e.round)!=null?i:!1}),_=d(()=>t.tag==="button"?{ariaDisabled:o.value||t.loading,disabled:o.value||t.loading,autofocus:t.autofocus,type:t.nativeType}:{}),C=d(()=>{var e;const r=(e=v.default)==null?void 0:e.call(v);if(p.value&&r?.length===1){const i=r[0];if(i?.type===Y){const A=i.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(A.trim())}}return!1});return{_disabled:o,_size:l,_type:m,_ref:b,_props:_,_plain:h,_round:S,shouldAddSpace:C,handleClick:e=>{if(o.value||t.loading){e.stopPropagation();return}t.nativeType==="reset"&&s?.resetFields(),c("click",e)}}},rt=["default","primary","success","warning","info","danger","text",""],it=["button","submit","reset"],V=Z({size:L,disabled:Boolean,type:{type:String,values:rt,default:""},icon:{type:E},nativeType:{type:String,values:it,default:"button"},loading:Boolean,loadingIcon:{type:E,default:()=>J},plain:{type:Boolean,default:void 0},text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:{type:Boolean,default:void 0},circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:q([String,Object]),default:"button"}}),ct={click:t=>t instanceof MouseEvent};function f(t,c=20){return t.mix("#141414",c).toString()}function ut(t){const c=F(),n=z("button");return d(()=>{let a={},s=t.color;if(s){const l=s.match(/var\((.*?)\)/);l&&(s=window.getComputedStyle(window.document.documentElement).getPropertyValue(l[1]));const o=new lt(s),b=t.dark?o.tint(20).toString():f(o,20);if(t.plain)a=n.cssVarBlock({"bg-color":t.dark?f(o,90):o.tint(90).toString(),"text-color":s,"border-color":t.dark?f(o,50):o.tint(50).toString(),"hover-text-color":`var(${n.cssVarName("color-white")})`,"hover-bg-color":s,"hover-border-color":s,"active-bg-color":b,"active-text-color":`var(${n.cssVarName("color-white")})`,"active-border-color":b}),c.value&&(a[n.cssVarBlockName("disabled-bg-color")]=t.dark?f(o,90):o.tint(90).toString(),a[n.cssVarBlockName("disabled-text-color")]=t.dark?f(o,50):o.tint(50).toString(),a[n.cssVarBlockName("disabled-border-color")]=t.dark?f(o,80):o.tint(80).toString());else{const v=t.dark?f(o,30):o.tint(30).toString(),m=o.isDark()?`var(${n.cssVarName("color-white")})`:`var(${n.cssVarName("color-black")})`;if(a=n.cssVarBlock({"bg-color":s,"text-color":m,"border-color":s,"hover-bg-color":v,"hover-text-color":m,"hover-border-color":v,"active-bg-color":b,"active-border-color":b}),c.value){const p=t.dark?f(o,50):o.tint(50).toString();a[n.cssVarBlockName("disabled-bg-color")]=p,a[n.cssVarBlockName("disabled-text-color")]=t.dark?"rgba(255, 255, 255, 0.5)":`var(${n.cssVarName("color-white")})`,a[n.cssVarBlockName("disabled-border-color")]=p}}}return a})}const dt=B({name:"ElButton"}),bt=B({...dt,props:V,emits:ct,setup(t,{expose:c,emit:n}){const a=t,s=ut(a),l=z("button"),{_ref:o,_size:b,_type:v,_disabled:m,_props:p,_plain:h,_round:S,shouldAddSpace:_,handleClick:C}=st(a,n),I=d(()=>[l.b(),l.m(v.value),l.m(b.value),l.is("disabled",m.value),l.is("loading",a.loading),l.is("plain",h.value),l.is("round",S.value),l.is("circle",a.circle),l.is("text",a.text),l.is("link",a.link),l.is("has-bg",a.bg)]);return c({ref:o,size:b,type:v,disabled:m,shouldAddSpace:_}),(e,r)=>(g(),y(w(e.tag),W({ref_key:"_ref",ref:o},u(p),{class:u(I),style:u(s),onClick:u(C)}),{default:$(()=>[e.loading?(g(),x(Q,{key:0},[e.$slots.loading?k(e.$slots,"loading",{key:0}):(g(),y(u(T),{key:1,class:N(u(l).is("loading"))},{default:$(()=>[(g(),y(w(e.loadingIcon)))]),_:1},8,["class"]))],64)):e.icon||e.$slots.icon?(g(),y(u(T),{key:1},{default:$(()=>[e.icon?(g(),y(w(e.icon),{key:0})):k(e.$slots,"icon",{key:1})]),_:3})):P("v-if",!0),e.$slots.default?(g(),x("span",{key:2,class:N({[u(l).em("text","expand")]:u(_)})},[k(e.$slots,"default")],2)):P("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var vt=D(bt,[["__file","button.vue"]]);const ft={size:V.size,type:V.type},gt=B({name:"ElButtonGroup"}),mt=B({...gt,props:ft,setup(t){const c=t;tt(j,et({size:G(c,"size"),type:G(c,"type")}));const n=z("button");return(a,s)=>(g(),x("div",{class:N(u(n).b("group"))},[k(a.$slots,"default")],2))}});var K=D(mt,[["__file","button-group.vue"]]);const kt=ot(vt,{ButtonGroup:K});at(K);export{kt as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as O,b as ee}from"./typescript-
|
|
1
|
+
import{a as O,b as ee}from"./typescript-DXZhO2KE.js";import{as as K,_ as j,d as x,aw as G,a as J,bN as te,au as u,c as L,ax as le,aX as U,i as W,o as P,j as Q,J as ae,t as A,aq as oe,n as R,e as g,f as $,K as se,b0 as re,aK as ne,b as Z,k as Y,F as ie,at as N,ay as ce,bw as q,aF as F,av as ue,bP as ve,c0 as fe,aE as de,bl as V,c1 as me,y as pe,r as he,bh as be,aB as ye,g as ge}from"./index-BjMVMy9y.js";import{u as we}from"./index-BzF_Ko5s.js";const k=4,Se={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},ze=({move:m,size:v,bar:s})=>({[s.size]:v,transform:`translate${s.axis}(${m}%)`}),D=Symbol("scrollbarContextKey"),Ee=K({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),_e="Thumb",He=x({__name:"thumb",props:Ee,setup(m){const v=m,s=G(D),a=J("scrollbar");s||te(_e,"can not inject scrollbar context");const c=u(),f=u(),p=u({}),i=u(!1);let n=!1,d=!1,T=0,l=0,o=ne?document.onselectstart:null;const t=L(()=>Se[v.vertical?"vertical":"horizontal"]),h=L(()=>ze({size:v.size,move:v.move,bar:t.value})),S=L(()=>c.value[t.value.offset]**2/s.wrapElement[t.value.scrollSize]/v.ratio/f.value[t.value.offset]),_=r=>{var y;if(r.stopPropagation(),r.ctrlKey||[1,2].includes(r.button))return;(y=window.getSelection())==null||y.removeAllRanges(),z(r);const H=r.currentTarget;H&&(p.value[t.value.axis]=H[t.value.offset]-(r[t.value.client]-H.getBoundingClientRect()[t.value.direction]))},w=r=>{if(!f.value||!c.value||!s.wrapElement)return;const y=Math.abs(r.target.getBoundingClientRect()[t.value.direction]-r[t.value.client]),H=f.value[t.value.offset]/2,M=(y-H)*100*S.value/c.value[t.value.offset];s.wrapElement[t.value.scroll]=M*s.wrapElement[t.value.scrollSize]/100},z=r=>{r.stopImmediatePropagation(),n=!0,T=s.wrapElement.scrollHeight,l=s.wrapElement.scrollWidth,document.addEventListener("mousemove",B),document.addEventListener("mouseup",C),o=document.onselectstart,document.onselectstart=()=>!1},B=r=>{if(!c.value||!f.value||n===!1)return;const y=p.value[t.value.axis];if(!y)return;const H=(c.value.getBoundingClientRect()[t.value.direction]-r[t.value.client])*-1,M=f.value[t.value.offset]-y,X=(H-M)*100*S.value/c.value[t.value.offset];t.value.scroll==="scrollLeft"?s.wrapElement[t.value.scroll]=X*l/100:s.wrapElement[t.value.scroll]=X*T/100},C=()=>{n=!1,p.value[t.value.axis]=0,document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",C),b(),d&&(i.value=!1)},E=()=>{d=!1,i.value=!!v.size},e=()=>{d=!0,i.value=n};le(()=>{b(),document.removeEventListener("mouseup",C)});const b=()=>{document.onselectstart!==o&&(document.onselectstart=o)};return O(U(s,"scrollbarElement"),"mousemove",E),O(U(s,"scrollbarElement"),"mouseleave",e),(r,y)=>(P(),W(re,{name:g(a).b("fade"),persisted:""},{default:Q(()=>[ae(A("div",{ref_key:"instance",ref:c,class:R([g(a).e("bar"),g(a).is(g(t).key)]),onMousedown:w,onClick:oe(()=>{},["stop"])},[A("div",{ref_key:"thumb",ref:f,class:R(g(a).e("thumb")),style:$(g(h)),onMousedown:_},null,38)],42,["onClick"]),[[se,r.always||i.value]])]),_:1},8,["name"]))}});var I=j(He,[["__file","thumb.vue"]]);const Te=K({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}}),ke=x({__name:"bar",props:Te,setup(m,{expose:v}){const s=m,a=G(D),c=u(0),f=u(0),p=u(""),i=u(""),n=u(1),d=u(1);return v({handleScroll:o=>{if(o){const t=o.offsetHeight-k,h=o.offsetWidth-k;f.value=o.scrollTop*100/t*n.value,c.value=o.scrollLeft*100/h*d.value}},update:()=>{const o=a?.wrapElement;if(!o)return;const t=o.offsetHeight-k,h=o.offsetWidth-k,S=t**2/o.scrollHeight,_=h**2/o.scrollWidth,w=Math.max(S,s.minSize),z=Math.max(_,s.minSize);n.value=S/(t-S)/(w/(t-w)),d.value=_/(h-_)/(z/(h-z)),i.value=w+k<t?`${w}px`:"",p.value=z+k<h?`${z}px`:""}}),(o,t)=>(P(),Z(ie,null,[Y(I,{move:c.value,ratio:d.value,size:p.value,always:o.always},null,8,["move","ratio","size","always"]),Y(I,{move:f.value,ratio:n.value,size:i.value,vertical:"",always:o.always},null,8,["move","ratio","size","always"])],64))}});var Le=j(ke,[["__file","bar.vue"]]);const Ce=K({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:Boolean,wrapStyle:{type:ce([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...we(["ariaLabel","ariaOrientation"])}),Ne={"end-reached":m=>["left","right","top","bottom"].includes(m),scroll:({scrollTop:m,scrollLeft:v})=>[m,v].every(N)},Pe="ElScrollbar",Re=x({name:Pe}),Be=x({...Re,props:Ce,emits:Ne,setup(m,{expose:v,emit:s}){const a=m,c=J("scrollbar");let f,p,i=0,n=0,d="";const T=u(),l=u(),o=u(),t=u(),h=L(()=>{const e={};return a.height&&(e.height=q(a.height)),a.maxHeight&&(e.maxHeight=q(a.maxHeight)),[a.wrapStyle,e]}),S=L(()=>[a.wrapClass,c.e("wrap"),{[c.em("wrap","hidden-default")]:!a.native}]),_=L(()=>[c.e("view"),a.viewClass]),w=()=>{var e;if(l.value){(e=t.value)==null||e.handleScroll(l.value);const b=i,r=n;i=l.value.scrollTop,n=l.value.scrollLeft;const y={bottom:i+l.value.clientHeight>=l.value.scrollHeight,top:i<=0&&b!==0,right:n+l.value.clientWidth>=l.value.scrollWidth&&r!==n,left:n<=0&&r!==0};b!==i&&(d=i>b?"bottom":"top"),r!==n&&(d=n>r?"right":"left"),s("scroll",{scrollTop:i,scrollLeft:n}),y[d]&&s("end-reached",d)}};function z(e,b){ye(e)?l.value.scrollTo(e):N(e)&&N(b)&&l.value.scrollTo(e,b)}const B=e=>{N(e)&&(l.value.scrollTop=e)},C=e=>{N(e)&&(l.value.scrollLeft=e)},E=()=>{var e;(e=t.value)==null||e.update()};return F(()=>a.noresize,e=>{e?(f?.(),p?.()):({stop:f}=ee(o,E),p=O("resize",E))},{immediate:!0}),F(()=>[a.maxHeight,a.height],()=>{a.native||V(()=>{var e;E(),l.value&&((e=t.value)==null||e.handleScroll(l.value))})}),ue(D,ve({scrollbarElement:T,wrapElement:l})),fe(()=>{l.value&&(l.value.scrollTop=i,l.value.scrollLeft=n)}),de(()=>{a.native||V(()=>{E()})}),me(()=>E()),v({wrapRef:l,update:E,scrollTo:z,setScrollTop:B,setScrollLeft:C,handleScroll:w}),(e,b)=>(P(),Z("div",{ref_key:"scrollbarRef",ref:T,class:R(g(c).b())},[A("div",{ref_key:"wrapRef",ref:l,class:R(g(S)),style:$(g(h)),tabindex:e.tabindex,onScroll:w},[(P(),W(be(e.tag),{id:e.id,ref_key:"resizeRef",ref:o,class:R(g(_)),style:$(e.viewStyle),role:e.role,"aria-label":e.ariaLabel,"aria-orientation":e.ariaOrientation},{default:Q(()=>[he(e.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),e.native?pe("v-if",!0):(P(),W(Le,{key:0,ref_key:"barRef",ref:t,always:e.always,"min-size":e.minSize},null,8,["always","min-size"]))],2))}});var xe=j(Be,[["__file","scrollbar.vue"]]);const Ae=ge(xe);export{Ae as E,Ne as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as r,a as d,E as A}from"./index-
|
|
1
|
+
import{u as r,a as d,E as A}from"./index-DulF_7UO.js";import{d as f}from"./dropdown-UbXA6R_N.js";import{aV as R,as as U,_ as D,d as h,c as n,a as V,au as $,e as p,bw as K,i as H,o as u,j as c,r as v,y as b,b as O,n as I,x as g,D as L,aH as j,g as z,fh as F}from"./index-BjMVMy9y.js";const q=U({trigger:d.trigger,triggerKeys:d.triggerKeys,placement:f.placement,disabled:d.disabled,visible:r.visible,transition:r.transition,popperOptions:f.popperOptions,tabindex:f.tabindex,content:r.content,popperStyle:r.popperStyle,popperClass:r.popperClass,enterable:{...r.enterable,default:!0},effect:{...r.effect,default:"light"},teleported:r.teleported,appendTo:r.appendTo,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),G={"update:visible":t=>R(t),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},J="onUpdate:visible",M=h({name:"ElPopover"}),Q=h({...M,props:q,emits:G,setup(t,{expose:a,emit:s}){const o=t,y=n(()=>o[J]),i=V("popover"),l=$(),w=n(()=>{var e;return(e=p(l))==null?void 0:e.popperRef}),E=n(()=>[{width:K(o.width)},o.popperStyle]),P=n(()=>[i.b(),o.popperClass,{[i.m("plain")]:!!o.content}]),C=n(()=>o.transition===`${i.namespace.value}-fade-in-linear`),k=()=>{var e;(e=l.value)==null||e.hide()},S=()=>{s("before-enter")},B=()=>{s("before-leave")},N=()=>{s("after-enter")},T=()=>{s("update:visible",!1),s("after-leave")};return a({popperRef:w,hide:k}),(e,_)=>(u(),H(p(A),j({ref_key:"tooltipRef",ref:l},e.$attrs,{trigger:e.trigger,"trigger-keys":e.triggerKeys,placement:e.placement,disabled:e.disabled,visible:e.visible,transition:e.transition,"popper-options":e.popperOptions,tabindex:e.tabindex,content:e.content,offset:e.offset,"show-after":e.showAfter,"hide-after":e.hideAfter,"auto-close":e.autoClose,"show-arrow":e.showArrow,"aria-label":e.title,effect:e.effect,enterable:e.enterable,"popper-class":p(P),"popper-style":p(E),teleported:e.teleported,"append-to":e.appendTo,persistent:e.persistent,"gpu-acceleration":p(C),"onUpdate:visible":p(y),onBeforeShow:S,onBeforeHide:B,onShow:N,onHide:T}),{content:c(()=>[e.title?(u(),O("div",{key:0,class:I(p(i).e("title")),role:"title"},g(e.title),3)):b("v-if",!0),v(e.$slots,"default",{},()=>[L(g(e.content),1)])]),default:c(()=>[e.$slots.reference?v(e.$slots,"reference",{key:0}):b("v-if",!0)]),_:3},16,["trigger","trigger-keys","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","append-to","persistent","gpu-acceleration","onUpdate:visible"]))}});var W=D(Q,[["__file","popover.vue"]]);const m=(t,a)=>{const s=a.arg||a.value,o=s?.popperRef;o&&(o.triggerRef=t)};var X={mounted(t,a){m(t,a)},updated(t,a){m(t,a)}};const Y="popover",Z=F(X,Y),oe=z(W,{directive:Z});export{oe as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bN as Z,aW as ue,aJ as ce,as as A,ay as v,az as k,_ as M,d as _,ba as ke,a as q,bZ as H,au as de,c as V,i as U,o as y,j as R,b as P,r as $,F as Ee,v as Ce,ch as pe,e as t,n as m,y as g,t as N,aq as B,k as w,E as O,cx as $e,x as Q,f as Re,cy as Fe,cz as Le,bc as we,bg as Pe,cA as Se,cn as Te,aw as Ue,aL as W,cB as x,cC as _e,aU as De,aF as ee,bW as Oe,ax as Be,av as je,aX as Ne,bn as te,aH as se,g as qe}from"./index-CLwJbfYs.js";import{E as Ae}from"./index-D3gVuWw7.js";import{m as J,c as Me}from"./typescript-CoKqfRJS.js";import{b as He}from"./_baseClone-B6o0klpv.js";import{i as Ke}from"./isEqual-DQdO_K1-.js";var ze=1,Ie=4;function ae(o){return He(o,ze|Ie)}const fe=Symbol("uploadContextKey"),Xe="ElUpload";class Ge extends Error{constructor(l,a,d,i){super(l),this.name="UploadAjaxError",this.status=a,this.method=d,this.url=i}}function oe(o,l,a){let d;return a.response?d=`${a.response.error||a.response}`:a.responseText?d=`${a.responseText}`:d=`fail to ${l.method} ${o} ${a.status}`,new Ge(d,a.status,l.method,o)}function Ve(o){const l=o.responseText||o.response;if(!l)return l;try{return JSON.parse(l)}catch{return l}}const We=o=>{typeof XMLHttpRequest>"u"&&Z(Xe,"XMLHttpRequest is undefined");const l=new XMLHttpRequest,a=o.action;l.upload&&l.upload.addEventListener("progress",c=>{const f=c;f.percent=c.total>0?c.loaded/c.total*100:0,o.onProgress(f)});const d=new FormData;if(o.data)for(const[c,f]of Object.entries(o.data))ue(f)&&f.length?d.append(c,...f):d.append(c,f);d.append(o.filename,o.file,o.file.name),l.addEventListener("error",()=>{o.onError(oe(a,o,l))}),l.addEventListener("load",()=>{if(l.status<200||l.status>=300)return o.onError(oe(a,o,l));o.onSuccess(Ve(l))}),l.open(o.method,a,!0),o.withCredentials&&"withCredentials"in l&&(l.withCredentials=!0);const i=o.headers||{};if(i instanceof Headers)i.forEach((c,f)=>l.setRequestHeader(f,c));else for(const[c,f]of Object.entries(i))ce(f)||l.setRequestHeader(c,String(f));return l.send(d),l},ve=["text","picture","picture-card"];let Je=1;const Y=()=>Date.now()+Je++,me=A({action:{type:String,default:"#"},headers:{type:v(Object)},method:{type:String,default:"post"},data:{type:v([Object,Function,Promise]),default:()=>J({})},multiple:Boolean,name:{type:String,default:"file"},drag:Boolean,withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:{type:String,default:""},fileList:{type:v(Array),default:()=>J([])},autoUpload:{type:Boolean,default:!0},listType:{type:String,values:ve,default:"text"},httpRequest:{type:v(Function),default:We},disabled:Boolean,limit:Number}),Ye=A({...me,beforeUpload:{type:v(Function),default:k},beforeRemove:{type:v(Function)},onRemove:{type:v(Function),default:k},onChange:{type:v(Function),default:k},onPreview:{type:v(Function),default:k},onSuccess:{type:v(Function),default:k},onProgress:{type:v(Function),default:k},onError:{type:v(Function),default:k},onExceed:{type:v(Function),default:k},crossorigin:{type:v(String)}}),Ze=A({files:{type:v(Array),default:()=>J([])},disabled:Boolean,handlePreview:{type:v(Function),default:k},listType:{type:String,values:ve,default:"text"},crossorigin:{type:v(String)}}),Qe={remove:o=>!!o},xe=_({name:"ElUploadList"}),et=_({...xe,props:Ze,emits:Qe,setup(o,{emit:l}){const a=o,{t:d}=ke(),i=q("upload"),c=q("icon"),f=q("list"),C=H(),h=de(!1),b=V(()=>[i.b("list"),i.bm("list",a.listType),i.is("disabled",a.disabled)]),E=p=>{l("remove",p)};return(p,S)=>(y(),U(Te,{tag:"ul",class:m(t(b)),name:t(f).b()},{default:R(()=>[(y(!0),P(Ee,null,Ce(p.files,(s,n)=>(y(),P("li",{key:s.uid||s.name,class:m([t(i).be("list","item"),t(i).is(s.status),{focusing:h.value}]),tabindex:"0",onKeydown:pe(e=>!t(C)&&E(s),["delete"]),onFocus:e=>h.value=!0,onBlur:e=>h.value=!1,onClick:e=>h.value=!1},[$(p.$slots,"default",{file:s,index:n},()=>[p.listType==="picture"||s.status!=="uploading"&&p.listType==="picture-card"?(y(),P("img",{key:0,class:m(t(i).be("list","item-thumbnail")),src:s.url,crossorigin:p.crossorigin,alt:""},null,10,["src","crossorigin"])):g("v-if",!0),s.status==="uploading"||p.listType!=="picture-card"?(y(),P("div",{key:1,class:m(t(i).be("list","item-info"))},[N("a",{class:m(t(i).be("list","item-name")),onClick:B(e=>p.handlePreview(s),["prevent"])},[w(t(O),{class:m(t(c).m("document"))},{default:R(()=>[w(t($e))]),_:1},8,["class"]),N("span",{class:m(t(i).be("list","item-file-name")),title:s.name},Q(s.name),11,["title"])],10,["onClick"]),s.status==="uploading"?(y(),U(t(Ae),{key:0,type:p.listType==="picture-card"?"circle":"line","stroke-width":p.listType==="picture-card"?6:2,percentage:Number(s.percentage),style:Re(p.listType==="picture-card"?"":"margin-top: 0.5rem")},null,8,["type","stroke-width","percentage","style"])):g("v-if",!0)],2)):g("v-if",!0),N("label",{class:m(t(i).be("list","item-status-label"))},[p.listType==="text"?(y(),U(t(O),{key:0,class:m([t(c).m("upload-success"),t(c).m("circle-check")])},{default:R(()=>[w(t(Fe))]),_:1},8,["class"])):["picture-card","picture"].includes(p.listType)?(y(),U(t(O),{key:1,class:m([t(c).m("upload-success"),t(c).m("check")])},{default:R(()=>[w(t(Le))]),_:1},8,["class"])):g("v-if",!0)],2),t(C)?g("v-if",!0):(y(),U(t(O),{key:2,class:m(t(c).m("close")),onClick:e=>E(s)},{default:R(()=>[w(t(we))]),_:2},1032,["class","onClick"])),g(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),g(" This is a bug which needs to be fixed "),g(" TODO: Fix the incorrect navigation interaction "),t(C)?g("v-if",!0):(y(),P("i",{key:3,class:m(t(c).m("close-tip"))},Q(t(d)("el.upload.deleteTip")),3)),p.listType==="picture-card"?(y(),P("span",{key:4,class:m(t(i).be("list","item-actions"))},[N("span",{class:m(t(i).be("list","item-preview")),onClick:e=>p.handlePreview(s)},[w(t(O),{class:m(t(c).m("zoom-in"))},{default:R(()=>[w(t(Pe))]),_:1},8,["class"])],10,["onClick"]),t(C)?g("v-if",!0):(y(),P("span",{key:0,class:m(t(i).be("list","item-delete")),onClick:e=>E(s)},[w(t(O),{class:m(t(c).m("delete"))},{default:R(()=>[w(t(Se))]),_:1},8,["class"])],10,["onClick"]))],2)):g("v-if",!0)])],42,["onKeydown","onFocus","onBlur","onClick"]))),128)),$(p.$slots,"append")]),_:3},8,["class","name"]))}});var ne=M(et,[["__file","upload-list.vue"]]);const tt=A({disabled:Boolean}),st={file:o=>ue(o)},ye="ElUploadDrag",at=_({name:ye}),ot=_({...at,props:tt,emits:st,setup(o,{emit:l}){Ue(fe)||Z(ye,"usage: <el-upload><el-upload-dragger /></el-upload>");const d=q("upload"),i=de(!1),c=H(),f=b=>{if(c.value)return;i.value=!1,b.stopPropagation();const E=Array.from(b.dataTransfer.files),p=b.dataTransfer.items||[];E.forEach((S,s)=>{var n;const e=p[s],u=(n=e?.webkitGetAsEntry)==null?void 0:n.call(e);u&&(S.isDirectory=u.isDirectory)}),l("file",E)},C=()=>{c.value||(i.value=!0)},h=b=>{b.currentTarget.contains(b.relatedTarget)||(i.value=!1)};return(b,E)=>(y(),P("div",{class:m([t(d).b("dragger"),t(d).is("dragover",i.value)]),onDrop:B(f,["prevent"]),onDragover:B(C,["prevent"]),onDragleave:B(h,["prevent"])},[$(b.$slots,"default")],42,["onDrop","onDragover","onDragleave"]))}});var nt=M(ot,[["__file","upload-dragger.vue"]]);const rt=A({...me,beforeUpload:{type:v(Function),default:k},onRemove:{type:v(Function),default:k},onStart:{type:v(Function),default:k},onSuccess:{type:v(Function),default:k},onProgress:{type:v(Function),default:k},onError:{type:v(Function),default:k},onExceed:{type:v(Function),default:k}}),lt=_({name:"ElUploadContent",inheritAttrs:!1}),it=_({...lt,props:rt,setup(o,{expose:l}){const a=o,d=q("upload"),i=H(),c=W({}),f=W(),C=e=>{if(e.length===0)return;const{autoUpload:u,limit:r,fileList:F,multiple:L,onStart:T,onExceed:K}=a;if(r&&F.length+e.length>r){K(e,F);return}L||(e=e.slice(0,1));for(const z of e){const j=z;j.uid=Y(),T(j),u&&h(j)}},h=async e=>{if(f.value.value="",!a.beforeUpload)return E(e);let u,r={};try{const L=a.data,T=a.beforeUpload(e);r=x(a.data)?ae(a.data):a.data,u=await T,x(a.data)&&Ke(L,r)&&(r=ae(a.data))}catch{u=!1}if(u===!1){a.onRemove(e);return}let F=e;u instanceof Blob&&(u instanceof File?F=u:F=new File([u],e.name,{type:e.type})),E(Object.assign(F,{uid:e.uid}),r)},b=async(e,u)=>De(e)?e(u):e,E=async(e,u)=>{const{headers:r,data:F,method:L,withCredentials:T,name:K,action:z,onProgress:j,onSuccess:ge,onError:be,httpRequest:he}=a;try{u=await b(u??F,e)}catch{a.onRemove(e);return}const{uid:I}=e,X={headers:r||{},withCredentials:T,file:e,data:u,method:L,filename:K,action:z,onProgress:D=>{j(D,e)},onSuccess:D=>{ge(D,e),delete c.value[I]},onError:D=>{be(D,e),delete c.value[I]}},G=he(X);c.value[I]=G,G instanceof Promise&&G.then(X.onSuccess,X.onError)},p=e=>{const u=e.target.files;u&&C(Array.from(u))},S=()=>{i.value||(f.value.value="",f.value.click())},s=()=>{S()};return l({abort:e=>{_e(c.value).filter(e?([r])=>String(e.uid)===r:()=>!0).forEach(([r,F])=>{F instanceof XMLHttpRequest&&F.abort(),delete c.value[r]})},upload:h}),(e,u)=>(y(),P("div",{class:m([t(d).b(),t(d).m(e.listType),t(d).is("drag",e.drag),t(d).is("disabled",t(i))]),tabindex:t(i)?"-1":"0",onClick:S,onKeydown:pe(B(s,["self"]),["enter","space"])},[e.drag?(y(),U(nt,{key:0,disabled:t(i),onFile:C},{default:R(()=>[$(e.$slots,"default")]),_:3},8,["disabled"])):$(e.$slots,"default",{key:1}),N("input",{ref_key:"inputRef",ref:f,class:m(t(d).e("input")),name:e.name,disabled:t(i),multiple:e.multiple,accept:e.accept,type:"file",onChange:p,onClick:B(()=>{},["stop"])},null,42,["name","disabled","multiple","accept","onClick"])],42,["tabindex","onKeydown"]))}});var re=M(it,[["__file","upload-content.vue"]]);const le="ElUpload",ie=o=>{var l;(l=o.url)!=null&&l.startsWith("blob:")&&URL.revokeObjectURL(o.url)},ut=(o,l)=>{const a=Me(o,"fileList",void 0,{passive:!0}),d=s=>a.value.find(n=>n.uid===s.uid);function i(s){var n;(n=l.value)==null||n.abort(s)}function c(s=["ready","uploading","success","fail"]){a.value=a.value.filter(n=>!s.includes(n.status))}function f(s){a.value=a.value.filter(n=>n.uid!==s.uid)}const C=(s,n)=>{const e=d(n);e&&(console.error(s),e.status="fail",f(e),o.onError(s,e,a.value),o.onChange(e,a.value))},h=(s,n)=>{const e=d(n);e&&(o.onProgress(s,e,a.value),e.status="uploading",e.percentage=Math.round(s.percent))},b=(s,n)=>{const e=d(n);e&&(e.status="success",e.response=s,o.onSuccess(s,e,a.value),o.onChange(e,a.value))},E=s=>{ce(s.uid)&&(s.uid=Y());const n={name:s.name,percentage:0,status:"ready",size:s.size,raw:s,uid:s.uid};if(o.listType==="picture-card"||o.listType==="picture")try{n.url=URL.createObjectURL(s)}catch(e){Oe(le,e.message),o.onError(e,n,a.value)}a.value=[...a.value,n],o.onChange(n,a.value)},p=async s=>{const n=s instanceof File?d(s):s;n||Z(le,"file to be removed not found");const e=u=>{i(u),f(u),o.onRemove(u,a.value),ie(u)};o.beforeRemove?await o.beforeRemove(n,a.value)!==!1&&e(n):e(n)};function S(){a.value.filter(({status:s})=>s==="ready").forEach(({raw:s})=>{var n;return s&&((n=l.value)==null?void 0:n.upload(s))})}return ee(()=>o.listType,s=>{s!=="picture-card"&&s!=="picture"||(a.value=a.value.map(n=>{const{raw:e,url:u}=n;if(!u&&e)try{n.url=URL.createObjectURL(e)}catch(r){o.onError(r,n,a.value)}return n}))}),ee(a,s=>{for(const n of s)n.uid||(n.uid=Y()),n.status||(n.status="success")},{immediate:!0,deep:!0}),{uploadFiles:a,abort:i,clearFiles:c,handleError:C,handleProgress:h,handleStart:E,handleSuccess:b,handleRemove:p,submit:S,revokeFileObjectURL:ie}},ct=_({name:"ElUpload"}),dt=_({...ct,props:Ye,setup(o,{expose:l}){const a=o,d=H(),i=W(),{abort:c,submit:f,clearFiles:C,uploadFiles:h,handleStart:b,handleError:E,handleRemove:p,handleSuccess:S,handleProgress:s,revokeFileObjectURL:n}=ut(a,i),e=V(()=>a.listType==="picture-card"),u=V(()=>({...a,fileList:h.value,onStart:b,onProgress:s,onSuccess:S,onError:E,onRemove:p}));return Be(()=>{h.value.forEach(n)}),je(fe,{accept:Ne(a,"accept")}),l({abort:c,submit:f,clearFiles:C,handleStart:b,handleRemove:p}),(r,F)=>(y(),P("div",null,[t(e)&&r.showFileList?(y(),U(ne,{key:0,disabled:t(d),"list-type":r.listType,files:t(h),crossorigin:r.crossorigin,"handle-preview":r.onPreview,onRemove:t(p)},te({append:R(()=>[w(re,se({ref_key:"uploadRef",ref:i},t(u)),{default:R(()=>[r.$slots.trigger?$(r.$slots,"trigger",{key:0}):g("v-if",!0),!r.$slots.trigger&&r.$slots.default?$(r.$slots,"default",{key:1}):g("v-if",!0)]),_:3},16)]),_:2},[r.$slots.file?{name:"default",fn:R(({file:L,index:T})=>[$(r.$slots,"file",{file:L,index:T})])}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):g("v-if",!0),!t(e)||t(e)&&!r.showFileList?(y(),U(re,se({key:1,ref_key:"uploadRef",ref:i},t(u)),{default:R(()=>[r.$slots.trigger?$(r.$slots,"trigger",{key:0}):g("v-if",!0),!r.$slots.trigger&&r.$slots.default?$(r.$slots,"default",{key:1}):g("v-if",!0)]),_:3},16)):g("v-if",!0),r.$slots.trigger?$(r.$slots,"default",{key:2}):g("v-if",!0),$(r.$slots,"tip"),!t(e)&&r.showFileList?(y(),U(ne,{key:3,disabled:t(d),"list-type":r.listType,files:t(h),crossorigin:r.crossorigin,"handle-preview":r.onPreview,onRemove:t(p)},te({_:2},[r.$slots.file?{name:"default",fn:R(({file:L,index:T})=>[$(r.$slots,"file",{file:L,index:T})])}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):g("v-if",!0)]))}});var pt=M(dt,[["__file","upload.vue"]]);const bt=qe(pt);export{bt as E};
|
|
1
|
+
import{bN as Z,aW as ue,aJ as ce,as as A,ay as v,az as k,_ as M,d as _,ba as ke,a as q,bZ as H,au as de,c as V,i as U,o as y,j as R,b as P,r as $,F as Ee,v as Ce,ch as pe,e as t,n as m,y as g,t as N,aq as B,k as w,E as O,cx as $e,x as Q,f as Re,cy as Fe,cz as Le,bc as we,bg as Pe,cA as Se,cn as Te,aw as Ue,aL as W,cB as x,cC as _e,aU as De,aF as ee,bW as Oe,ax as Be,av as je,aX as Ne,bn as te,aH as se,g as qe}from"./index-BjMVMy9y.js";import{E as Ae}from"./index-WJgswFMW.js";import{m as J,c as Me}from"./typescript-DXZhO2KE.js";import{b as He}from"./_baseClone-DiKhUhxc.js";import{i as Ke}from"./isEqual-Df5ippj8.js";var ze=1,Ie=4;function ae(o){return He(o,ze|Ie)}const fe=Symbol("uploadContextKey"),Xe="ElUpload";class Ge extends Error{constructor(l,a,d,i){super(l),this.name="UploadAjaxError",this.status=a,this.method=d,this.url=i}}function oe(o,l,a){let d;return a.response?d=`${a.response.error||a.response}`:a.responseText?d=`${a.responseText}`:d=`fail to ${l.method} ${o} ${a.status}`,new Ge(d,a.status,l.method,o)}function Ve(o){const l=o.responseText||o.response;if(!l)return l;try{return JSON.parse(l)}catch{return l}}const We=o=>{typeof XMLHttpRequest>"u"&&Z(Xe,"XMLHttpRequest is undefined");const l=new XMLHttpRequest,a=o.action;l.upload&&l.upload.addEventListener("progress",c=>{const f=c;f.percent=c.total>0?c.loaded/c.total*100:0,o.onProgress(f)});const d=new FormData;if(o.data)for(const[c,f]of Object.entries(o.data))ue(f)&&f.length?d.append(c,...f):d.append(c,f);d.append(o.filename,o.file,o.file.name),l.addEventListener("error",()=>{o.onError(oe(a,o,l))}),l.addEventListener("load",()=>{if(l.status<200||l.status>=300)return o.onError(oe(a,o,l));o.onSuccess(Ve(l))}),l.open(o.method,a,!0),o.withCredentials&&"withCredentials"in l&&(l.withCredentials=!0);const i=o.headers||{};if(i instanceof Headers)i.forEach((c,f)=>l.setRequestHeader(f,c));else for(const[c,f]of Object.entries(i))ce(f)||l.setRequestHeader(c,String(f));return l.send(d),l},ve=["text","picture","picture-card"];let Je=1;const Y=()=>Date.now()+Je++,me=A({action:{type:String,default:"#"},headers:{type:v(Object)},method:{type:String,default:"post"},data:{type:v([Object,Function,Promise]),default:()=>J({})},multiple:Boolean,name:{type:String,default:"file"},drag:Boolean,withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:{type:String,default:""},fileList:{type:v(Array),default:()=>J([])},autoUpload:{type:Boolean,default:!0},listType:{type:String,values:ve,default:"text"},httpRequest:{type:v(Function),default:We},disabled:Boolean,limit:Number}),Ye=A({...me,beforeUpload:{type:v(Function),default:k},beforeRemove:{type:v(Function)},onRemove:{type:v(Function),default:k},onChange:{type:v(Function),default:k},onPreview:{type:v(Function),default:k},onSuccess:{type:v(Function),default:k},onProgress:{type:v(Function),default:k},onError:{type:v(Function),default:k},onExceed:{type:v(Function),default:k},crossorigin:{type:v(String)}}),Ze=A({files:{type:v(Array),default:()=>J([])},disabled:Boolean,handlePreview:{type:v(Function),default:k},listType:{type:String,values:ve,default:"text"},crossorigin:{type:v(String)}}),Qe={remove:o=>!!o},xe=_({name:"ElUploadList"}),et=_({...xe,props:Ze,emits:Qe,setup(o,{emit:l}){const a=o,{t:d}=ke(),i=q("upload"),c=q("icon"),f=q("list"),C=H(),h=de(!1),b=V(()=>[i.b("list"),i.bm("list",a.listType),i.is("disabled",a.disabled)]),E=p=>{l("remove",p)};return(p,S)=>(y(),U(Te,{tag:"ul",class:m(t(b)),name:t(f).b()},{default:R(()=>[(y(!0),P(Ee,null,Ce(p.files,(s,n)=>(y(),P("li",{key:s.uid||s.name,class:m([t(i).be("list","item"),t(i).is(s.status),{focusing:h.value}]),tabindex:"0",onKeydown:pe(e=>!t(C)&&E(s),["delete"]),onFocus:e=>h.value=!0,onBlur:e=>h.value=!1,onClick:e=>h.value=!1},[$(p.$slots,"default",{file:s,index:n},()=>[p.listType==="picture"||s.status!=="uploading"&&p.listType==="picture-card"?(y(),P("img",{key:0,class:m(t(i).be("list","item-thumbnail")),src:s.url,crossorigin:p.crossorigin,alt:""},null,10,["src","crossorigin"])):g("v-if",!0),s.status==="uploading"||p.listType!=="picture-card"?(y(),P("div",{key:1,class:m(t(i).be("list","item-info"))},[N("a",{class:m(t(i).be("list","item-name")),onClick:B(e=>p.handlePreview(s),["prevent"])},[w(t(O),{class:m(t(c).m("document"))},{default:R(()=>[w(t($e))]),_:1},8,["class"]),N("span",{class:m(t(i).be("list","item-file-name")),title:s.name},Q(s.name),11,["title"])],10,["onClick"]),s.status==="uploading"?(y(),U(t(Ae),{key:0,type:p.listType==="picture-card"?"circle":"line","stroke-width":p.listType==="picture-card"?6:2,percentage:Number(s.percentage),style:Re(p.listType==="picture-card"?"":"margin-top: 0.5rem")},null,8,["type","stroke-width","percentage","style"])):g("v-if",!0)],2)):g("v-if",!0),N("label",{class:m(t(i).be("list","item-status-label"))},[p.listType==="text"?(y(),U(t(O),{key:0,class:m([t(c).m("upload-success"),t(c).m("circle-check")])},{default:R(()=>[w(t(Fe))]),_:1},8,["class"])):["picture-card","picture"].includes(p.listType)?(y(),U(t(O),{key:1,class:m([t(c).m("upload-success"),t(c).m("check")])},{default:R(()=>[w(t(Le))]),_:1},8,["class"])):g("v-if",!0)],2),t(C)?g("v-if",!0):(y(),U(t(O),{key:2,class:m(t(c).m("close")),onClick:e=>E(s)},{default:R(()=>[w(t(we))]),_:2},1032,["class","onClick"])),g(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),g(" This is a bug which needs to be fixed "),g(" TODO: Fix the incorrect navigation interaction "),t(C)?g("v-if",!0):(y(),P("i",{key:3,class:m(t(c).m("close-tip"))},Q(t(d)("el.upload.deleteTip")),3)),p.listType==="picture-card"?(y(),P("span",{key:4,class:m(t(i).be("list","item-actions"))},[N("span",{class:m(t(i).be("list","item-preview")),onClick:e=>p.handlePreview(s)},[w(t(O),{class:m(t(c).m("zoom-in"))},{default:R(()=>[w(t(Pe))]),_:1},8,["class"])],10,["onClick"]),t(C)?g("v-if",!0):(y(),P("span",{key:0,class:m(t(i).be("list","item-delete")),onClick:e=>E(s)},[w(t(O),{class:m(t(c).m("delete"))},{default:R(()=>[w(t(Se))]),_:1},8,["class"])],10,["onClick"]))],2)):g("v-if",!0)])],42,["onKeydown","onFocus","onBlur","onClick"]))),128)),$(p.$slots,"append")]),_:3},8,["class","name"]))}});var ne=M(et,[["__file","upload-list.vue"]]);const tt=A({disabled:Boolean}),st={file:o=>ue(o)},ye="ElUploadDrag",at=_({name:ye}),ot=_({...at,props:tt,emits:st,setup(o,{emit:l}){Ue(fe)||Z(ye,"usage: <el-upload><el-upload-dragger /></el-upload>");const d=q("upload"),i=de(!1),c=H(),f=b=>{if(c.value)return;i.value=!1,b.stopPropagation();const E=Array.from(b.dataTransfer.files),p=b.dataTransfer.items||[];E.forEach((S,s)=>{var n;const e=p[s],u=(n=e?.webkitGetAsEntry)==null?void 0:n.call(e);u&&(S.isDirectory=u.isDirectory)}),l("file",E)},C=()=>{c.value||(i.value=!0)},h=b=>{b.currentTarget.contains(b.relatedTarget)||(i.value=!1)};return(b,E)=>(y(),P("div",{class:m([t(d).b("dragger"),t(d).is("dragover",i.value)]),onDrop:B(f,["prevent"]),onDragover:B(C,["prevent"]),onDragleave:B(h,["prevent"])},[$(b.$slots,"default")],42,["onDrop","onDragover","onDragleave"]))}});var nt=M(ot,[["__file","upload-dragger.vue"]]);const rt=A({...me,beforeUpload:{type:v(Function),default:k},onRemove:{type:v(Function),default:k},onStart:{type:v(Function),default:k},onSuccess:{type:v(Function),default:k},onProgress:{type:v(Function),default:k},onError:{type:v(Function),default:k},onExceed:{type:v(Function),default:k}}),lt=_({name:"ElUploadContent",inheritAttrs:!1}),it=_({...lt,props:rt,setup(o,{expose:l}){const a=o,d=q("upload"),i=H(),c=W({}),f=W(),C=e=>{if(e.length===0)return;const{autoUpload:u,limit:r,fileList:F,multiple:L,onStart:T,onExceed:K}=a;if(r&&F.length+e.length>r){K(e,F);return}L||(e=e.slice(0,1));for(const z of e){const j=z;j.uid=Y(),T(j),u&&h(j)}},h=async e=>{if(f.value.value="",!a.beforeUpload)return E(e);let u,r={};try{const L=a.data,T=a.beforeUpload(e);r=x(a.data)?ae(a.data):a.data,u=await T,x(a.data)&&Ke(L,r)&&(r=ae(a.data))}catch{u=!1}if(u===!1){a.onRemove(e);return}let F=e;u instanceof Blob&&(u instanceof File?F=u:F=new File([u],e.name,{type:e.type})),E(Object.assign(F,{uid:e.uid}),r)},b=async(e,u)=>De(e)?e(u):e,E=async(e,u)=>{const{headers:r,data:F,method:L,withCredentials:T,name:K,action:z,onProgress:j,onSuccess:ge,onError:be,httpRequest:he}=a;try{u=await b(u??F,e)}catch{a.onRemove(e);return}const{uid:I}=e,X={headers:r||{},withCredentials:T,file:e,data:u,method:L,filename:K,action:z,onProgress:D=>{j(D,e)},onSuccess:D=>{ge(D,e),delete c.value[I]},onError:D=>{be(D,e),delete c.value[I]}},G=he(X);c.value[I]=G,G instanceof Promise&&G.then(X.onSuccess,X.onError)},p=e=>{const u=e.target.files;u&&C(Array.from(u))},S=()=>{i.value||(f.value.value="",f.value.click())},s=()=>{S()};return l({abort:e=>{_e(c.value).filter(e?([r])=>String(e.uid)===r:()=>!0).forEach(([r,F])=>{F instanceof XMLHttpRequest&&F.abort(),delete c.value[r]})},upload:h}),(e,u)=>(y(),P("div",{class:m([t(d).b(),t(d).m(e.listType),t(d).is("drag",e.drag),t(d).is("disabled",t(i))]),tabindex:t(i)?"-1":"0",onClick:S,onKeydown:pe(B(s,["self"]),["enter","space"])},[e.drag?(y(),U(nt,{key:0,disabled:t(i),onFile:C},{default:R(()=>[$(e.$slots,"default")]),_:3},8,["disabled"])):$(e.$slots,"default",{key:1}),N("input",{ref_key:"inputRef",ref:f,class:m(t(d).e("input")),name:e.name,disabled:t(i),multiple:e.multiple,accept:e.accept,type:"file",onChange:p,onClick:B(()=>{},["stop"])},null,42,["name","disabled","multiple","accept","onClick"])],42,["tabindex","onKeydown"]))}});var re=M(it,[["__file","upload-content.vue"]]);const le="ElUpload",ie=o=>{var l;(l=o.url)!=null&&l.startsWith("blob:")&&URL.revokeObjectURL(o.url)},ut=(o,l)=>{const a=Me(o,"fileList",void 0,{passive:!0}),d=s=>a.value.find(n=>n.uid===s.uid);function i(s){var n;(n=l.value)==null||n.abort(s)}function c(s=["ready","uploading","success","fail"]){a.value=a.value.filter(n=>!s.includes(n.status))}function f(s){a.value=a.value.filter(n=>n.uid!==s.uid)}const C=(s,n)=>{const e=d(n);e&&(console.error(s),e.status="fail",f(e),o.onError(s,e,a.value),o.onChange(e,a.value))},h=(s,n)=>{const e=d(n);e&&(o.onProgress(s,e,a.value),e.status="uploading",e.percentage=Math.round(s.percent))},b=(s,n)=>{const e=d(n);e&&(e.status="success",e.response=s,o.onSuccess(s,e,a.value),o.onChange(e,a.value))},E=s=>{ce(s.uid)&&(s.uid=Y());const n={name:s.name,percentage:0,status:"ready",size:s.size,raw:s,uid:s.uid};if(o.listType==="picture-card"||o.listType==="picture")try{n.url=URL.createObjectURL(s)}catch(e){Oe(le,e.message),o.onError(e,n,a.value)}a.value=[...a.value,n],o.onChange(n,a.value)},p=async s=>{const n=s instanceof File?d(s):s;n||Z(le,"file to be removed not found");const e=u=>{i(u),f(u),o.onRemove(u,a.value),ie(u)};o.beforeRemove?await o.beforeRemove(n,a.value)!==!1&&e(n):e(n)};function S(){a.value.filter(({status:s})=>s==="ready").forEach(({raw:s})=>{var n;return s&&((n=l.value)==null?void 0:n.upload(s))})}return ee(()=>o.listType,s=>{s!=="picture-card"&&s!=="picture"||(a.value=a.value.map(n=>{const{raw:e,url:u}=n;if(!u&&e)try{n.url=URL.createObjectURL(e)}catch(r){o.onError(r,n,a.value)}return n}))}),ee(a,s=>{for(const n of s)n.uid||(n.uid=Y()),n.status||(n.status="success")},{immediate:!0,deep:!0}),{uploadFiles:a,abort:i,clearFiles:c,handleError:C,handleProgress:h,handleStart:E,handleSuccess:b,handleRemove:p,submit:S,revokeFileObjectURL:ie}},ct=_({name:"ElUpload"}),dt=_({...ct,props:Ye,setup(o,{expose:l}){const a=o,d=H(),i=W(),{abort:c,submit:f,clearFiles:C,uploadFiles:h,handleStart:b,handleError:E,handleRemove:p,handleSuccess:S,handleProgress:s,revokeFileObjectURL:n}=ut(a,i),e=V(()=>a.listType==="picture-card"),u=V(()=>({...a,fileList:h.value,onStart:b,onProgress:s,onSuccess:S,onError:E,onRemove:p}));return Be(()=>{h.value.forEach(n)}),je(fe,{accept:Ne(a,"accept")}),l({abort:c,submit:f,clearFiles:C,handleStart:b,handleRemove:p}),(r,F)=>(y(),P("div",null,[t(e)&&r.showFileList?(y(),U(ne,{key:0,disabled:t(d),"list-type":r.listType,files:t(h),crossorigin:r.crossorigin,"handle-preview":r.onPreview,onRemove:t(p)},te({append:R(()=>[w(re,se({ref_key:"uploadRef",ref:i},t(u)),{default:R(()=>[r.$slots.trigger?$(r.$slots,"trigger",{key:0}):g("v-if",!0),!r.$slots.trigger&&r.$slots.default?$(r.$slots,"default",{key:1}):g("v-if",!0)]),_:3},16)]),_:2},[r.$slots.file?{name:"default",fn:R(({file:L,index:T})=>[$(r.$slots,"file",{file:L,index:T})])}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):g("v-if",!0),!t(e)||t(e)&&!r.showFileList?(y(),U(re,se({key:1,ref_key:"uploadRef",ref:i},t(u)),{default:R(()=>[r.$slots.trigger?$(r.$slots,"trigger",{key:0}):g("v-if",!0),!r.$slots.trigger&&r.$slots.default?$(r.$slots,"default",{key:1}):g("v-if",!0)]),_:3},16)):g("v-if",!0),r.$slots.trigger?$(r.$slots,"default",{key:2}):g("v-if",!0),$(r.$slots,"tip"),!t(e)&&r.showFileList?(y(),U(ne,{key:3,disabled:t(d),"list-type":r.listType,files:t(h),crossorigin:r.crossorigin,"handle-preview":r.onPreview,onRemove:t(p)},te({_:2},[r.$slots.file?{name:"default",fn:R(({file:L,index:T})=>[$(r.$slots,"file",{file:L,index:T})])}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):g("v-if",!0)]))}});var pt=M(dt,[["__file","upload.vue"]]);const bt=qe(pt);export{bt as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as ce}from"./index-Czog4o5z.js";import{c as k,O as Te,E as $e,w as ie}from"./index-DITqxnfk.js";import{E as Fe}from"./index-DNzgGVij.js";import{as as Re,ay as Q,_ as M,d as A,r as P,au as T,aw as C,c as y,e as O,av as J,aX as Y,b4 as Se,aF as pe,l as w,i as z,o as N,j as m,k as R,bo as Oe,bp as ke,b as W,y as Z,bn as Ne,aH as j,n as q,A as Pe,E as fe,a as ee,ba as De,bw as Be,bx as Ke,b3 as ve,ax as Le,aT as me,aR as H,bl as Me,t as Ae,bh as Ge,aq as x,F as ze,by as be,f as Ue,bz as Ye,g as He,w as ge}from"./index-CLwJbfYs.js";import{a as Ve}from"./typescript-CoKqfRJS.js";import{c as Je,d as We,E as je,a as we,C as qe,b as Xe,e as Qe,f as Ze,g as xe,F as eo,L as oo}from"./dropdown-CfSu6_B-.js";import{c as no}from"./castArray-CoJ3z4SB.js";const to=Re({style:{type:Q([String,Array,Object])},currentTabId:{type:Q(String)},defaultCurrentTabId:String,loop:Boolean,dir:{type:String,values:["ltr","rtl"],default:"ltr"},orientation:{type:Q(String)},onBlur:Function,onFocus:Function,onMousedown:Function}),{ElCollection:ro,ElCollectionItem:lo,COLLECTION_INJECTION_KEY:oe,COLLECTION_ITEM_INJECTION_KEY:so}=Je("RovingFocusGroup"),ne=Symbol("elRovingFocusGroup"),_e=Symbol("elRovingFocusGroupItem"),ao={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"},io=(e,n)=>e,uo=(e,n,d)=>{const r=io(e.code);return ao[r]},co=(e,n)=>e.map((d,r)=>e[(r+n)%e.length]),te=e=>{const{activeElement:n}=document;for(const d of e)if(d===n||(d.focus(),n!==document.activeElement))return},de="currentTabIdChange",ue="rovingFocusGroup.entryFocus",po={bubbles:!1,cancelable:!0},fo=A({name:"ElRovingFocusGroupImpl",inheritAttrs:!1,props:to,emits:[de,"entryFocus"],setup(e,{emit:n}){var d;const r=T((d=e.currentTabId||e.defaultCurrentTabId)!=null?d:null),c=T(!1),u=T(!1),a=T(),{getItems:l}=C(oe,void 0),p=y(()=>[{outline:"none"},e.style]),b=i=>{n(de,i)},g=()=>{c.value=!0},_=k(i=>{var f;(f=e.onMousedown)==null||f.call(e,i)},()=>{u.value=!0}),E=k(i=>{var f;(f=e.onFocus)==null||f.call(e,i)},i=>{const f=!O(u),{target:D,currentTarget:$}=i;if(D===$&&f&&!O(c)){const B=new Event(ue,po);if($?.dispatchEvent(B),!B.defaultPrevented){const v=l().filter(F=>F.focusable),S=v.find(F=>F.active),I=v.find(F=>F.id===O(r)),L=[S,I,...v].filter(Boolean).map(F=>F.ref);te(L)}}u.value=!1}),o=k(i=>{var f;(f=e.onBlur)==null||f.call(e,i)},()=>{c.value=!1}),s=(...i)=>{n("entryFocus",...i)};J(ne,{currentTabbedId:Se(r),loop:Y(e,"loop"),tabIndex:y(()=>O(c)?-1:0),rovingFocusGroupRef:a,rovingFocusGroupRootStyle:p,orientation:Y(e,"orientation"),dir:Y(e,"dir"),onItemFocus:b,onItemShiftTab:g,onBlur:o,onFocus:E,onMousedown:_}),pe(()=>e.currentTabId,i=>{r.value=i??null}),Ve(a,ue,s)}});function vo(e,n,d,r,c,u){return P(e.$slots,"default")}var mo=M(fo,[["render",vo],["__file","roving-focus-group-impl.vue"]]);const bo=A({name:"ElRovingFocusGroup",components:{ElFocusGroupCollection:ro,ElRovingFocusGroupImpl:mo}});function go(e,n,d,r,c,u){const a=w("el-roving-focus-group-impl"),l=w("el-focus-group-collection");return N(),z(l,null,{default:m(()=>[R(a,Oe(ke(e.$attrs)),{default:m(()=>[P(e.$slots,"default")]),_:3},16)]),_:3})}var wo=M(bo,[["render",go],["__file","roving-focus-group.vue"]]);const X=Symbol("elDropdown"),Ie="elDropdown",{ButtonGroup:_o}=ce,Io=A({name:"ElDropdown",components:{ElButton:ce,ElButtonGroup:_o,ElScrollbar:Fe,ElDropdownCollection:je,ElTooltip:$e,ElRovingFocusGroup:wo,ElOnlyChild:Te,ElIcon:fe,ArrowDown:Pe},props:We,emits:["visible-change","click","command"],setup(e,{emit:n}){const d=me(),r=ee("dropdown"),{t:c}=De(),u=T(),a=T(),l=T(),p=T(),b=T(null),g=T(null),_=T(!1),E=y(()=>({maxHeight:Be(e.maxHeight)})),o=y(()=>[r.m(v.value)]),s=y(()=>no(e.trigger)),i=ve().value,f=y(()=>e.id||i);pe([u,s],([t,h],[G])=>{var le,se,ae;(le=G?.$el)!=null&&le.removeEventListener&&G.$el.removeEventListener("pointerenter",I),(se=t?.$el)!=null&&se.removeEventListener&&t.$el.removeEventListener("pointerenter",I),(ae=t?.$el)!=null&&ae.addEventListener&&h.includes("hover")&&t.$el.addEventListener("pointerenter",I)},{immediate:!0}),Le(()=>{var t,h;(h=(t=u.value)==null?void 0:t.$el)!=null&&h.removeEventListener&&u.value.$el.removeEventListener("pointerenter",I)});function D(){$()}function $(){var t;(t=l.value)==null||t.onClose()}function B(){var t;(t=l.value)==null||t.onOpen()}const v=Ke();function S(...t){n("command",...t)}function I(){var t,h;(h=(t=u.value)==null?void 0:t.$el)==null||h.focus()}function K(){}function L(){const t=O(p);s.value.includes("hover")&&t?.focus(),g.value=null}function F(t){g.value=t}function re(t){_.value||(t.preventDefault(),t.stopImmediatePropagation())}function V(){n("visible-change",!0)}function U(t){var h;t?.type==="keydown"&&((h=p.value)==null||h.focus())}function ye(){n("visible-change",!1)}return J(X,{contentRef:p,role:y(()=>e.role),triggerId:f,isUsingKeyboard:_,onItemEnter:K,onItemLeave:L}),J(Ie,{instance:d,dropdownSize:v,handleClick:D,commandHandler:S,trigger:Y(e,"trigger"),hideOnClick:Y(e,"hideOnClick")}),{t:c,ns:r,scrollbar:b,wrapStyle:E,dropdownTriggerKls:o,dropdownSize:v,triggerId:f,currentTabId:g,handleCurrentTabIdChange:F,handlerMainButtonClick:t=>{n("click",t)},handleEntryFocus:re,handleClose:$,handleOpen:B,handleBeforeShowTooltip:V,handleShowTooltip:U,handleBeforeHideTooltip:ye,onFocusAfterTrapped:t=>{var h,G;t.preventDefault(),(G=(h=p.value)==null?void 0:h.focus)==null||G.call(h,{preventScroll:!0})},popperRef:l,contentRef:p,triggeringElementRef:u,referenceElementRef:a}}});function Eo(e,n,d,r,c,u){var a;const l=w("el-dropdown-collection"),p=w("el-roving-focus-group"),b=w("el-scrollbar"),g=w("el-only-child"),_=w("el-tooltip"),E=w("el-button"),o=w("arrow-down"),s=w("el-icon"),i=w("el-button-group");return N(),W("div",{class:q([e.ns.b(),e.ns.is("disabled",e.disabled)])},[R(_,{ref:"popperRef",role:e.role,effect:e.effect,"fallback-placements":["bottom","top"],"popper-options":e.popperOptions,"gpu-acceleration":!1,"hide-after":e.trigger==="hover"?e.hideTimeout:0,"manual-mode":!0,placement:e.placement,"popper-class":[e.ns.e("popper"),e.popperClass],"reference-element":(a=e.referenceElementRef)==null?void 0:a.$el,trigger:e.trigger,"trigger-keys":e.triggerKeys,"trigger-target-el":e.contentRef,"show-after":e.trigger==="hover"?e.showTimeout:0,"stop-popper-mouse-event":!1,"virtual-ref":e.triggeringElementRef,"virtual-triggering":e.splitButton,disabled:e.disabled,transition:`${e.ns.namespace.value}-zoom-in-top`,teleported:e.teleported,pure:"",persistent:e.persistent,onBeforeShow:e.handleBeforeShowTooltip,onShow:e.handleShowTooltip,onBeforeHide:e.handleBeforeHideTooltip},Ne({content:m(()=>[R(b,{ref:"scrollbar","wrap-style":e.wrapStyle,tag:"div","view-class":e.ns.e("list")},{default:m(()=>[R(p,{loop:e.loop,"current-tab-id":e.currentTabId,orientation:"horizontal",onCurrentTabIdChange:e.handleCurrentTabIdChange,onEntryFocus:e.handleEntryFocus},{default:m(()=>[R(l,null,{default:m(()=>[P(e.$slots,"dropdown")]),_:3})]),_:3},8,["loop","current-tab-id","onCurrentTabIdChange","onEntryFocus"])]),_:3},8,["wrap-style","view-class"])]),_:2},[e.splitButton?void 0:{name:"default",fn:m(()=>[R(g,{id:e.triggerId,ref:"triggeringElementRef",role:"button",tabindex:e.tabindex},{default:m(()=>[P(e.$slots,"default")]),_:3},8,["id","tabindex"])])}]),1032,["role","effect","popper-options","hide-after","placement","popper-class","reference-element","trigger","trigger-keys","trigger-target-el","show-after","virtual-ref","virtual-triggering","disabled","transition","teleported","persistent","onBeforeShow","onShow","onBeforeHide"]),e.splitButton?(N(),z(i,{key:0},{default:m(()=>[R(E,j({ref:"referenceElementRef"},e.buttonProps,{size:e.dropdownSize,type:e.type,disabled:e.disabled,tabindex:e.tabindex,onClick:e.handlerMainButtonClick}),{default:m(()=>[P(e.$slots,"default")]),_:3},16,["size","type","disabled","tabindex","onClick"]),R(E,j({id:e.triggerId,ref:"triggeringElementRef"},e.buttonProps,{role:"button",size:e.dropdownSize,type:e.type,class:e.ns.e("caret-button"),disabled:e.disabled,tabindex:e.tabindex,"aria-label":e.t("el.dropdown.toggleDropdown")}),{default:m(()=>[R(s,{class:q(e.ns.e("icon"))},{default:m(()=>[R(o)]),_:1},8,["class"])]),_:1},16,["id","size","type","class","disabled","tabindex","aria-label"])]),_:3})):Z("v-if",!0)],2)}var ho=M(Io,[["render",Eo],["__file","dropdown.vue"]]);const Co=A({components:{ElRovingFocusCollectionItem:lo},props:{focusable:{type:Boolean,default:!0},active:Boolean},emits:["mousedown","focus","keydown"],setup(e,{emit:n}){const{currentTabbedId:d,loop:r,onItemFocus:c,onItemShiftTab:u}=C(ne,void 0),{getItems:a}=C(oe,void 0),l=ve(),p=T(),b=k(o=>{n("mousedown",o)},o=>{e.focusable?c(O(l)):o.preventDefault()}),g=k(o=>{n("focus",o)},()=>{c(O(l))}),_=k(o=>{n("keydown",o)},o=>{const{code:s,shiftKey:i,target:f,currentTarget:D}=o;if(s===H.tab&&i){u();return}if(f!==D)return;const $=uo(o);if($){o.preventDefault();let v=a().filter(S=>S.focusable).map(S=>S.ref);switch($){case"last":{v.reverse();break}case"prev":case"next":{$==="prev"&&v.reverse();const S=v.indexOf(D);v=r.value?co(v,S+1):v.slice(S+1);break}}Me(()=>{te(v)})}}),E=y(()=>d.value===O(l));return J(_e,{rovingFocusGroupItemRef:p,tabIndex:y(()=>O(E)?0:-1),handleMousedown:b,handleFocus:g,handleKeydown:_}),{id:l,handleKeydown:_,handleFocus:g,handleMousedown:b}}});function yo(e,n,d,r,c,u){const a=w("el-roving-focus-collection-item");return N(),z(a,{id:e.id,focusable:e.focusable,active:e.active},{default:m(()=>[P(e.$slots,"default")]),_:3},8,["id","focusable","active"])}var To=M(Co,[["render",yo],["__file","roving-focus-item.vue"]]);const $o=A({name:"DropdownItemImpl",components:{ElIcon:fe},props:we,emits:["pointermove","pointerleave","click","clickimpl"],setup(e,{emit:n}){const d=ee("dropdown"),{role:r}=C(X,void 0),{collectionItemRef:c}=C(Xe,void 0),{collectionItemRef:u}=C(so,void 0),{rovingFocusGroupItemRef:a,tabIndex:l,handleFocus:p,handleKeydown:b,handleMousedown:g}=C(_e,void 0),_=be(c,u,a),E=y(()=>r.value==="menu"?"menuitem":r.value==="navigation"?"link":"button"),o=k(s=>{if([H.enter,H.numpadEnter,H.space].includes(s.code))return s.preventDefault(),s.stopImmediatePropagation(),n("clickimpl",s),!0},b);return{ns:d,itemRef:_,dataset:{[qe]:""},role:E,tabIndex:l,handleFocus:p,handleKeydown:o,handleMousedown:g}}});function Fo(e,n,d,r,c,u){const a=w("el-icon");return N(),W(ze,null,[e.divided?(N(),W("li",{key:0,role:"separator",class:q(e.ns.bem("menu","item","divided"))},null,2)):Z("v-if",!0),Ae("li",j({ref:e.itemRef},{...e.dataset,...e.$attrs},{"aria-disabled":e.disabled,class:[e.ns.be("menu","item"),e.ns.is("disabled",e.disabled)],tabindex:e.tabIndex,role:e.role,onClick:l=>e.$emit("clickimpl",l),onFocus:e.handleFocus,onKeydown:x(e.handleKeydown,["self"]),onMousedown:e.handleMousedown,onPointermove:l=>e.$emit("pointermove",l),onPointerleave:l=>e.$emit("pointerleave",l)}),[e.icon?(N(),z(a,{key:0},{default:m(()=>[(N(),z(Ge(e.icon)))]),_:1})):Z("v-if",!0),P(e.$slots,"default")],16,["aria-disabled","tabindex","role","onClick","onFocus","onKeydown","onMousedown","onPointermove","onPointerleave"])],64)}var Ro=M($o,[["render",Fo],["__file","dropdown-item-impl.vue"]]);const Ee=()=>{const e=C(Ie,{}),n=y(()=>e?.dropdownSize);return{elDropdown:e,_elDropdownSize:n}},So=A({name:"ElDropdownItem",components:{ElDropdownCollectionItem:Qe,ElRovingFocusItem:To,ElDropdownItemImpl:Ro},inheritAttrs:!1,props:we,emits:["pointermove","pointerleave","click"],setup(e,{emit:n,attrs:d}){const{elDropdown:r}=Ee(),c=me(),u=T(null),a=y(()=>{var o,s;return(s=(o=O(u))==null?void 0:o.textContent)!=null?s:""}),{onItemEnter:l,onItemLeave:p}=C(X,void 0),b=k(o=>(n("pointermove",o),o.defaultPrevented),ie(o=>{if(e.disabled){p(o);return}const s=o.currentTarget;s===document.activeElement||s.contains(document.activeElement)||(l(o),o.defaultPrevented||s?.focus())})),g=k(o=>(n("pointerleave",o),o.defaultPrevented),ie(p)),_=k(o=>{if(!e.disabled)return n("click",o),o.type!=="keydown"&&o.defaultPrevented},o=>{var s,i,f;if(e.disabled){o.stopImmediatePropagation();return}(s=r?.hideOnClick)!=null&&s.value&&((i=r.handleClick)==null||i.call(r)),(f=r.commandHandler)==null||f.call(r,e.command,c,o)}),E=y(()=>({...e,...d}));return{handleClick:_,handlePointerMove:b,handlePointerLeave:g,textContent:a,propsAndAttrs:E}}});function Oo(e,n,d,r,c,u){var a;const l=w("el-dropdown-item-impl"),p=w("el-roving-focus-item"),b=w("el-dropdown-collection-item");return N(),z(b,{disabled:e.disabled,"text-value":(a=e.textValue)!=null?a:e.textContent},{default:m(()=>[R(p,{focusable:!e.disabled},{default:m(()=>[R(l,j(e.propsAndAttrs,{onPointerleave:e.handlePointerLeave,onPointermove:e.handlePointerMove,onClickimpl:e.handleClick}),{default:m(()=>[P(e.$slots,"default")]),_:3},16,["onPointerleave","onPointermove","onClickimpl"])]),_:3},8,["focusable"])]),_:3},8,["disabled","text-value"])}var he=M(So,[["render",Oo],["__file","dropdown-item.vue"]]);const ko=A({name:"ElDropdownMenu",props:Ze,setup(e){const n=ee("dropdown"),{_elDropdownSize:d}=Ee(),r=d.value,{focusTrapRef:c,onKeydown:u}=C(Ye,void 0),{contentRef:a,role:l,triggerId:p}=C(X,void 0),{collectionRef:b,getItems:g}=C(xe,void 0),{rovingFocusGroupRef:_,rovingFocusGroupRootStyle:E,tabIndex:o,onBlur:s,onFocus:i,onMousedown:f}=C(ne,void 0),{collectionRef:D}=C(oe,void 0),$=y(()=>[n.b("menu"),n.bm("menu",r?.value)]),B=be(a,b,c,_,D),v=k(I=>{var K;(K=e.onKeydown)==null||K.call(e,I)},I=>{const{currentTarget:K,code:L,target:F}=I;if(K.contains(F),H.tab===L&&I.stopImmediatePropagation(),I.preventDefault(),F!==O(a)||!eo.includes(L))return;const V=g().filter(U=>!U.disabled).map(U=>U.ref);oo.includes(L)&&V.reverse(),te(V)});return{size:r,rovingFocusGroupRootStyle:E,tabIndex:o,dropdownKls:$,role:l,triggerId:p,dropdownListWrapperRef:B,handleKeydown:I=>{v(I),u(I)},onBlur:s,onFocus:i,onMousedown:f}}});function No(e,n,d,r,c,u){return N(),W("ul",{ref:e.dropdownListWrapperRef,class:q(e.dropdownKls),style:Ue(e.rovingFocusGroupRootStyle),tabindex:-1,role:e.role,"aria-labelledby":e.triggerId,onBlur:e.onBlur,onFocus:e.onFocus,onKeydown:x(e.handleKeydown,["self"]),onMousedown:x(e.onMousedown,["self"])},[P(e.$slots,"default")],46,["role","aria-labelledby","onBlur","onFocus","onKeydown","onMousedown"])}var Ce=M(ko,[["render",No],["__file","dropdown-menu.vue"]]);const Uo=He(ho,{DropdownItem:he,DropdownMenu:Ce}),Yo=ge(he),Ho=ge(Ce);export{Yo as E,Ho as a,Uo as b};
|
|
1
|
+
import{E as ce}from"./index-7746Wyq5.js";import{c as k,O as Te,E as $e,w as ie}from"./index-DulF_7UO.js";import{E as Fe}from"./index-B-7UQmSa.js";import{as as Re,ay as Q,_ as M,d as A,r as P,au as T,aw as C,c as y,e as O,av as J,aX as Y,b4 as Se,aF as pe,l as w,i as z,o as N,j as m,k as R,bo as Oe,bp as ke,b as W,y as Z,bn as Ne,aH as j,n as q,A as Pe,E as fe,a as ee,ba as De,bw as Be,bx as Ke,b3 as ve,ax as Le,aT as me,aR as H,bl as Me,t as Ae,bh as Ge,aq as x,F as ze,by as be,f as Ue,bz as Ye,g as He,w as ge}from"./index-BjMVMy9y.js";import{a as Ve}from"./typescript-DXZhO2KE.js";import{c as Je,d as We,E as je,a as we,C as qe,b as Xe,e as Qe,f as Ze,g as xe,F as eo,L as oo}from"./dropdown-UbXA6R_N.js";import{c as no}from"./castArray-7tYrhn6A.js";const to=Re({style:{type:Q([String,Array,Object])},currentTabId:{type:Q(String)},defaultCurrentTabId:String,loop:Boolean,dir:{type:String,values:["ltr","rtl"],default:"ltr"},orientation:{type:Q(String)},onBlur:Function,onFocus:Function,onMousedown:Function}),{ElCollection:ro,ElCollectionItem:lo,COLLECTION_INJECTION_KEY:oe,COLLECTION_ITEM_INJECTION_KEY:so}=Je("RovingFocusGroup"),ne=Symbol("elRovingFocusGroup"),_e=Symbol("elRovingFocusGroupItem"),ao={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"},io=(e,n)=>e,uo=(e,n,d)=>{const r=io(e.code);return ao[r]},co=(e,n)=>e.map((d,r)=>e[(r+n)%e.length]),te=e=>{const{activeElement:n}=document;for(const d of e)if(d===n||(d.focus(),n!==document.activeElement))return},de="currentTabIdChange",ue="rovingFocusGroup.entryFocus",po={bubbles:!1,cancelable:!0},fo=A({name:"ElRovingFocusGroupImpl",inheritAttrs:!1,props:to,emits:[de,"entryFocus"],setup(e,{emit:n}){var d;const r=T((d=e.currentTabId||e.defaultCurrentTabId)!=null?d:null),c=T(!1),u=T(!1),a=T(),{getItems:l}=C(oe,void 0),p=y(()=>[{outline:"none"},e.style]),b=i=>{n(de,i)},g=()=>{c.value=!0},_=k(i=>{var f;(f=e.onMousedown)==null||f.call(e,i)},()=>{u.value=!0}),E=k(i=>{var f;(f=e.onFocus)==null||f.call(e,i)},i=>{const f=!O(u),{target:D,currentTarget:$}=i;if(D===$&&f&&!O(c)){const B=new Event(ue,po);if($?.dispatchEvent(B),!B.defaultPrevented){const v=l().filter(F=>F.focusable),S=v.find(F=>F.active),I=v.find(F=>F.id===O(r)),L=[S,I,...v].filter(Boolean).map(F=>F.ref);te(L)}}u.value=!1}),o=k(i=>{var f;(f=e.onBlur)==null||f.call(e,i)},()=>{c.value=!1}),s=(...i)=>{n("entryFocus",...i)};J(ne,{currentTabbedId:Se(r),loop:Y(e,"loop"),tabIndex:y(()=>O(c)?-1:0),rovingFocusGroupRef:a,rovingFocusGroupRootStyle:p,orientation:Y(e,"orientation"),dir:Y(e,"dir"),onItemFocus:b,onItemShiftTab:g,onBlur:o,onFocus:E,onMousedown:_}),pe(()=>e.currentTabId,i=>{r.value=i??null}),Ve(a,ue,s)}});function vo(e,n,d,r,c,u){return P(e.$slots,"default")}var mo=M(fo,[["render",vo],["__file","roving-focus-group-impl.vue"]]);const bo=A({name:"ElRovingFocusGroup",components:{ElFocusGroupCollection:ro,ElRovingFocusGroupImpl:mo}});function go(e,n,d,r,c,u){const a=w("el-roving-focus-group-impl"),l=w("el-focus-group-collection");return N(),z(l,null,{default:m(()=>[R(a,Oe(ke(e.$attrs)),{default:m(()=>[P(e.$slots,"default")]),_:3},16)]),_:3})}var wo=M(bo,[["render",go],["__file","roving-focus-group.vue"]]);const X=Symbol("elDropdown"),Ie="elDropdown",{ButtonGroup:_o}=ce,Io=A({name:"ElDropdown",components:{ElButton:ce,ElButtonGroup:_o,ElScrollbar:Fe,ElDropdownCollection:je,ElTooltip:$e,ElRovingFocusGroup:wo,ElOnlyChild:Te,ElIcon:fe,ArrowDown:Pe},props:We,emits:["visible-change","click","command"],setup(e,{emit:n}){const d=me(),r=ee("dropdown"),{t:c}=De(),u=T(),a=T(),l=T(),p=T(),b=T(null),g=T(null),_=T(!1),E=y(()=>({maxHeight:Be(e.maxHeight)})),o=y(()=>[r.m(v.value)]),s=y(()=>no(e.trigger)),i=ve().value,f=y(()=>e.id||i);pe([u,s],([t,h],[G])=>{var le,se,ae;(le=G?.$el)!=null&&le.removeEventListener&&G.$el.removeEventListener("pointerenter",I),(se=t?.$el)!=null&&se.removeEventListener&&t.$el.removeEventListener("pointerenter",I),(ae=t?.$el)!=null&&ae.addEventListener&&h.includes("hover")&&t.$el.addEventListener("pointerenter",I)},{immediate:!0}),Le(()=>{var t,h;(h=(t=u.value)==null?void 0:t.$el)!=null&&h.removeEventListener&&u.value.$el.removeEventListener("pointerenter",I)});function D(){$()}function $(){var t;(t=l.value)==null||t.onClose()}function B(){var t;(t=l.value)==null||t.onOpen()}const v=Ke();function S(...t){n("command",...t)}function I(){var t,h;(h=(t=u.value)==null?void 0:t.$el)==null||h.focus()}function K(){}function L(){const t=O(p);s.value.includes("hover")&&t?.focus(),g.value=null}function F(t){g.value=t}function re(t){_.value||(t.preventDefault(),t.stopImmediatePropagation())}function V(){n("visible-change",!0)}function U(t){var h;t?.type==="keydown"&&((h=p.value)==null||h.focus())}function ye(){n("visible-change",!1)}return J(X,{contentRef:p,role:y(()=>e.role),triggerId:f,isUsingKeyboard:_,onItemEnter:K,onItemLeave:L}),J(Ie,{instance:d,dropdownSize:v,handleClick:D,commandHandler:S,trigger:Y(e,"trigger"),hideOnClick:Y(e,"hideOnClick")}),{t:c,ns:r,scrollbar:b,wrapStyle:E,dropdownTriggerKls:o,dropdownSize:v,triggerId:f,currentTabId:g,handleCurrentTabIdChange:F,handlerMainButtonClick:t=>{n("click",t)},handleEntryFocus:re,handleClose:$,handleOpen:B,handleBeforeShowTooltip:V,handleShowTooltip:U,handleBeforeHideTooltip:ye,onFocusAfterTrapped:t=>{var h,G;t.preventDefault(),(G=(h=p.value)==null?void 0:h.focus)==null||G.call(h,{preventScroll:!0})},popperRef:l,contentRef:p,triggeringElementRef:u,referenceElementRef:a}}});function Eo(e,n,d,r,c,u){var a;const l=w("el-dropdown-collection"),p=w("el-roving-focus-group"),b=w("el-scrollbar"),g=w("el-only-child"),_=w("el-tooltip"),E=w("el-button"),o=w("arrow-down"),s=w("el-icon"),i=w("el-button-group");return N(),W("div",{class:q([e.ns.b(),e.ns.is("disabled",e.disabled)])},[R(_,{ref:"popperRef",role:e.role,effect:e.effect,"fallback-placements":["bottom","top"],"popper-options":e.popperOptions,"gpu-acceleration":!1,"hide-after":e.trigger==="hover"?e.hideTimeout:0,"manual-mode":!0,placement:e.placement,"popper-class":[e.ns.e("popper"),e.popperClass],"reference-element":(a=e.referenceElementRef)==null?void 0:a.$el,trigger:e.trigger,"trigger-keys":e.triggerKeys,"trigger-target-el":e.contentRef,"show-after":e.trigger==="hover"?e.showTimeout:0,"stop-popper-mouse-event":!1,"virtual-ref":e.triggeringElementRef,"virtual-triggering":e.splitButton,disabled:e.disabled,transition:`${e.ns.namespace.value}-zoom-in-top`,teleported:e.teleported,pure:"",persistent:e.persistent,onBeforeShow:e.handleBeforeShowTooltip,onShow:e.handleShowTooltip,onBeforeHide:e.handleBeforeHideTooltip},Ne({content:m(()=>[R(b,{ref:"scrollbar","wrap-style":e.wrapStyle,tag:"div","view-class":e.ns.e("list")},{default:m(()=>[R(p,{loop:e.loop,"current-tab-id":e.currentTabId,orientation:"horizontal",onCurrentTabIdChange:e.handleCurrentTabIdChange,onEntryFocus:e.handleEntryFocus},{default:m(()=>[R(l,null,{default:m(()=>[P(e.$slots,"dropdown")]),_:3})]),_:3},8,["loop","current-tab-id","onCurrentTabIdChange","onEntryFocus"])]),_:3},8,["wrap-style","view-class"])]),_:2},[e.splitButton?void 0:{name:"default",fn:m(()=>[R(g,{id:e.triggerId,ref:"triggeringElementRef",role:"button",tabindex:e.tabindex},{default:m(()=>[P(e.$slots,"default")]),_:3},8,["id","tabindex"])])}]),1032,["role","effect","popper-options","hide-after","placement","popper-class","reference-element","trigger","trigger-keys","trigger-target-el","show-after","virtual-ref","virtual-triggering","disabled","transition","teleported","persistent","onBeforeShow","onShow","onBeforeHide"]),e.splitButton?(N(),z(i,{key:0},{default:m(()=>[R(E,j({ref:"referenceElementRef"},e.buttonProps,{size:e.dropdownSize,type:e.type,disabled:e.disabled,tabindex:e.tabindex,onClick:e.handlerMainButtonClick}),{default:m(()=>[P(e.$slots,"default")]),_:3},16,["size","type","disabled","tabindex","onClick"]),R(E,j({id:e.triggerId,ref:"triggeringElementRef"},e.buttonProps,{role:"button",size:e.dropdownSize,type:e.type,class:e.ns.e("caret-button"),disabled:e.disabled,tabindex:e.tabindex,"aria-label":e.t("el.dropdown.toggleDropdown")}),{default:m(()=>[R(s,{class:q(e.ns.e("icon"))},{default:m(()=>[R(o)]),_:1},8,["class"])]),_:1},16,["id","size","type","class","disabled","tabindex","aria-label"])]),_:3})):Z("v-if",!0)],2)}var ho=M(Io,[["render",Eo],["__file","dropdown.vue"]]);const Co=A({components:{ElRovingFocusCollectionItem:lo},props:{focusable:{type:Boolean,default:!0},active:Boolean},emits:["mousedown","focus","keydown"],setup(e,{emit:n}){const{currentTabbedId:d,loop:r,onItemFocus:c,onItemShiftTab:u}=C(ne,void 0),{getItems:a}=C(oe,void 0),l=ve(),p=T(),b=k(o=>{n("mousedown",o)},o=>{e.focusable?c(O(l)):o.preventDefault()}),g=k(o=>{n("focus",o)},()=>{c(O(l))}),_=k(o=>{n("keydown",o)},o=>{const{code:s,shiftKey:i,target:f,currentTarget:D}=o;if(s===H.tab&&i){u();return}if(f!==D)return;const $=uo(o);if($){o.preventDefault();let v=a().filter(S=>S.focusable).map(S=>S.ref);switch($){case"last":{v.reverse();break}case"prev":case"next":{$==="prev"&&v.reverse();const S=v.indexOf(D);v=r.value?co(v,S+1):v.slice(S+1);break}}Me(()=>{te(v)})}}),E=y(()=>d.value===O(l));return J(_e,{rovingFocusGroupItemRef:p,tabIndex:y(()=>O(E)?0:-1),handleMousedown:b,handleFocus:g,handleKeydown:_}),{id:l,handleKeydown:_,handleFocus:g,handleMousedown:b}}});function yo(e,n,d,r,c,u){const a=w("el-roving-focus-collection-item");return N(),z(a,{id:e.id,focusable:e.focusable,active:e.active},{default:m(()=>[P(e.$slots,"default")]),_:3},8,["id","focusable","active"])}var To=M(Co,[["render",yo],["__file","roving-focus-item.vue"]]);const $o=A({name:"DropdownItemImpl",components:{ElIcon:fe},props:we,emits:["pointermove","pointerleave","click","clickimpl"],setup(e,{emit:n}){const d=ee("dropdown"),{role:r}=C(X,void 0),{collectionItemRef:c}=C(Xe,void 0),{collectionItemRef:u}=C(so,void 0),{rovingFocusGroupItemRef:a,tabIndex:l,handleFocus:p,handleKeydown:b,handleMousedown:g}=C(_e,void 0),_=be(c,u,a),E=y(()=>r.value==="menu"?"menuitem":r.value==="navigation"?"link":"button"),o=k(s=>{if([H.enter,H.numpadEnter,H.space].includes(s.code))return s.preventDefault(),s.stopImmediatePropagation(),n("clickimpl",s),!0},b);return{ns:d,itemRef:_,dataset:{[qe]:""},role:E,tabIndex:l,handleFocus:p,handleKeydown:o,handleMousedown:g}}});function Fo(e,n,d,r,c,u){const a=w("el-icon");return N(),W(ze,null,[e.divided?(N(),W("li",{key:0,role:"separator",class:q(e.ns.bem("menu","item","divided"))},null,2)):Z("v-if",!0),Ae("li",j({ref:e.itemRef},{...e.dataset,...e.$attrs},{"aria-disabled":e.disabled,class:[e.ns.be("menu","item"),e.ns.is("disabled",e.disabled)],tabindex:e.tabIndex,role:e.role,onClick:l=>e.$emit("clickimpl",l),onFocus:e.handleFocus,onKeydown:x(e.handleKeydown,["self"]),onMousedown:e.handleMousedown,onPointermove:l=>e.$emit("pointermove",l),onPointerleave:l=>e.$emit("pointerleave",l)}),[e.icon?(N(),z(a,{key:0},{default:m(()=>[(N(),z(Ge(e.icon)))]),_:1})):Z("v-if",!0),P(e.$slots,"default")],16,["aria-disabled","tabindex","role","onClick","onFocus","onKeydown","onMousedown","onPointermove","onPointerleave"])],64)}var Ro=M($o,[["render",Fo],["__file","dropdown-item-impl.vue"]]);const Ee=()=>{const e=C(Ie,{}),n=y(()=>e?.dropdownSize);return{elDropdown:e,_elDropdownSize:n}},So=A({name:"ElDropdownItem",components:{ElDropdownCollectionItem:Qe,ElRovingFocusItem:To,ElDropdownItemImpl:Ro},inheritAttrs:!1,props:we,emits:["pointermove","pointerleave","click"],setup(e,{emit:n,attrs:d}){const{elDropdown:r}=Ee(),c=me(),u=T(null),a=y(()=>{var o,s;return(s=(o=O(u))==null?void 0:o.textContent)!=null?s:""}),{onItemEnter:l,onItemLeave:p}=C(X,void 0),b=k(o=>(n("pointermove",o),o.defaultPrevented),ie(o=>{if(e.disabled){p(o);return}const s=o.currentTarget;s===document.activeElement||s.contains(document.activeElement)||(l(o),o.defaultPrevented||s?.focus())})),g=k(o=>(n("pointerleave",o),o.defaultPrevented),ie(p)),_=k(o=>{if(!e.disabled)return n("click",o),o.type!=="keydown"&&o.defaultPrevented},o=>{var s,i,f;if(e.disabled){o.stopImmediatePropagation();return}(s=r?.hideOnClick)!=null&&s.value&&((i=r.handleClick)==null||i.call(r)),(f=r.commandHandler)==null||f.call(r,e.command,c,o)}),E=y(()=>({...e,...d}));return{handleClick:_,handlePointerMove:b,handlePointerLeave:g,textContent:a,propsAndAttrs:E}}});function Oo(e,n,d,r,c,u){var a;const l=w("el-dropdown-item-impl"),p=w("el-roving-focus-item"),b=w("el-dropdown-collection-item");return N(),z(b,{disabled:e.disabled,"text-value":(a=e.textValue)!=null?a:e.textContent},{default:m(()=>[R(p,{focusable:!e.disabled},{default:m(()=>[R(l,j(e.propsAndAttrs,{onPointerleave:e.handlePointerLeave,onPointermove:e.handlePointerMove,onClickimpl:e.handleClick}),{default:m(()=>[P(e.$slots,"default")]),_:3},16,["onPointerleave","onPointermove","onClickimpl"])]),_:3},8,["focusable"])]),_:3},8,["disabled","text-value"])}var he=M(So,[["render",Oo],["__file","dropdown-item.vue"]]);const ko=A({name:"ElDropdownMenu",props:Ze,setup(e){const n=ee("dropdown"),{_elDropdownSize:d}=Ee(),r=d.value,{focusTrapRef:c,onKeydown:u}=C(Ye,void 0),{contentRef:a,role:l,triggerId:p}=C(X,void 0),{collectionRef:b,getItems:g}=C(xe,void 0),{rovingFocusGroupRef:_,rovingFocusGroupRootStyle:E,tabIndex:o,onBlur:s,onFocus:i,onMousedown:f}=C(ne,void 0),{collectionRef:D}=C(oe,void 0),$=y(()=>[n.b("menu"),n.bm("menu",r?.value)]),B=be(a,b,c,_,D),v=k(I=>{var K;(K=e.onKeydown)==null||K.call(e,I)},I=>{const{currentTarget:K,code:L,target:F}=I;if(K.contains(F),H.tab===L&&I.stopImmediatePropagation(),I.preventDefault(),F!==O(a)||!eo.includes(L))return;const V=g().filter(U=>!U.disabled).map(U=>U.ref);oo.includes(L)&&V.reverse(),te(V)});return{size:r,rovingFocusGroupRootStyle:E,tabIndex:o,dropdownKls:$,role:l,triggerId:p,dropdownListWrapperRef:B,handleKeydown:I=>{v(I),u(I)},onBlur:s,onFocus:i,onMousedown:f}}});function No(e,n,d,r,c,u){return N(),W("ul",{ref:e.dropdownListWrapperRef,class:q(e.dropdownKls),style:Ue(e.rovingFocusGroupRootStyle),tabindex:-1,role:e.role,"aria-labelledby":e.triggerId,onBlur:e.onBlur,onFocus:e.onFocus,onKeydown:x(e.handleKeydown,["self"]),onMousedown:x(e.onMousedown,["self"])},[P(e.$slots,"default")],46,["role","aria-labelledby","onBlur","onFocus","onKeydown","onMousedown"])}var Ce=M(ko,[["render",No],["__file","dropdown-menu.vue"]]);const Uo=He(ho,{DropdownItem:he,DropdownMenu:Ce}),Yo=ge(he),Ho=ge(Ce);export{Yo as E,Ho as a,Uo as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aL as tt,au as E,c as u,as as al,aw as ge,bN as nt,aB as P,d9 as at,d6 as Y,aF as j,aT as ye,_ as Se,d as re,J as ae,K as ke,b as I,o as g,r as k,t as V,x as W,aq as N,n as v,a as se,b3 as ol,e as Ee,cj as Re,bP as ie,ax as sl,bl as H,y as $,f as he,aE as De,ba as ot,db as st,aW as F,ct as it,bx as rt,bO as be,bG as Xe,bS as ut,aU as ne,bW as Ye,dc as dt,cq as X,aR as ct,cB as pt,cp as il,aK as ft,at as vt,bq as mt,dd as bt,ay as le,de as Ze,A as ht,bR as _e,cw as gt,b$ as yt,l as G,cW as St,k as q,j as L,i as A,F as xe,v as el,D as ll,ch as te,df as Ct,bh as Ve,dg as Ot,E as wt,cg as It,av as rl,bT as Et,cI as Vt,w as ul,g as Tt}from"./index-CLwJbfYs.js";import{u as tl,b as kt,E as Rt}from"./index-DITqxnfk.js";import{s as Dt,E as $t}from"./index-DNzgGVij.js";import{e as Mt}from"./strings-WMZYwrQD.js";import{c as U}from"./castArray-CoJ3z4SB.js";import{i as oe}from"./isEqual-DQdO_K1-.js";import{b as Q,d as Lt}from"./typescript-CoKqfRJS.js";import{u as Bt,a as Nt}from"./use-form-item-CRDWzFx1.js";import{u as Wt,a as Pt}from"./index-DHn59BRx.js";import{d as Ft}from"./debounce-CEE_CsrA.js";import{b as zt}from"./_baseIteratee-Bk7QROEW.js";import{u as Kt}from"./index-AT7DtKgl.js";import{C as At}from"./index-Dc0-osYE.js";function Ht(e,o,a,m){e.length;for(var c=a+1;c--;)if(o(e[c],c,e))return c;return-1}function Ut(e,o,a){var m=e==null?0:e.length;if(!m)return-1;var c=m-1;return Ht(e,zt(o),c)}function jt(){const e=tt(),o=E(0),a=11,m=u(()=>({minWidth:`${Math.max(o.value,a)}px`}));return Q(e,()=>{var S,t;o.value=(t=(S=e.value)==null?void 0:S.getBoundingClientRect().width)!=null?t:0}),{calculatorRef:e,calculatorWidth:o,inputStyle:m}}const dl=Symbol("ElSelectGroup"),Ce=Symbol("ElSelect"),Te="ElOption",Gt=al({value:{type:[String,Number,Boolean,Object],required:!0},label:{type:[String,Number]},created:Boolean,disabled:Boolean});function qt(e,o){const a=ge(Ce);a||nt(Te,"usage: <el-select><el-option /></el-select/>");const m=ge(dl,{disabled:!1}),c=u(()=>f(U(a.props.modelValue),e.value)),S=u(()=>{var s;if(a.props.multiple){const p=U((s=a.props.modelValue)!=null?s:[]);return!c.value&&p.length>=a.props.multipleLimit&&a.props.multipleLimit>0}else return!1}),t=u(()=>{var s;return(s=e.label)!=null?s:P(e.value)?"":e.value}),C=u(()=>e.value||e.label||""),h=u(()=>e.disabled||o.groupDisabled||S.value),b=ye(),f=(s=[],p)=>{if(P(e.value)){const w=a.props.valueKey;return s&&s.some(T=>at(Y(T,w))===Y(p,w))}else return s&&s.includes(p)},d=()=>{!e.disabled&&!m.disabled&&(a.states.hoveringIndex=a.optionsArray.indexOf(b.proxy))},i=s=>{const p=new RegExp(Mt(s),"i");o.visible=p.test(String(t.value))||e.created};return j(()=>t.value,()=>{!e.created&&!a.props.remote&&a.setSelected()}),j(()=>e.value,(s,p)=>{const{remote:w,valueKey:T}=a.props;if((w?s!==p:!oe(s,p))&&(a.onOptionDestroy(p,b.proxy),a.onOptionCreate(b.proxy)),!e.created&&!w){if(T&&P(s)&&P(p)&&s[T]===p[T])return;a.setSelected()}}),j(()=>m.disabled,()=>{o.groupDisabled=m.disabled},{immediate:!0}),{select:a,currentLabel:t,currentValue:C,itemSelected:c,isDisabled:h,hoverItem:d,updateOption:i}}const Qt=re({name:Te,componentName:Te,props:Gt,setup(e){const o=se("select"),a=ol(),m=u(()=>[o.be("dropdown","item"),o.is("disabled",Ee(C)),o.is("selected",Ee(t)),o.is("hovering",Ee(i))]),c=ie({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:S,itemSelected:t,isDisabled:C,select:h,hoverItem:b,updateOption:f}=qt(e,c),{visible:d,hover:i}=Re(c),s=ye().proxy;h.onOptionCreate(s),sl(()=>{const w=s.value,{selected:T}=h.states,R=T.some(y=>y.value===s.value);H(()=>{h.states.cachedOptions.get(w)===s&&!R&&h.states.cachedOptions.delete(w)}),h.onOptionDestroy(w,s)});function p(){C.value||h.handleOptionSelect(s)}return{ns:o,id:a,containerKls:m,currentLabel:S,itemSelected:t,isDisabled:C,select:h,visible:d,hover:i,states:c,hoverItem:b,updateOption:f,selectOptionClick:p}}});function Jt(e,o){return ae((g(),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"])},[k(e.$slots,"default",{},()=>[V("span",null,W(e.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMousemove","onClick"])),[[ke,e.visible]])}var $e=Se(Qt,[["render",Jt],["__file","option.vue"]]);const Xt=re({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const e=ge(Ce),o=se("select"),a=u(()=>e.props.popperClass),m=u(()=>e.props.multiple),c=u(()=>e.props.fitInputWidth),S=E("");function t(){var C;S.value=`${(C=e.selectRef)==null?void 0:C.offsetWidth}px`}return De(()=>{t(),Q(e.selectRef,t)}),{ns:o,minWidth:S,popperClass:a,isMultiple:m,isFitInputWidth:c}}});function Yt(e,o,a,m,c,S){return g(),I("div",{class:v([e.ns.b("dropdown"),e.ns.is("multiple",e.isMultiple),e.popperClass]),style:he({[e.isFitInputWidth?"width":"minWidth"]:e.minWidth})},[e.$slots.header?(g(),I("div",{key:0,class:v(e.ns.be("dropdown","header"))},[k(e.$slots,"header")],2)):$("v-if",!0),k(e.$slots,"default"),e.$slots.footer?(g(),I("div",{key:1,class:v(e.ns.be("dropdown","footer"))},[k(e.$slots,"footer")],2)):$("v-if",!0)],6)}var Zt=Se(Xt,[["render",Yt],["__file","select-dropdown.vue"]]);const _t=(e,o)=>{const{t:a}=ot(),m=ol(),c=se("select"),S=se("input"),t=ie({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=E(),h=E(),b=E(),f=E(),d=E(),i=E(),s=E(),p=E(),w=E(),T=E(),R=E(),y=E(!1),B=E(),{form:ue,formItem:z}=Bt(),{inputId:pl}=Nt(e,{formItemContext:z}),{valueOnClear:fl,isEmptyValue:vl}=st(e),{isComposing:Me,handleCompositionStart:ml,handleCompositionUpdate:bl,handleCompositionEnd:hl}=Wt({afterComposition:l=>He(l)}),Z=u(()=>e.disabled||!!ue?.disabled),{wrapperRef:Le,isFocused:Be,handleBlur:gl}=Pt(d,{disabled:Z,afterFocus(){e.automaticDropdown&&!y.value&&(y.value=!0,t.menuVisibleOnFocus=!0)},beforeBlur(l){var n,r;return((n=b.value)==null?void 0:n.isFocusInsideContent(l))||((r=f.value)==null?void 0:r.isFocusInsideContent(l))},afterBlur(){var l;y.value=!1,t.menuVisibleOnFocus=!1,e.validateEvent&&((l=z?.validate)==null||l.call(z,"blur").catch(n=>Ye()))}}),Oe=u(()=>F(e.modelValue)?e.modelValue.length>0:!vl(e.modelValue)),yl=u(()=>{var l;return(l=ue?.statusIcon)!=null?l:!1}),Sl=u(()=>e.clearable&&!Z.value&&t.inputHovering&&Oe.value),Ne=u(()=>e.remote&&e.filterable&&!e.remoteShowSuffix?"":e.suffixIcon),Cl=u(()=>c.is("reverse",!!(Ne.value&&y.value))),we=u(()=>z?.validateState||""),Ol=u(()=>we.value&&it[we.value]),wl=u(()=>e.remote?300:0),Il=u(()=>e.remote&&!t.inputValue&&t.options.size===0),El=u(()=>e.loading?e.loadingText||a("el.select.loading"):e.filterable&&t.inputValue&&t.options.size>0&&_.value===0?e.noMatchText||a("el.select.noMatch"):t.options.size===0?e.noDataText||a("el.select.noData"):null),_=u(()=>D.value.filter(l=>l.visible).length),D=u(()=>{const l=Array.from(t.options.values()),n=[];return t.optionValues.forEach(r=>{const O=l.findIndex(M=>M.value===r);O>-1&&n.push(l[O])}),n.length>=l.length?n:l}),Vl=u(()=>Array.from(t.cachedOptions.values())),Tl=u(()=>{const l=D.value.filter(n=>!n.created).some(n=>n.currentLabel===t.inputValue);return e.filterable&&e.allowCreate&&t.inputValue!==""&&!l}),We=()=>{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)})},Pe=rt(),kl=u(()=>["small"].includes(Pe.value)?"small":"default"),Rl=u({get(){return y.value&&!Il.value},set(l){y.value=l}}),Dl=u(()=>{if(e.multiple&&!be(e.modelValue))return U(e.modelValue).length===0&&!t.inputValue;const l=F(e.modelValue)?e.modelValue[0]:e.modelValue;return e.filterable||be(l)?!t.inputValue:!0}),$l=u(()=>{var l;const n=(l=e.placeholder)!=null?l:a("el.select.placeholder");return e.multiple||!Oe.value?n:t.selectedLabel}),Ml=u(()=>Xe?null:"mouseenter");j(()=>e.modelValue,(l,n)=>{e.multiple&&e.filterable&&!e.reserveKeyword&&(t.inputValue="",de("")),ce(),!oe(l,n)&&e.validateEvent&&z?.validate("change").catch(r=>Ye())},{flush:"post",deep:!0}),j(()=>y.value,l=>{l?de(t.inputValue):(t.inputValue="",t.previousQuery=null,t.isBeforeHide=!0),o("visible-change",l)}),j(()=>t.options.entries(),()=>{ft&&(ce(),e.defaultFirstOption&&(e.filterable||e.remote)&&_.value&&Fe())},{flush:"post"}),j([()=>t.hoveringIndex,D],([l])=>{vt(l)&&l>-1?B.value=D.value[l]||{}:B.value={},D.value.forEach(n=>{n.hover=B.value===n})}),ut(()=>{t.isBeforeHide||We()});const de=l=>{t.previousQuery===l||Me.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)&&_.value?H(Fe):H(Ll))},Fe=()=>{const l=D.value.filter(M=>M.visible&&!M.disabled&&!M.states.groupDisabled),n=l.find(M=>M.created),r=l[0],O=D.value.map(M=>M.value);t.hoveringIndex=qe(O,n||r)},ce=()=>{if(e.multiple)t.selectedLabel="";else{const n=F(e.modelValue)?e.modelValue[0]:e.modelValue,r=ze(n);t.selectedLabel=r.currentLabel,t.selected=[r];return}const l=[];be(e.modelValue)||U(e.modelValue).forEach(n=>{l.push(ze(n))}),t.selected=l},ze=l=>{let n;const r=pt(l);for(let J=t.cachedOptions.size-1;J>=0;J--){const K=Vl.value[J];if(r?Y(K.value,e.valueKey)===Y(l,e.valueKey):K.value===l){n={value:l,currentLabel:K.currentLabel,get isDisabled(){return K.isDisabled}};break}}if(n)return n;const O=r?l.label:l??"";return{value:l,currentLabel:O}},Ll=()=>{t.hoveringIndex=D.value.findIndex(l=>t.selected.some(n=>ve(n)===ve(l)))},Bl=()=>{t.selectionWidth=Number.parseFloat(window.getComputedStyle(h.value).width)},Nl=()=>{t.collapseItemWidth=T.value.getBoundingClientRect().width},Ie=()=>{var l,n;(n=(l=b.value)==null?void 0:l.updatePopper)==null||n.call(l)},Ke=()=>{var l,n;(n=(l=f.value)==null?void 0:l.updatePopper)==null||n.call(l)},Ae=()=>{t.inputValue.length>0&&!y.value&&(y.value=!0),de(t.inputValue)},He=l=>{if(t.inputValue=l.target.value,e.remote)Ue();else return Ae()},Ue=Ft(()=>{Ae()},wl.value),x=l=>{oe(e.modelValue,l)||o(il,l)},Wl=l=>Ut(l,n=>{const r=t.cachedOptions.get(n);return r&&!r.disabled&&!r.states.groupDisabled}),Pl=l=>{if(e.multiple&&l.code!==ct.delete&&l.target.value.length<=0){const n=U(e.modelValue).slice(),r=Wl(n);if(r<0)return;const O=n[r];n.splice(r,1),o(X,n),x(n),o("remove-tag",O)}},Fl=(l,n)=>{const r=t.selected.indexOf(n);if(r>-1&&!Z.value){const O=U(e.modelValue).slice();O.splice(r,1),o(X,O),x(O),o("remove-tag",n.value)}l.stopPropagation(),fe()},je=l=>{l.stopPropagation();const n=e.multiple?[]:fl.value;if(e.multiple)for(const r of t.selected)r.isDisabled&&n.push(r.value);o(X,n),x(n),t.hoveringIndex=-1,y.value=!1,o("clear"),fe()},Ge=l=>{var n;if(e.multiple){const r=U((n=e.modelValue)!=null?n:[]).slice(),O=qe(r,l);O>-1?r.splice(O,1):(e.multipleLimit<=0||r.length<e.multipleLimit)&&r.push(l.value),o(X,r),x(r),l.created&&de(""),e.filterable&&!e.reserveKeyword&&(t.inputValue="")}else o(X,l.value),x(l.value),y.value=!1;fe(),!y.value&&H(()=>{pe(l)})},qe=(l,n)=>be(n)?-1:P(n.value)?l.findIndex(r=>oe(Y(r,e.valueKey),ve(n))):l.indexOf(n.value),pe=l=>{var n,r,O,M,J;const K=F(l)?l[0]:l;let me=null;if(K?.value){const ee=D.value.filter(lt=>lt.value===K.value);ee.length>0&&(me=ee[0].$el)}if(b.value&&me){const ee=(M=(O=(r=(n=b.value)==null?void 0:n.popperRef)==null?void 0:r.contentRef)==null?void 0:O.querySelector)==null?void 0:M.call(O,`.${c.be("dropdown","wrap")}`);ee&&dt(ee,me)}(J=R.value)==null||J.handleScroll()},zl=l=>{t.options.set(l.value,l),t.cachedOptions.set(l.value,l)},Kl=(l,n)=>{t.options.get(l)===n&&t.options.delete(l)},Al=u(()=>{var l,n;return(n=(l=b.value)==null?void 0:l.popperRef)==null?void 0:n.contentRef}),Hl=()=>{t.isBeforeHide=!1,H(()=>{var l;(l=R.value)==null||l.update(),pe(t.selected)})},fe=()=>{var l;(l=d.value)==null||l.focus()},Ul=()=>{var l;if(y.value){y.value=!1,H(()=>{var n;return(n=d.value)==null?void 0:n.blur()});return}(l=d.value)==null||l.blur()},jl=l=>{je(l)},Gl=l=>{if(y.value=!1,Be.value){const n=new FocusEvent("focus",l);H(()=>gl(n))}},ql=()=>{t.inputValue.length>0?t.inputValue="":y.value=!1},Qe=()=>{Z.value||(Xe&&(t.inputHovering=!0),t.menuVisibleOnFocus?t.menuVisibleOnFocus=!1:y.value=!y.value)},Ql=()=>{if(!y.value)Qe();else{const l=D.value[t.hoveringIndex];l&&!l.isDisabled&&Ge(l)}},ve=l=>P(l.value)?Y(l.value,e.valueKey):l.value,Jl=u(()=>D.value.filter(l=>l.visible).every(l=>l.isDisabled)),Xl=u(()=>e.multiple?e.collapseTags?t.selected.slice(0,e.maxCollapseTags):t.selected:[]),Yl=u(()=>e.multiple?e.collapseTags?t.selected.slice(e.maxCollapseTags):[]:[]),Je=l=>{if(!y.value){y.value=!0;return}if(!(t.options.size===0||_.value===0||Me.value)&&!Jl.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)&&Je(l),H(()=>pe(B.value))}},Zl=()=>{if(!h.value)return 0;const l=window.getComputedStyle(h.value);return Number.parseFloat(l.gap||"6px")},_l=u(()=>{const l=Zl();return{maxWidth:`${T.value&&e.maxCollapseTags===1?t.selectionWidth-t.collapseItemWidth-l:t.selectionWidth}px`}}),xl=u(()=>({maxWidth:`${t.selectionWidth}px`})),et=l=>{o("popup-scroll",l)};return Q(h,Bl),Q(p,Ie),Q(Le,Ie),Q(w,Ke),Q(T,Nl),De(()=>{ce()}),{inputId:pl,contentId:m,nsSelect:c,nsInput:S,states:t,isFocused:Be,expanded:y,optionsArray:D,hoverOption:B,selectSize:Pe,filteredOptionsCount:_,updateTooltip:Ie,updateTagTooltip:Ke,debouncedOnInputChange:Ue,onInput:He,deletePrevTag:Pl,deleteTag:Fl,deleteSelected:je,handleOptionSelect:Ge,scrollToOption:pe,hasModelValue:Oe,shouldShowPlaceholder:Dl,currentPlaceholder:$l,mouseEnterEventName:Ml,needStatusIcon:yl,showClose:Sl,iconComponent:Ne,iconReverse:Cl,validateState:we,validateIcon:Ol,showNewOption:Tl,updateOptions:We,collapseTagSize:kl,setSelected:ce,selectDisabled:Z,emptyText:El,handleCompositionStart:ml,handleCompositionUpdate:bl,handleCompositionEnd:hl,onOptionCreate:zl,onOptionDestroy:Kl,handleMenuEnter:Hl,focus:fe,blur:Ul,handleClearClick:jl,handleClickOutside:Gl,handleEsc:ql,toggleMenu:Qe,selectOption:Ql,getValueKey:ve,navigateOptions:Je,dropdownMenuVisible:Rl,showTagList:Xl,collapseTagList:Yl,popupScroll:et,tagStyle:_l,collapseTagStyle:xl,popperRef:Al,inputRef:d,tooltipRef:b,tagTooltipRef:f,prefixRef:i,suffixRef:s,selectRef:C,wrapperRef:Le,selectionRef:h,scrollbarRef:R,menuRef:p,tagMenuRef:w,collapseItemRef:T}};var xt=re({name:"ElOptions",setup(e,{slots:o}){const a=ge(Ce);let m=[];return()=>{var c,S;const t=(c=o.default)==null?void 0:c.call(o),C=[];function h(b){F(b)&&b.forEach(f=>{var d,i,s,p;const w=(d=f?.type||{})==null?void 0:d.name;w==="ElOptionGroup"?h(!mt(f.children)&&!F(f.children)&&ne((i=f.children)==null?void 0:i.default)?(s=f.children)==null?void 0:s.default():f.children):w==="ElOption"?C.push((p=f.props)==null?void 0:p.value):F(f.children)&&h(f.children)})}return t.length&&h((S=t[0])==null?void 0:S.children),oe(C,m)||(m=C,a&&(a.states.optionValues=C)),t}}});const en=al({name:String,id:String,modelValue:{type:le([Array,String,Number,Boolean,Object]),default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:yt,effect:{type:le(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:le(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod: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:tl.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:_e,default:gt},fitInputWidth:Boolean,suffixIcon:{type:_e,default:ht},tagType:{...Ze.type,default:"info"},tagEffect:{...Ze.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,showArrow:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:le(String),values:kt,default:"bottom-start"},fallbackPlacements:{type:le(Array),default:["bottom-start","top-start","right","left"]},tabindex:{type:[String,Number],default:0},appendTo:tl.appendTo,...bt,...Kt(["ariaLabel"])});Dt.scroll;const nl="ElSelect",ln=re({name:nl,componentName:nl,components:{ElSelectMenu:Zt,ElOption:$e,ElOptions:xt,ElTag:It,ElScrollbar:$t,ElTooltip:Rt,ElIcon:wt},directives:{ClickOutside:At},props:en,emits:[X,il,"remove-tag","clear","visible-change","focus","blur","popup-scroll"],setup(e,{emit:o,slots:a}){const m=ye();m.appContext.config.warnHandler=(...i)=>{!i[0]||i[0].includes('Slot "default" invoked outside of the render function')||console.warn(...i)};const c=u(()=>{const{modelValue:i,multiple:s}=e,p=s?[]:void 0;return F(i)?s?i:p:s?p:i}),S=ie({...Re(e),modelValue:c}),t=_t(S,o),{calculatorRef:C,inputStyle:h}=jt(),b=i=>i.reduce((s,p)=>(s.push(p),p.children&&p.children.length>0&&s.push(...b(p.children)),s),[]),f=i=>{Et(i||[]).forEach(p=>{var w;if(P(p)&&(p.type.name==="ElOption"||p.type.name==="ElTree")){const T=p.type.name;if(T==="ElTree"){const R=((w=p.props)==null?void 0:w.data)||[];b(R).forEach(B=>{B.currentLabel=B.label||(P(B.value)?"":B.value),t.onOptionCreate(B)})}else if(T==="ElOption"){const R={...p.props};R.currentLabel=R.label||(P(R.value)?"":R.value),t.onOptionCreate(R)}}})};j(()=>{var i;return(i=a.default)==null?void 0:i.call(a)},i=>{e.persistent||f(i)},{immediate:!0}),rl(Ce,ie({props:S,states:t.states,selectRef:t.selectRef,optionsArray:t.optionsArray,setSelected:t.setSelected,handleOptionSelect:t.handleOptionSelect,onOptionCreate:t.onOptionCreate,onOptionDestroy:t.onOptionDestroy}));const d=u(()=>e.multiple?t.states.selected.map(i=>i.currentLabel):t.states.selectedLabel);return sl(()=>{m.appContext.config.warnHandler=void 0}),{...t,modelValue:c,selectedLabel:d,calculatorRef:C,inputStyle:h}}});function tn(e,o){const a=G("el-tag"),m=G("el-tooltip"),c=G("el-icon"),S=G("el-option"),t=G("el-options"),C=G("el-scrollbar"),h=G("el-select-menu"),b=St("click-outside");return ae((g(),I("div",{ref:"selectRef",class:v([e.nsSelect.b(),e.nsSelect.m(e.selectSize)]),[Ot(e.mouseEnterEventName)]:f=>e.states.inputHovering=!0,onMouseleave:f=>e.states.inputHovering=!1},[q(m,{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[V("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?(g(),I("div",{key:0,ref:"prefixRef",class:v(e.nsSelect.e("prefix"))},[k(e.$slots,"prefix")],2)):$("v-if",!0),V("div",{ref:"selectionRef",class:v([e.nsSelect.e("selection"),e.nsSelect.is("near",e.multiple&&!e.$slots.prefix&&!!e.states.selected.length)])},[e.multiple?k(e.$slots,"tag",{key:0,data:e.states.selected,deleteTag:e.deleteTag,selectDisabled:e.selectDisabled},()=>[(g(!0),I(xe,null,el(e.showTagList,d=>(g(),I("div",{key:e.getValueKey(d),class:v(e.nsSelect.e("selected-item"))},[q(a,{closable:!e.selectDisabled&&!d.isDisabled,size:e.collapseTagSize,type:e.tagType,effect:e.tagEffect,"disable-transitions":"",style:he(e.tagStyle),onClose:i=>e.deleteTag(i,d)},{default:L(()=>[V("span",{class:v(e.nsSelect.e("tags-text"))},[k(e.$slots,"label",{label:d.currentLabel,value:d.value},()=>[ll(W(d.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),e.collapseTags&&e.states.selected.length>e.maxCollapseTags?(g(),A(m,{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(()=>[V("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:he(e.collapseTagStyle)},{default:L(()=>[V("span",{class:v(e.nsSelect.e("tags-text"))}," + "+W(e.states.selected.length-e.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:L(()=>[V("div",{ref:"tagMenuRef",class:v(e.nsSelect.e("selection"))},[(g(!0),I(xe,null,el(e.collapseTagList,d=>(g(),I("div",{key:e.getValueKey(d),class:v(e.nsSelect.e("selected-item"))},[q(a,{class:"in-tooltip",closable:!e.selectDisabled&&!d.isDisabled,size:e.collapseTagSize,type:e.tagType,effect:e.tagEffect,"disable-transitions":"",onClose:i=>e.deleteTag(i,d)},{default:L(()=>[V("span",{class:v(e.nsSelect.e("tags-text"))},[k(e.$slots,"label",{label:d.currentLabel,value:d.value},()=>[ll(W(d.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),V("div",{class:v([e.nsSelect.e("selected-item"),e.nsSelect.e("input-wrapper"),e.nsSelect.is("hidden",!e.filterable)])},[ae(V("input",{id:e.inputId,ref:"inputRef","onUpdate:modelValue":d=>e.states.inputValue=d,type:"text",name:e.name,class:v([e.nsSelect.e("input"),e.nsSelect.is(e.selectSize)]),disabled:e.selectDisabled,autocomplete:e.autocomplete,style:he(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(d=>e.navigateOptions("next"),["stop","prevent"]),["down"]),te(N(d=>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"]),[[Ct,e.states.inputValue]]),e.filterable?(g(),I("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:v(e.nsSelect.e("input-calculator")),textContent:W(e.states.inputValue)},null,10,["textContent"])):$("v-if",!0)],2),e.shouldShowPlaceholder?(g(),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?k(e.$slots,"label",{key:0,label:e.currentPlaceholder,value:e.modelValue},()=>[V("span",null,W(e.currentPlaceholder),1)]):(g(),I("span",{key:1},W(e.currentPlaceholder),1))],2)):$("v-if",!0)],2),V("div",{ref:"suffixRef",class:v(e.nsSelect.e("suffix"))},[e.iconComponent&&!e.showClose?(g(),A(c,{key:0,class:v([e.nsSelect.e("caret"),e.nsSelect.e("icon"),e.iconReverse])},{default:L(()=>[(g(),A(Ve(e.iconComponent)))]),_:1},8,["class"])):$("v-if",!0),e.showClose&&e.clearIcon?(g(),A(c,{key:1,class:v([e.nsSelect.e("caret"),e.nsSelect.e("icon"),e.nsSelect.e("clear")]),onClick:e.handleClearClick},{default:L(()=>[(g(),A(Ve(e.clearIcon)))]),_:1},8,["class","onClick"])):$("v-if",!0),e.validateState&&e.validateIcon&&e.needStatusIcon?(g(),A(c,{key:2,class:v([e.nsInput.e("icon"),e.nsInput.e("validateIcon"),e.nsInput.is("loading",e.validateState==="validating")])},{default:L(()=>[(g(),A(Ve(e.validateIcon)))]),_:1},8,["class"])):$("v-if",!0)],2)],10,["onClick"])]}),content:L(()=>[q(h,{ref:"menuRef"},{default:L(()=>[e.$slots.header?(g(),I("div",{key:0,class:v(e.nsSelect.be("dropdown","header")),onClick:N(()=>{},["stop"])},[k(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?(g(),A(S,{key:0,value:e.states.inputValue,created:!0},null,8,["value"])):$("v-if",!0),q(t,null,{default:L(()=>[k(e.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label","onScroll"]),[[ke,e.states.options.size>0&&!e.loading]]),e.$slots.loading&&e.loading?(g(),I("div",{key:1,class:v(e.nsSelect.be("dropdown","loading"))},[k(e.$slots,"loading")],2)):e.loading||e.filteredOptionsCount===0?(g(),I("div",{key:2,class:v(e.nsSelect.be("dropdown","empty"))},[k(e.$slots,"empty",{},()=>[V("span",null,W(e.emptyText),1)])],2)):$("v-if",!0),e.$slots.footer?(g(),I("div",{key:3,class:v(e.nsSelect.be("dropdown","footer")),onClick:N(()=>{},["stop"])},[k(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"])),[[b,e.handleClickOutside,e.popperRef]])}var nn=Se(ln,[["render",tn],["__file","select.vue"]]);const an=re({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(e){const o=se("select"),a=E(),m=ye(),c=E([]);rl(dl,ie({...Re(e)}));const S=u(()=>c.value.some(b=>b.visible===!0)),t=b=>{var f;return b.type.name==="ElOption"&&!!((f=b.component)!=null&&f.proxy)},C=b=>{const f=U(b),d=[];return f.forEach(i=>{var s;Vt(i)&&(t(i)?d.push(i.component.proxy):F(i.children)&&i.children.length?d.push(...C(i.children)):(s=i.component)!=null&&s.subTree&&d.push(...C(i.component.subTree)))}),d},h=()=>{c.value=C(m.subTree)};return De(()=>{h()}),Lt(a,h,{attributes:!0,subtree:!0,childList:!0}),{groupRef:a,visible:S,ns:o}}});function on(e,o,a,m,c,S){return ae((g(),I("ul",{ref:"groupRef",class:v(e.ns.be("group","wrap"))},[V("li",{class:v(e.ns.be("group","title"))},W(e.label),3),V("li",null,[V("ul",{class:v(e.ns.b("group"))},[k(e.$slots,"default")],2)])],2)),[[ke,e.visible]])}var cl=Se(an,[["render",on],["__file","option-group.vue"]]);const Sn=Tt(nn,{Option:$e,OptionGroup:cl}),Cn=ul($e);ul(cl);export{Cn as E,Sn as a};
|
|
1
|
+
import{aL as tt,au as E,c as u,as as al,aw as ge,bN as nt,aB as P,d9 as at,d6 as Y,aF as j,aT as ye,_ as Se,d as re,J as ae,K as ke,b as I,o as g,r as k,t as V,x as W,aq as N,n as v,a as se,b3 as ol,e as Ee,cj as Re,bP as ie,ax as sl,bl as H,y as $,f as he,aE as De,ba as ot,db as st,aW as F,ct as it,bx as rt,bO as be,bG as Xe,bS as ut,aU as ne,bW as Ye,dc as dt,cq as X,aR as ct,cB as pt,cp as il,aK as ft,at as vt,bq as mt,dd as bt,ay as le,de as Ze,A as ht,bR as _e,cw as gt,b$ as yt,l as G,cW as St,k as q,j as L,i as A,F as xe,v as el,D as ll,ch as te,df as Ct,bh as Ve,dg as Ot,E as wt,cg as It,av as rl,bT as Et,cI as Vt,w as ul,g as Tt}from"./index-BjMVMy9y.js";import{u as tl,b as kt,E as Rt}from"./index-DulF_7UO.js";import{s as Dt,E as $t}from"./index-B-7UQmSa.js";import{e as Mt}from"./strings-C0ATdFxF.js";import{c as U}from"./castArray-7tYrhn6A.js";import{i as oe}from"./isEqual-Df5ippj8.js";import{b as Q,d as Lt}from"./typescript-DXZhO2KE.js";import{u as Bt,a as Nt}from"./use-form-item-CZJno9cW.js";import{u as Wt,a as Pt}from"./index-OiDdq1JS.js";import{d as Ft}from"./debounce-09KXX3DN.js";import{b as zt}from"./_baseIteratee-7W3vde5j.js";import{u as Kt}from"./index-BzF_Ko5s.js";import{C as At}from"./index-D19A578F.js";function Ht(e,o,a,m){e.length;for(var c=a+1;c--;)if(o(e[c],c,e))return c;return-1}function Ut(e,o,a){var m=e==null?0:e.length;if(!m)return-1;var c=m-1;return Ht(e,zt(o),c)}function jt(){const e=tt(),o=E(0),a=11,m=u(()=>({minWidth:`${Math.max(o.value,a)}px`}));return Q(e,()=>{var S,t;o.value=(t=(S=e.value)==null?void 0:S.getBoundingClientRect().width)!=null?t:0}),{calculatorRef:e,calculatorWidth:o,inputStyle:m}}const dl=Symbol("ElSelectGroup"),Ce=Symbol("ElSelect"),Te="ElOption",Gt=al({value:{type:[String,Number,Boolean,Object],required:!0},label:{type:[String,Number]},created:Boolean,disabled:Boolean});function qt(e,o){const a=ge(Ce);a||nt(Te,"usage: <el-select><el-option /></el-select/>");const m=ge(dl,{disabled:!1}),c=u(()=>f(U(a.props.modelValue),e.value)),S=u(()=>{var s;if(a.props.multiple){const p=U((s=a.props.modelValue)!=null?s:[]);return!c.value&&p.length>=a.props.multipleLimit&&a.props.multipleLimit>0}else return!1}),t=u(()=>{var s;return(s=e.label)!=null?s:P(e.value)?"":e.value}),C=u(()=>e.value||e.label||""),h=u(()=>e.disabled||o.groupDisabled||S.value),b=ye(),f=(s=[],p)=>{if(P(e.value)){const w=a.props.valueKey;return s&&s.some(T=>at(Y(T,w))===Y(p,w))}else return s&&s.includes(p)},d=()=>{!e.disabled&&!m.disabled&&(a.states.hoveringIndex=a.optionsArray.indexOf(b.proxy))},i=s=>{const p=new RegExp(Mt(s),"i");o.visible=p.test(String(t.value))||e.created};return j(()=>t.value,()=>{!e.created&&!a.props.remote&&a.setSelected()}),j(()=>e.value,(s,p)=>{const{remote:w,valueKey:T}=a.props;if((w?s!==p:!oe(s,p))&&(a.onOptionDestroy(p,b.proxy),a.onOptionCreate(b.proxy)),!e.created&&!w){if(T&&P(s)&&P(p)&&s[T]===p[T])return;a.setSelected()}}),j(()=>m.disabled,()=>{o.groupDisabled=m.disabled},{immediate:!0}),{select:a,currentLabel:t,currentValue:C,itemSelected:c,isDisabled:h,hoverItem:d,updateOption:i}}const Qt=re({name:Te,componentName:Te,props:Gt,setup(e){const o=se("select"),a=ol(),m=u(()=>[o.be("dropdown","item"),o.is("disabled",Ee(C)),o.is("selected",Ee(t)),o.is("hovering",Ee(i))]),c=ie({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:S,itemSelected:t,isDisabled:C,select:h,hoverItem:b,updateOption:f}=qt(e,c),{visible:d,hover:i}=Re(c),s=ye().proxy;h.onOptionCreate(s),sl(()=>{const w=s.value,{selected:T}=h.states,R=T.some(y=>y.value===s.value);H(()=>{h.states.cachedOptions.get(w)===s&&!R&&h.states.cachedOptions.delete(w)}),h.onOptionDestroy(w,s)});function p(){C.value||h.handleOptionSelect(s)}return{ns:o,id:a,containerKls:m,currentLabel:S,itemSelected:t,isDisabled:C,select:h,visible:d,hover:i,states:c,hoverItem:b,updateOption:f,selectOptionClick:p}}});function Jt(e,o){return ae((g(),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"])},[k(e.$slots,"default",{},()=>[V("span",null,W(e.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMousemove","onClick"])),[[ke,e.visible]])}var $e=Se(Qt,[["render",Jt],["__file","option.vue"]]);const Xt=re({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const e=ge(Ce),o=se("select"),a=u(()=>e.props.popperClass),m=u(()=>e.props.multiple),c=u(()=>e.props.fitInputWidth),S=E("");function t(){var C;S.value=`${(C=e.selectRef)==null?void 0:C.offsetWidth}px`}return De(()=>{t(),Q(e.selectRef,t)}),{ns:o,minWidth:S,popperClass:a,isMultiple:m,isFitInputWidth:c}}});function Yt(e,o,a,m,c,S){return g(),I("div",{class:v([e.ns.b("dropdown"),e.ns.is("multiple",e.isMultiple),e.popperClass]),style:he({[e.isFitInputWidth?"width":"minWidth"]:e.minWidth})},[e.$slots.header?(g(),I("div",{key:0,class:v(e.ns.be("dropdown","header"))},[k(e.$slots,"header")],2)):$("v-if",!0),k(e.$slots,"default"),e.$slots.footer?(g(),I("div",{key:1,class:v(e.ns.be("dropdown","footer"))},[k(e.$slots,"footer")],2)):$("v-if",!0)],6)}var Zt=Se(Xt,[["render",Yt],["__file","select-dropdown.vue"]]);const _t=(e,o)=>{const{t:a}=ot(),m=ol(),c=se("select"),S=se("input"),t=ie({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=E(),h=E(),b=E(),f=E(),d=E(),i=E(),s=E(),p=E(),w=E(),T=E(),R=E(),y=E(!1),B=E(),{form:ue,formItem:z}=Bt(),{inputId:pl}=Nt(e,{formItemContext:z}),{valueOnClear:fl,isEmptyValue:vl}=st(e),{isComposing:Me,handleCompositionStart:ml,handleCompositionUpdate:bl,handleCompositionEnd:hl}=Wt({afterComposition:l=>He(l)}),Z=u(()=>e.disabled||!!ue?.disabled),{wrapperRef:Le,isFocused:Be,handleBlur:gl}=Pt(d,{disabled:Z,afterFocus(){e.automaticDropdown&&!y.value&&(y.value=!0,t.menuVisibleOnFocus=!0)},beforeBlur(l){var n,r;return((n=b.value)==null?void 0:n.isFocusInsideContent(l))||((r=f.value)==null?void 0:r.isFocusInsideContent(l))},afterBlur(){var l;y.value=!1,t.menuVisibleOnFocus=!1,e.validateEvent&&((l=z?.validate)==null||l.call(z,"blur").catch(n=>Ye()))}}),Oe=u(()=>F(e.modelValue)?e.modelValue.length>0:!vl(e.modelValue)),yl=u(()=>{var l;return(l=ue?.statusIcon)!=null?l:!1}),Sl=u(()=>e.clearable&&!Z.value&&t.inputHovering&&Oe.value),Ne=u(()=>e.remote&&e.filterable&&!e.remoteShowSuffix?"":e.suffixIcon),Cl=u(()=>c.is("reverse",!!(Ne.value&&y.value))),we=u(()=>z?.validateState||""),Ol=u(()=>we.value&&it[we.value]),wl=u(()=>e.remote?300:0),Il=u(()=>e.remote&&!t.inputValue&&t.options.size===0),El=u(()=>e.loading?e.loadingText||a("el.select.loading"):e.filterable&&t.inputValue&&t.options.size>0&&_.value===0?e.noMatchText||a("el.select.noMatch"):t.options.size===0?e.noDataText||a("el.select.noData"):null),_=u(()=>D.value.filter(l=>l.visible).length),D=u(()=>{const l=Array.from(t.options.values()),n=[];return t.optionValues.forEach(r=>{const O=l.findIndex(M=>M.value===r);O>-1&&n.push(l[O])}),n.length>=l.length?n:l}),Vl=u(()=>Array.from(t.cachedOptions.values())),Tl=u(()=>{const l=D.value.filter(n=>!n.created).some(n=>n.currentLabel===t.inputValue);return e.filterable&&e.allowCreate&&t.inputValue!==""&&!l}),We=()=>{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)})},Pe=rt(),kl=u(()=>["small"].includes(Pe.value)?"small":"default"),Rl=u({get(){return y.value&&!Il.value},set(l){y.value=l}}),Dl=u(()=>{if(e.multiple&&!be(e.modelValue))return U(e.modelValue).length===0&&!t.inputValue;const l=F(e.modelValue)?e.modelValue[0]:e.modelValue;return e.filterable||be(l)?!t.inputValue:!0}),$l=u(()=>{var l;const n=(l=e.placeholder)!=null?l:a("el.select.placeholder");return e.multiple||!Oe.value?n:t.selectedLabel}),Ml=u(()=>Xe?null:"mouseenter");j(()=>e.modelValue,(l,n)=>{e.multiple&&e.filterable&&!e.reserveKeyword&&(t.inputValue="",de("")),ce(),!oe(l,n)&&e.validateEvent&&z?.validate("change").catch(r=>Ye())},{flush:"post",deep:!0}),j(()=>y.value,l=>{l?de(t.inputValue):(t.inputValue="",t.previousQuery=null,t.isBeforeHide=!0),o("visible-change",l)}),j(()=>t.options.entries(),()=>{ft&&(ce(),e.defaultFirstOption&&(e.filterable||e.remote)&&_.value&&Fe())},{flush:"post"}),j([()=>t.hoveringIndex,D],([l])=>{vt(l)&&l>-1?B.value=D.value[l]||{}:B.value={},D.value.forEach(n=>{n.hover=B.value===n})}),ut(()=>{t.isBeforeHide||We()});const de=l=>{t.previousQuery===l||Me.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)&&_.value?H(Fe):H(Ll))},Fe=()=>{const l=D.value.filter(M=>M.visible&&!M.disabled&&!M.states.groupDisabled),n=l.find(M=>M.created),r=l[0],O=D.value.map(M=>M.value);t.hoveringIndex=qe(O,n||r)},ce=()=>{if(e.multiple)t.selectedLabel="";else{const n=F(e.modelValue)?e.modelValue[0]:e.modelValue,r=ze(n);t.selectedLabel=r.currentLabel,t.selected=[r];return}const l=[];be(e.modelValue)||U(e.modelValue).forEach(n=>{l.push(ze(n))}),t.selected=l},ze=l=>{let n;const r=pt(l);for(let J=t.cachedOptions.size-1;J>=0;J--){const K=Vl.value[J];if(r?Y(K.value,e.valueKey)===Y(l,e.valueKey):K.value===l){n={value:l,currentLabel:K.currentLabel,get isDisabled(){return K.isDisabled}};break}}if(n)return n;const O=r?l.label:l??"";return{value:l,currentLabel:O}},Ll=()=>{t.hoveringIndex=D.value.findIndex(l=>t.selected.some(n=>ve(n)===ve(l)))},Bl=()=>{t.selectionWidth=Number.parseFloat(window.getComputedStyle(h.value).width)},Nl=()=>{t.collapseItemWidth=T.value.getBoundingClientRect().width},Ie=()=>{var l,n;(n=(l=b.value)==null?void 0:l.updatePopper)==null||n.call(l)},Ke=()=>{var l,n;(n=(l=f.value)==null?void 0:l.updatePopper)==null||n.call(l)},Ae=()=>{t.inputValue.length>0&&!y.value&&(y.value=!0),de(t.inputValue)},He=l=>{if(t.inputValue=l.target.value,e.remote)Ue();else return Ae()},Ue=Ft(()=>{Ae()},wl.value),x=l=>{oe(e.modelValue,l)||o(il,l)},Wl=l=>Ut(l,n=>{const r=t.cachedOptions.get(n);return r&&!r.disabled&&!r.states.groupDisabled}),Pl=l=>{if(e.multiple&&l.code!==ct.delete&&l.target.value.length<=0){const n=U(e.modelValue).slice(),r=Wl(n);if(r<0)return;const O=n[r];n.splice(r,1),o(X,n),x(n),o("remove-tag",O)}},Fl=(l,n)=>{const r=t.selected.indexOf(n);if(r>-1&&!Z.value){const O=U(e.modelValue).slice();O.splice(r,1),o(X,O),x(O),o("remove-tag",n.value)}l.stopPropagation(),fe()},je=l=>{l.stopPropagation();const n=e.multiple?[]:fl.value;if(e.multiple)for(const r of t.selected)r.isDisabled&&n.push(r.value);o(X,n),x(n),t.hoveringIndex=-1,y.value=!1,o("clear"),fe()},Ge=l=>{var n;if(e.multiple){const r=U((n=e.modelValue)!=null?n:[]).slice(),O=qe(r,l);O>-1?r.splice(O,1):(e.multipleLimit<=0||r.length<e.multipleLimit)&&r.push(l.value),o(X,r),x(r),l.created&&de(""),e.filterable&&!e.reserveKeyword&&(t.inputValue="")}else o(X,l.value),x(l.value),y.value=!1;fe(),!y.value&&H(()=>{pe(l)})},qe=(l,n)=>be(n)?-1:P(n.value)?l.findIndex(r=>oe(Y(r,e.valueKey),ve(n))):l.indexOf(n.value),pe=l=>{var n,r,O,M,J;const K=F(l)?l[0]:l;let me=null;if(K?.value){const ee=D.value.filter(lt=>lt.value===K.value);ee.length>0&&(me=ee[0].$el)}if(b.value&&me){const ee=(M=(O=(r=(n=b.value)==null?void 0:n.popperRef)==null?void 0:r.contentRef)==null?void 0:O.querySelector)==null?void 0:M.call(O,`.${c.be("dropdown","wrap")}`);ee&&dt(ee,me)}(J=R.value)==null||J.handleScroll()},zl=l=>{t.options.set(l.value,l),t.cachedOptions.set(l.value,l)},Kl=(l,n)=>{t.options.get(l)===n&&t.options.delete(l)},Al=u(()=>{var l,n;return(n=(l=b.value)==null?void 0:l.popperRef)==null?void 0:n.contentRef}),Hl=()=>{t.isBeforeHide=!1,H(()=>{var l;(l=R.value)==null||l.update(),pe(t.selected)})},fe=()=>{var l;(l=d.value)==null||l.focus()},Ul=()=>{var l;if(y.value){y.value=!1,H(()=>{var n;return(n=d.value)==null?void 0:n.blur()});return}(l=d.value)==null||l.blur()},jl=l=>{je(l)},Gl=l=>{if(y.value=!1,Be.value){const n=new FocusEvent("focus",l);H(()=>gl(n))}},ql=()=>{t.inputValue.length>0?t.inputValue="":y.value=!1},Qe=()=>{Z.value||(Xe&&(t.inputHovering=!0),t.menuVisibleOnFocus?t.menuVisibleOnFocus=!1:y.value=!y.value)},Ql=()=>{if(!y.value)Qe();else{const l=D.value[t.hoveringIndex];l&&!l.isDisabled&&Ge(l)}},ve=l=>P(l.value)?Y(l.value,e.valueKey):l.value,Jl=u(()=>D.value.filter(l=>l.visible).every(l=>l.isDisabled)),Xl=u(()=>e.multiple?e.collapseTags?t.selected.slice(0,e.maxCollapseTags):t.selected:[]),Yl=u(()=>e.multiple?e.collapseTags?t.selected.slice(e.maxCollapseTags):[]:[]),Je=l=>{if(!y.value){y.value=!0;return}if(!(t.options.size===0||_.value===0||Me.value)&&!Jl.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)&&Je(l),H(()=>pe(B.value))}},Zl=()=>{if(!h.value)return 0;const l=window.getComputedStyle(h.value);return Number.parseFloat(l.gap||"6px")},_l=u(()=>{const l=Zl();return{maxWidth:`${T.value&&e.maxCollapseTags===1?t.selectionWidth-t.collapseItemWidth-l:t.selectionWidth}px`}}),xl=u(()=>({maxWidth:`${t.selectionWidth}px`})),et=l=>{o("popup-scroll",l)};return Q(h,Bl),Q(p,Ie),Q(Le,Ie),Q(w,Ke),Q(T,Nl),De(()=>{ce()}),{inputId:pl,contentId:m,nsSelect:c,nsInput:S,states:t,isFocused:Be,expanded:y,optionsArray:D,hoverOption:B,selectSize:Pe,filteredOptionsCount:_,updateTooltip:Ie,updateTagTooltip:Ke,debouncedOnInputChange:Ue,onInput:He,deletePrevTag:Pl,deleteTag:Fl,deleteSelected:je,handleOptionSelect:Ge,scrollToOption:pe,hasModelValue:Oe,shouldShowPlaceholder:Dl,currentPlaceholder:$l,mouseEnterEventName:Ml,needStatusIcon:yl,showClose:Sl,iconComponent:Ne,iconReverse:Cl,validateState:we,validateIcon:Ol,showNewOption:Tl,updateOptions:We,collapseTagSize:kl,setSelected:ce,selectDisabled:Z,emptyText:El,handleCompositionStart:ml,handleCompositionUpdate:bl,handleCompositionEnd:hl,onOptionCreate:zl,onOptionDestroy:Kl,handleMenuEnter:Hl,focus:fe,blur:Ul,handleClearClick:jl,handleClickOutside:Gl,handleEsc:ql,toggleMenu:Qe,selectOption:Ql,getValueKey:ve,navigateOptions:Je,dropdownMenuVisible:Rl,showTagList:Xl,collapseTagList:Yl,popupScroll:et,tagStyle:_l,collapseTagStyle:xl,popperRef:Al,inputRef:d,tooltipRef:b,tagTooltipRef:f,prefixRef:i,suffixRef:s,selectRef:C,wrapperRef:Le,selectionRef:h,scrollbarRef:R,menuRef:p,tagMenuRef:w,collapseItemRef:T}};var xt=re({name:"ElOptions",setup(e,{slots:o}){const a=ge(Ce);let m=[];return()=>{var c,S;const t=(c=o.default)==null?void 0:c.call(o),C=[];function h(b){F(b)&&b.forEach(f=>{var d,i,s,p;const w=(d=f?.type||{})==null?void 0:d.name;w==="ElOptionGroup"?h(!mt(f.children)&&!F(f.children)&&ne((i=f.children)==null?void 0:i.default)?(s=f.children)==null?void 0:s.default():f.children):w==="ElOption"?C.push((p=f.props)==null?void 0:p.value):F(f.children)&&h(f.children)})}return t.length&&h((S=t[0])==null?void 0:S.children),oe(C,m)||(m=C,a&&(a.states.optionValues=C)),t}}});const en=al({name:String,id:String,modelValue:{type:le([Array,String,Number,Boolean,Object]),default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:yt,effect:{type:le(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:le(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod: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:tl.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:_e,default:gt},fitInputWidth:Boolean,suffixIcon:{type:_e,default:ht},tagType:{...Ze.type,default:"info"},tagEffect:{...Ze.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,showArrow:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:le(String),values:kt,default:"bottom-start"},fallbackPlacements:{type:le(Array),default:["bottom-start","top-start","right","left"]},tabindex:{type:[String,Number],default:0},appendTo:tl.appendTo,...bt,...Kt(["ariaLabel"])});Dt.scroll;const nl="ElSelect",ln=re({name:nl,componentName:nl,components:{ElSelectMenu:Zt,ElOption:$e,ElOptions:xt,ElTag:It,ElScrollbar:$t,ElTooltip:Rt,ElIcon:wt},directives:{ClickOutside:At},props:en,emits:[X,il,"remove-tag","clear","visible-change","focus","blur","popup-scroll"],setup(e,{emit:o,slots:a}){const m=ye();m.appContext.config.warnHandler=(...i)=>{!i[0]||i[0].includes('Slot "default" invoked outside of the render function')||console.warn(...i)};const c=u(()=>{const{modelValue:i,multiple:s}=e,p=s?[]:void 0;return F(i)?s?i:p:s?p:i}),S=ie({...Re(e),modelValue:c}),t=_t(S,o),{calculatorRef:C,inputStyle:h}=jt(),b=i=>i.reduce((s,p)=>(s.push(p),p.children&&p.children.length>0&&s.push(...b(p.children)),s),[]),f=i=>{Et(i||[]).forEach(p=>{var w;if(P(p)&&(p.type.name==="ElOption"||p.type.name==="ElTree")){const T=p.type.name;if(T==="ElTree"){const R=((w=p.props)==null?void 0:w.data)||[];b(R).forEach(B=>{B.currentLabel=B.label||(P(B.value)?"":B.value),t.onOptionCreate(B)})}else if(T==="ElOption"){const R={...p.props};R.currentLabel=R.label||(P(R.value)?"":R.value),t.onOptionCreate(R)}}})};j(()=>{var i;return(i=a.default)==null?void 0:i.call(a)},i=>{e.persistent||f(i)},{immediate:!0}),rl(Ce,ie({props:S,states:t.states,selectRef:t.selectRef,optionsArray:t.optionsArray,setSelected:t.setSelected,handleOptionSelect:t.handleOptionSelect,onOptionCreate:t.onOptionCreate,onOptionDestroy:t.onOptionDestroy}));const d=u(()=>e.multiple?t.states.selected.map(i=>i.currentLabel):t.states.selectedLabel);return sl(()=>{m.appContext.config.warnHandler=void 0}),{...t,modelValue:c,selectedLabel:d,calculatorRef:C,inputStyle:h}}});function tn(e,o){const a=G("el-tag"),m=G("el-tooltip"),c=G("el-icon"),S=G("el-option"),t=G("el-options"),C=G("el-scrollbar"),h=G("el-select-menu"),b=St("click-outside");return ae((g(),I("div",{ref:"selectRef",class:v([e.nsSelect.b(),e.nsSelect.m(e.selectSize)]),[Ot(e.mouseEnterEventName)]:f=>e.states.inputHovering=!0,onMouseleave:f=>e.states.inputHovering=!1},[q(m,{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[V("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?(g(),I("div",{key:0,ref:"prefixRef",class:v(e.nsSelect.e("prefix"))},[k(e.$slots,"prefix")],2)):$("v-if",!0),V("div",{ref:"selectionRef",class:v([e.nsSelect.e("selection"),e.nsSelect.is("near",e.multiple&&!e.$slots.prefix&&!!e.states.selected.length)])},[e.multiple?k(e.$slots,"tag",{key:0,data:e.states.selected,deleteTag:e.deleteTag,selectDisabled:e.selectDisabled},()=>[(g(!0),I(xe,null,el(e.showTagList,d=>(g(),I("div",{key:e.getValueKey(d),class:v(e.nsSelect.e("selected-item"))},[q(a,{closable:!e.selectDisabled&&!d.isDisabled,size:e.collapseTagSize,type:e.tagType,effect:e.tagEffect,"disable-transitions":"",style:he(e.tagStyle),onClose:i=>e.deleteTag(i,d)},{default:L(()=>[V("span",{class:v(e.nsSelect.e("tags-text"))},[k(e.$slots,"label",{label:d.currentLabel,value:d.value},()=>[ll(W(d.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),e.collapseTags&&e.states.selected.length>e.maxCollapseTags?(g(),A(m,{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(()=>[V("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:he(e.collapseTagStyle)},{default:L(()=>[V("span",{class:v(e.nsSelect.e("tags-text"))}," + "+W(e.states.selected.length-e.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:L(()=>[V("div",{ref:"tagMenuRef",class:v(e.nsSelect.e("selection"))},[(g(!0),I(xe,null,el(e.collapseTagList,d=>(g(),I("div",{key:e.getValueKey(d),class:v(e.nsSelect.e("selected-item"))},[q(a,{class:"in-tooltip",closable:!e.selectDisabled&&!d.isDisabled,size:e.collapseTagSize,type:e.tagType,effect:e.tagEffect,"disable-transitions":"",onClose:i=>e.deleteTag(i,d)},{default:L(()=>[V("span",{class:v(e.nsSelect.e("tags-text"))},[k(e.$slots,"label",{label:d.currentLabel,value:d.value},()=>[ll(W(d.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),V("div",{class:v([e.nsSelect.e("selected-item"),e.nsSelect.e("input-wrapper"),e.nsSelect.is("hidden",!e.filterable)])},[ae(V("input",{id:e.inputId,ref:"inputRef","onUpdate:modelValue":d=>e.states.inputValue=d,type:"text",name:e.name,class:v([e.nsSelect.e("input"),e.nsSelect.is(e.selectSize)]),disabled:e.selectDisabled,autocomplete:e.autocomplete,style:he(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(d=>e.navigateOptions("next"),["stop","prevent"]),["down"]),te(N(d=>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"]),[[Ct,e.states.inputValue]]),e.filterable?(g(),I("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:v(e.nsSelect.e("input-calculator")),textContent:W(e.states.inputValue)},null,10,["textContent"])):$("v-if",!0)],2),e.shouldShowPlaceholder?(g(),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?k(e.$slots,"label",{key:0,label:e.currentPlaceholder,value:e.modelValue},()=>[V("span",null,W(e.currentPlaceholder),1)]):(g(),I("span",{key:1},W(e.currentPlaceholder),1))],2)):$("v-if",!0)],2),V("div",{ref:"suffixRef",class:v(e.nsSelect.e("suffix"))},[e.iconComponent&&!e.showClose?(g(),A(c,{key:0,class:v([e.nsSelect.e("caret"),e.nsSelect.e("icon"),e.iconReverse])},{default:L(()=>[(g(),A(Ve(e.iconComponent)))]),_:1},8,["class"])):$("v-if",!0),e.showClose&&e.clearIcon?(g(),A(c,{key:1,class:v([e.nsSelect.e("caret"),e.nsSelect.e("icon"),e.nsSelect.e("clear")]),onClick:e.handleClearClick},{default:L(()=>[(g(),A(Ve(e.clearIcon)))]),_:1},8,["class","onClick"])):$("v-if",!0),e.validateState&&e.validateIcon&&e.needStatusIcon?(g(),A(c,{key:2,class:v([e.nsInput.e("icon"),e.nsInput.e("validateIcon"),e.nsInput.is("loading",e.validateState==="validating")])},{default:L(()=>[(g(),A(Ve(e.validateIcon)))]),_:1},8,["class"])):$("v-if",!0)],2)],10,["onClick"])]}),content:L(()=>[q(h,{ref:"menuRef"},{default:L(()=>[e.$slots.header?(g(),I("div",{key:0,class:v(e.nsSelect.be("dropdown","header")),onClick:N(()=>{},["stop"])},[k(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?(g(),A(S,{key:0,value:e.states.inputValue,created:!0},null,8,["value"])):$("v-if",!0),q(t,null,{default:L(()=>[k(e.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label","onScroll"]),[[ke,e.states.options.size>0&&!e.loading]]),e.$slots.loading&&e.loading?(g(),I("div",{key:1,class:v(e.nsSelect.be("dropdown","loading"))},[k(e.$slots,"loading")],2)):e.loading||e.filteredOptionsCount===0?(g(),I("div",{key:2,class:v(e.nsSelect.be("dropdown","empty"))},[k(e.$slots,"empty",{},()=>[V("span",null,W(e.emptyText),1)])],2)):$("v-if",!0),e.$slots.footer?(g(),I("div",{key:3,class:v(e.nsSelect.be("dropdown","footer")),onClick:N(()=>{},["stop"])},[k(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"])),[[b,e.handleClickOutside,e.popperRef]])}var nn=Se(ln,[["render",tn],["__file","select.vue"]]);const an=re({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(e){const o=se("select"),a=E(),m=ye(),c=E([]);rl(dl,ie({...Re(e)}));const S=u(()=>c.value.some(b=>b.visible===!0)),t=b=>{var f;return b.type.name==="ElOption"&&!!((f=b.component)!=null&&f.proxy)},C=b=>{const f=U(b),d=[];return f.forEach(i=>{var s;Vt(i)&&(t(i)?d.push(i.component.proxy):F(i.children)&&i.children.length?d.push(...C(i.children)):(s=i.component)!=null&&s.subTree&&d.push(...C(i.component.subTree)))}),d},h=()=>{c.value=C(m.subTree)};return De(()=>{h()}),Lt(a,h,{attributes:!0,subtree:!0,childList:!0}),{groupRef:a,visible:S,ns:o}}});function on(e,o,a,m,c,S){return ae((g(),I("ul",{ref:"groupRef",class:v(e.ns.be("group","wrap"))},[V("li",{class:v(e.ns.be("group","title"))},W(e.label),3),V("li",null,[V("ul",{class:v(e.ns.b("group"))},[k(e.$slots,"default")],2)])],2)),[[ke,e.visible]])}var cl=Se(an,[["render",on],["__file","option-group.vue"]]);const Sn=Tt(nn,{Option:$e,OptionGroup:cl}),Cn=ul($e);ul(cl);export{Cn as E,Sn as a};
|