u
This commit is contained in:
1 parent
bcc4722efc
commit
f48536774f
403 files changed
+34776
No files matched your search
@@ -0,0 +1 @@
|
||||
import{i as S,H as Ue,Z as q,b7 as Ot,b as g,ai as Ie,_ as Be,d as ye,e as qe,c as H,o as I,C as U,h as re,u as N,at as We,n as B,U as Se,au as Ye,A as Ce,f as Je,m as de,b5 as ht,b4 as _t,t as Ee,g as ge,v as Ze,aM as wt,j as z,k as ve,J as Qe,ag as Z,D as $e,G as Pe,ay as St,l as me,x as Ct,p as $t,s as Pt,b8 as Vt,a4 as Xe,F as It,ae as Ae,ak as Bt,b9 as Et,aE as jt,am as he,ba as kt,w as Dt,q as J,b3 as Nt,aN as At,y as Ft,z as Rt}from"./index-C4UKuwCQ.js";import{C as Mt,S as Fe,d as Lt,V as xt}from"./index-h336NyeA.js";import{S as Kt}from"./index-Y5pyQQ_e.js";import{g as Tt,K as ce}from"./keyboard-b0R5wflF.js";const Ht=e=>{const t=S(),l=()=>Ot(t.value)?t.value.$refs[e]:t.value,s=S();return Ue(()=>{s.value=l()}),q([t],()=>{s.value=l()}),{componentRef:t,elementRef:s}};var zt=Object.defineProperty,Re=Object.getOwnPropertySymbols,Gt=Object.prototype.hasOwnProperty,Ut=Object.prototype.propertyIsEnumerable,Me=(e,t,l)=>t in e?zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,qt=(e,t)=>{for(var l in t||(t={}))Gt.call(t,l)&&Me(e,l,t[l]);if(Re)for(var l of Re(t))Ut.call(t,l)&&Me(e,l,t[l]);return e};const Wt=e=>{const t=g(()=>!!e.value),l=g(()=>{if(e.value)return qt({type:"embed"},Ie(e.value)?void 0:e.value)});return{displayScrollbar:t,scrollbarProps:l}},Yt=ye({name:"SelectDropdown",components:{ScrollbarComponent:_t,Empty:ht,Spin:Kt},props:{loading:Boolean,empty:Boolean,virtualList:Boolean,bottomOffset:{type:Number,default:0},scrollbar:{type:[Boolean,Object],default:!0},onScroll:{type:[Function,Array]},onReachBottom:{type:[Function,Array]},showHeaderOnEmpty:{type:Boolean,default:!1},showFooterOnEmpty:{type:Boolean,default:!1}},emits:["scroll","reachBottom"],setup(e,{emit:t,slots:l}){var s,p,r;const{scrollbar:f}=Ee(e),d=ge("select-dropdown"),v=Ze(wt,void 0),_=(r=(p=v==null?void 0:(s=v.slots).empty)==null?void 0:p.call(s,{component:"select"}))==null?void 0:r[0],{componentRef:w,elementRef:C}=Ht("containerRef"),{displayScrollbar:O,scrollbarProps:A}=Wt(f),$=E=>{const{scrollTop:R,scrollHeight:M,offsetHeight:u}=E.target;M-(R+u)<=e.bottomOffset&&t("reachBottom",E),t("scroll",E)},P=g(()=>[d,{[`${d}-has-header`]:!!l.header,[`${d}-has-footer`]:!!l.footer}]);return{prefixCls:d,SelectEmpty:_,cls:P,wrapperRef:C,wrapperComRef:w,handleScroll:$,displayScrollbar:O,scrollbarProps:A}}});function Jt(e,t,l,s,p,r){const f=qe("spin");return I(),H("div",{class:B(e.cls)},[e.$slots.header&&(!e.empty||e.showHeaderOnEmpty)?(I(),H("div",{key:0,class:B(`${e.prefixCls}-header`)},[N(e.$slots,"header")],2)):U("v-if",!0),e.loading?(I(),re(f,{key:1,class:B(`${e.prefixCls}-loading`)},null,8,["class"])):e.empty?(I(),H("div",{key:2,class:B(`${e.prefixCls}-empty`)},[N(e.$slots,"empty",{},()=>[(I(),re(Se(e.SelectEmpty?e.SelectEmpty:"Empty")))])],2)):U("v-if",!0),e.virtualList&&!e.loading&&!e.empty?N(e.$slots,"virtual-list",{key:3}):U("v-if",!0),e.virtualList?U("v-if",!0):We((I(),re(Se(e.displayScrollbar?"ScrollbarComponent":"div"),de({key:4,ref:"wrapperComRef",class:`${e.prefixCls}-list-wrapper`},e.scrollbarProps,{onScroll:e.handleScroll}),{default:Ce(()=>[Je("ul",{class:B(`${e.prefixCls}-list`)},[N(e.$slots,"default")],2)]),_:3},16,["class","onScroll"])),[[Ye,!e.loading&&!e.empty]]),e.$slots.footer&&(!e.empty||e.showFooterOnEmpty)?(I(),H("div",{key:5,class:B(`${e.prefixCls}-footer`)},[N(e.$slots,"footer")],2)):U("v-if",!0)],2)}var Zt=Be(Yt,[["render",Jt]]);const et=Symbol("ArcoSelectContext");var Qt=Object.defineProperty,Xt=Object.defineProperties,el=Object.getOwnPropertyDescriptors,Le=Object.getOwnPropertySymbols,tl=Object.prototype.hasOwnProperty,ll=Object.prototype.propertyIsEnumerable,xe=(e,t,l)=>t in e?Qt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,je=(e,t)=>{for(var l in t||(t={}))tl.call(t,l)&&xe(e,l,t[l]);if(Le)for(var l of Le(t))ll.call(t,l)&&xe(e,l,t[l]);return e},tt=(e,t)=>Xt(e,el(t));const ol=e=>z(e)&&"isGroup"in e,lt=e=>z(e)&&"isGroup"in e,al=(e,t="value")=>String(z(e)?e[t]:e),ue=(e,t="value")=>z(e)?`__arco__option__object__${e[t]}`:e||ve(e)||Qe(e)||Ie(e)?`__arco__option__${typeof e}-${e}`:"",nl=e=>e.has("__arco__option__string-"),rl=(e,{valueKey:t,fieldNames:l,origin:s,index:p=-1})=>{var r;if(z(e)){const d=e[l.value];return{raw:e,index:p,key:ue(d,t),origin:s,value:d,label:(r=e[l.label])!=null?r:al(d,t),render:e[l.render],disabled:!!e[l.disabled],tagProps:e[l.tagProps]}}const f={value:e,label:String(e),disabled:!1};return je({raw:f,index:p,key:ue(e,t),origin:s},f)},Ve=(e,{valueKey:t,fieldNames:l,origin:s,optionInfoMap:p})=>{var r;const f=[];for(const d of e)if(ol(d)){const v=Ve((r=d.options)!=null?r:[],{valueKey:t,fieldNames:l,origin:s,optionInfoMap:p});v.length>0&&f.push(tt(je({},d),{key:`__arco__group__${d.label}`,options:v}))}else{const v=rl(d,{valueKey:t,fieldNames:l,origin:s});f.push(v),p.get(v.key)||p.set(v.key,v)}return f},Ke=(e,{inputValue:t,filterOption:l})=>{const s=p=>{var r;const f=[];for(const d of p)if(lt(d)){const v=s((r=d.options)!=null?r:[]);v.length>0&&f.push(tt(je({},d),{options:v}))Line truncated
|
||||
Reference in new issue
Block a user