dropdown.5eac3253.js 2.1 KB

1
  1. import{_ as I,f as O,R as T,r as _,S as E,O as g,C as b,k as f,be as L,aq as m,ar as t,ab as $,aa as o}from"./entry.97b97815.js";import{a as M,u as C}from"./index.94c844ee.js";const h=O({inheritAttrs:!1});function w(n,l,a,s,i,d){return T(n.$slots,"default")}var P=I(h,[["render",w],["__file","collection.vue"]]);const v=O({name:"ElCollectionItem",inheritAttrs:!1});function A(n,l,a,s,i,d){return T(n.$slots,"default")}var B=I(v,[["render",A],["__file","collection-item.vue"]]);const K="data-el-collection-item",x=n=>{const l=`El${n}Collection`,a=`${l}Item`,s=Symbol(l),i=Symbol(a),d={...P,name:l,setup(){const u=_(null),c=new Map;E(s,{itemMap:c,getItems:()=>{const r=f(u);if(!r)return[];const e=Array.from(r.querySelectorAll(`[${K}]`));return[...c.values()].sort((N,S)=>e.indexOf(N.ref)-e.indexOf(S.ref))},collectionRef:u})}},y={...B,name:a,setup(u,{attrs:c}){const p=_(null),r=g(s,void 0);E(i,{collectionItemRef:p}),b(()=>{const e=f(p);e&&r.itemMap.set(e,{ref:e,...c})}),L(()=>{const e=f(p);r.itemMap.delete(e)})}};return{COLLECTION_INJECTION_KEY:s,COLLECTION_ITEM_INJECTION_KEY:i,ElCollection:d,ElCollectionItem:y}},D=m({trigger:M.trigger,effect:{...C.effect,default:"light"},type:{type:t(String)},placement:{type:t(String),default:"bottom"},popperOptions:{type:t(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:t([Number,String]),default:0},maxHeight:{type:t([Number,String]),default:""},popperClass:{type:String,default:""},disabled:{type:Boolean,default:!1},role:{type:String,default:"menu"},buttonProps:{type:t(Object)},teleported:C.teleported}),k=m({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:$}}),q=m({onKeydown:{type:t(Function)}}),Y=[o.down,o.pageDown,o.home],j=[o.up,o.pageUp,o.end],U=[...Y,...j],{ElCollection:V,ElCollectionItem:z,COLLECTION_INJECTION_KEY:G,COLLECTION_ITEM_INJECTION_KEY:H}=x("Dropdown");export{H as C,V as E,U as F,j as L,k as a,K as b,x as c,D as d,z as e,q as f,G as g};