mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-06 00:18:51 +08:00
2 lines
14 KiB
JavaScript
2 lines
14 KiB
JavaScript
var Me=Object.defineProperty,Fe=Object.defineProperties;var xe=Object.getOwnPropertyDescriptors;var Ee=Object.getOwnPropertySymbols;var ze=Object.prototype.hasOwnProperty,Ge=Object.prototype.propertyIsEnumerable;var ve=(e,s,t)=>s in e?Me(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,p=(e,s)=>{for(var t in s||(s={}))ze.call(s,t)&&ve(e,t,s[t]);if(Ee)for(var t of Ee(s))Ge.call(s,t)&&ve(e,t,s[t]);return e},I=(e,s)=>Fe(e,xe(s));var ee=(e,s,t)=>new Promise((o,l)=>{var a=i=>{try{r(t.next(i))}catch(m){l(m)}},d=i=>{try{r(t.throw(i))}catch(m){l(m)}},r=i=>i.done?o(i.value):Promise.resolve(i.value).then(a,d);r((t=t.apply(e,s)).next())});import{aI as P,a as $,m as ne,Q as He,u as n,aJ as Ue,aK as _e,aL as Se,aM as Xe,aN as Ke,aG as Ce,aO as We,aP as C,aQ as Te,d as _,p as S,aR as qe,aS as oe,aT as Ye,aU as le,aV as $e,n as j,z as ke,aW as Pe,U as k,aX as M,aY as W,f as g,k as V,s as q,v as L,a6 as A,aZ as Qe,a_ as Ze,i as re,w as R,F as Y,h as Ie,t as Ve,j as G,a$ as Je,b0 as et,b1 as x,b as D,b2 as tt,r as H,b3 as U,T as st,b4 as ot,ar as X,b5 as at,b6 as Oe,b7 as nt,b8 as Re,b9 as ge,ba as Be,bb as lt,bc as rt,bd as ct,be as it,bf as ut,bg as dt,bh as pt,g as K,l as ft,bi as te,bj as bt,bk as mt,bl as Et,bm as vt,ap as gt,bn as yt,bo as ht,bp as wt,bq as _t,br as St,bs as Ct,bt as Tt,bu as $t,bv as kt,bw as Pt,bx as It,by as Vt,bz as Ot,bA as Rt,bB as Bt,bC as Dt,bD as Lt,bE as At,bF as Nt,bG as jt,bH as Mt,bI as Ft,bJ as xt,bK as zt,bL as Gt,bM as Ht,bN as Ut,bO as Xt,bP as Kt,bQ as Wt,bR as qt,bS as Yt,bT as Qt,bU as Zt,bV as Jt,bW as es,bX as ts,bY as ss,bZ as os,b_ as as,b$ as ns,c0 as ls,c1 as rs,c2 as cs,c3 as is,c4 as us,c5 as ds,c6 as ps,c7 as fs,c8 as bs,c9 as ms,ca as Es,cb as vs,cc as gs,cd as ys,ce as hs,cf as ws,cg as _s,ch as Ss,ci as Cs,cj as Ts,ck as $s,cl as ks,cm as Ps,cn as Is,co as Vs,cp as Os,cq as Rs,cr as Bs,cs as Ds,ct as Ls,cu as As,cv as Ns,cw as js,cx as Ms,cy as Fs,cz as xs,cA as zs,cB as Gs,cC as Hs,cD as Us,cE as Xs,cF as Ks,cG as Ws,cH as qs,cI as Ys,cJ as Qs,cK as Zs,cL as Js,cM as eo,cN as to,cO as so,cP as oo,cQ as ao,cR as no,cS as lo,cT as ro,a8 as co,cU as io,cV as uo,cW as po,cX as fo,cY as bo}from"./index-Ccpe4M2K.js";const ye=Symbol("INSTALLED_KEY");P({});const mo=e=>{if(!_e)return;if(!e)return e;const s=Se(e);return s||(Ce(e)?s:e)},Eo=({middleware:e,placement:s,strategy:t})=>{const o=$(),l=$(),a=$(),d=$(),r=$({}),i={x:a,y:d,placement:s,strategy:t,middlewareData:r},m=()=>ee(void 0,null,function*(){if(!_e)return;const E=mo(o),h=Se(l);if(!E||!h)return;const f=yield Xe(E,h,{placement:n(s),strategy:n(t),middleware:n(e)});Ke(i).forEach(T=>{i[T].value=f[T]})});return ne(()=>{He(()=>{m()})}),I(p({},i),{update:m,referenceRef:o,contentRef:l})},vo=({arrowRef:e,padding:s})=>({name:"arrow",options:{element:e,padding:s},fn(t){const o=n(e);return o?Ue({element:o,padding:s}).fn(t):{}}}),go="2.7.3",yo=(e=[])=>({version:go,install:(t,o)=>{t[ye]||(t[ye]=!0,e.forEach(l=>t.use(l)),o&&We(o,t,!0))}}),De=P({nowrap:Boolean});var Le=(e=>(e.top="top",e.bottom="bottom",e.left="left",e.right="right",e))(Le||{});const ho=Object.values(Le),ce=P({width:{type:Number,default:10},height:{type:Number,default:10},style:{type:C(Object),default:null}}),wo=P({side:{type:C(String),values:ho,required:!0}}),_o=["absolute","fixed"],So=["top-start","top-end","top","bottom-start","bottom-end","bottom","left-start","left-end","left","right-start","right-end","right"],ie=P(p({arrowPadding:{type:C(Number),default:5},effect:{type:String,default:""},contentClass:String,placement:{type:C(String),values:So,default:"bottom"},reference:{type:C(Object),default:null},offset:{type:Number,default:8},strategy:{type:C(String),values:_o,default:"absolute"},showArrow:{type:Boolean,default:!1}},Te(["ariaLabel"]))),ue=P({delayDuration:{type:Number,default:300},defaultOpen:Boolean,open:{type:Boolean,default:void 0},onOpenChange:{type:C(Function)},"onUpdate:open":{type:C(Function)}}),z={type:C(Function)},de=P({onBlur:z,onClick:z,onFocus:z,onMouseDown:z,onMouseEnter:z,onMouseLeave:z}),Co=P(I(p(p(p(p({},ue),ce),de),ie),{alwaysOn:Boolean,fullTransition:Boolean,transitionProps:{type:C(Object),default:null},teleported:Boolean,to:{type:C(String),default:"body"}})),Q=Symbol("tooltipV2"),Ae=Symbol("tooltipV2Content"),se="tooltip_v2.open",To=_({name:"ElTooltipV2Root"}),$o=_(I(p({},To),{props:ue,setup(e,{expose:s}){const t=e,o=$(t.defaultOpen),l=$(null),a=S({get:()=>qe(t.open)?o.value:t.open,set:v=>{var w;o.value=v,(w=t["onUpdate:open"])==null||w.call(t,v)}}),d=S(()=>oe(t.delayDuration)&&t.delayDuration>0),{start:r,stop:i}=Ye(()=>{a.value=!0},S(()=>t.delayDuration),{immediate:!1}),m=le("tooltip-v2"),E=$e(),h=()=>{i(),a.value=!0},f=()=>{n(d)?r():h()},T=h,y=()=>{i(),a.value=!1};return j(a,v=>{var w;v&&(document.dispatchEvent(new CustomEvent(se)),T()),(w=t.onOpenChange)==null||w.call(t,v)}),ne(()=>{document.addEventListener(se,y)}),ke(()=>{i(),document.removeEventListener(se,y)}),Pe(Q,{contentId:E,triggerRef:l,ns:m,onClose:y,onDelayOpen:f,onOpen:T}),s({onOpen:T,onClose:y}),(v,w)=>k(v.$slots,"default",{open:n(a)})}}));var ko=M($o,[["__file","root.vue"]]);const Po=_({name:"ElTooltipV2Arrow"}),Io=_(I(p({},Po),{props:p(p({},ce),wo),setup(e){const s=e,{ns:t}=W(Q),{arrowRef:o}=W(Ae),l=S(()=>{const{style:a,width:d,height:r}=s,i=t.namespace.value;return p({[`--${i}-tooltip-v2-arrow-width`]:`${d}px`,[`--${i}-tooltip-v2-arrow-height`]:`${r}px`,[`--${i}-tooltip-v2-arrow-border-width`]:`${d/2}px`,[`--${i}-tooltip-v2-arrow-cover-width`]:d/2-1},a||{})});return(a,d)=>(g(),V("span",{ref_key:"arrowRef",ref:o,style:q(n(l)),class:L(n(t).e("arrow"))},null,6))}}));var he=M(Io,[["__file","arrow.vue"]]);const Vo=P({style:{type:C([String,Object,Array]),default:()=>({})}}),Oo=_({name:"ElVisuallyHidden"}),Ro=_(I(p({},Oo),{props:Vo,setup(e){const s=e,t=S(()=>[s.style,{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}]);return(o,l)=>(g(),V("span",A(o.$attrs,{style:n(t)}),[k(o.$slots,"default")],16))}}));var Bo=M(Ro,[["__file","visual-hidden.vue"]]);const Do=["data-side"],Lo=_({name:"ElTooltipV2Content"}),Ao=_(I(p({},Lo),{props:p(p({},ie),De),setup(e){const s=e,{triggerRef:t,contentId:o}=W(Q),l=$(s.placement),a=$(s.strategy),d=$(null),{referenceRef:r,contentRef:i,middlewareData:m,x:E,y:h,update:f}=Eo({placement:l,strategy:a,middleware:S(()=>{const u=[Qe(s.offset)];return s.showArrow&&u.push(vo({arrowRef:d})),u})}),T=Ze().nextZIndex(),y=le("tooltip-v2"),N=S(()=>l.value.split("-")[0]),v=S(()=>({position:n(a),top:`${n(h)||0}px`,left:`${n(E)||0}px`,zIndex:T})),w=S(()=>{if(!s.showArrow)return{};const{arrow:u}=n(m);return{[`--${y.namespace.value}-tooltip-v2-arrow-x`]:`${u==null?void 0:u.x}px`||"",[`--${y.namespace.value}-tooltip-v2-arrow-y`]:`${u==null?void 0:u.y}px`||""}}),b=S(()=>[y.e("content"),y.is("dark",s.effect==="dark"),y.is(n(a)),s.contentClass]);return j(d,()=>f()),j(()=>s.placement,u=>l.value=u),ne(()=>{j(()=>s.reference||t.value,u=>{r.value=u||void 0},{immediate:!0})}),Pe(Ae,{arrowRef:d}),(u,F)=>(g(),V("div",{ref_key:"contentRef",ref:i,style:q(n(v)),"data-tooltip-v2-root":""},[u.nowrap?G("v-if",!0):(g(),V("div",{key:0,"data-side":n(N),class:L(n(b))},[k(u.$slots,"default",{contentStyle:n(v),contentClass:n(b)}),re(n(Bo),{id:n(o),role:"tooltip"},{default:R(()=>[u.ariaLabel?(g(),V(Y,{key:0},[Ie(Ve(u.ariaLabel),1)],64)):k(u.$slots,"default",{key:1})]),_:3},8,["id"]),k(u.$slots,"arrow",{style:q(n(w)),side:n(N)})],10,Do))],4))}}));var we=M(Ao,[["__file","content.vue"]]);const No=P({setRef:{type:C(Function),required:!0},onlyChild:Boolean});var jo=_({props:No,setup(e,{slots:s}){const t=$(),o=et(t,l=>{l?e.setRef(l.nextElementSibling):e.setRef(null)});return()=>{var l;const[a]=((l=s.default)==null?void 0:l.call(s))||[],d=e.onlyChild?Je(a.children):a.children;return re(Y,{ref:o},[d])}}});const Mo=_({name:"ElTooltipV2Trigger"}),Fo=_(I(p({},Mo),{props:p(p({},De),de),setup(e){const s=e,{onClose:t,onOpen:o,onDelayOpen:l,triggerRef:a,contentId:d}=W(Q);let r=!1;const i=b=>{a.value=b},m=()=>{r=!1},E=x(s.onMouseEnter,l),h=x(s.onMouseLeave,t),f=x(s.onMouseDown,()=>{t(),r=!0,document.addEventListener("mouseup",m,{once:!0})}),T=x(s.onFocus,()=>{r||o()}),y=x(s.onBlur,t),N=x(s.onClick,b=>{b.detail===0&&t()}),v={blur:y,click:N,focus:T,mousedown:f,mouseenter:E,mouseleave:h},w=(b,u,F)=>{b&&Object.entries(u).forEach(([Z,J])=>{b[F](Z,J)})};return j(a,(b,u)=>{w(b,v,"addEventListener"),w(u,v,"removeEventListener"),b&&b.setAttribute("aria-describedby",d.value)}),ke(()=>{w(a.value,v,"removeEventListener"),document.removeEventListener("mouseup",m)}),(b,u)=>b.nowrap?(g(),D(n(jo),{key:0,"set-ref":i,"only-child":""},{default:R(()=>[k(b.$slots,"default")]),_:3})):(g(),V("button",A({key:1,ref_key:"triggerRef",ref:a},b.$attrs),[k(b.$slots,"default")],16))}}));var xo=M(Fo,[["__file","trigger.vue"]]);const zo=_({name:"ElTooltipV2"}),Go=_(I(p({},zo),{props:Co,setup(e){const t=tt(e),o=H(U(t,Object.keys(ce))),l=H(U(t,Object.keys(ie))),a=H(U(t,Object.keys(ue))),d=H(U(t,Object.keys(de)));return(r,i)=>(g(),D(ko,X(at(a)),{default:R(({open:m})=>[re(xo,A(d,{nowrap:""}),{default:R(()=>[k(r.$slots,"trigger")]),_:3},16),(g(),D(st,{to:r.to,disabled:!r.teleported},[r.fullTransition?(g(),D(ot,X(A({key:0},r.transitionProps)),{default:R(()=>[r.alwaysOn||m?(g(),D(we,X(A({key:0},l)),{arrow:R(({style:E,side:h})=>[r.showArrow?(g(),D(he,A({key:0},o,{style:E,side:h}),null,16,["style","side"])):G("v-if",!0)]),default:R(()=>[k(r.$slots,"default")]),_:3},16)):G("v-if",!0)]),_:2},1040)):(g(),V(Y,{key:1},[r.alwaysOn||m?(g(),D(we,X(A({key:0},l)),{arrow:R(({style:E,side:h})=>[r.showArrow?(g(),D(he,A({key:0},o,{style:E,side:h}),null,16,["style","side"])):G("v-if",!0)]),default:R(()=>[k(r.$slots,"default")]),_:3},16)):G("v-if",!0)],64))],8,["to","disabled"]))]),_:3},16))}}));var Ho=M(Go,[["__file","tooltip.vue"]]);const Uo=Oe(Ho),Xo=P(p({options:{type:C(Array),default:()=>[]},modelValue:{type:[String,Number,Boolean],default:void 0},block:Boolean,size:nt,disabled:Boolean,validateEvent:{type:Boolean,default:!0},id:String,name:String},Te(["ariaLabel"]))),Ko={[Re]:e=>ge(e)||oe(e),[Be]:e=>ge(e)||oe(e)},Wo=["id","aria-label","aria-labelledby"],qo=["name","disabled","checked","onChange"],Yo=_({name:"ElSegmented"}),Qo=_(I(p({},Yo),{props:Xo,emits:Ko,setup(e,{emit:s}){const t=e,o=le("segmented"),l=$e(),a=lt(),d=rt(),{formItem:r}=ct(),{inputId:i,isLabeledByFormItem:m}=it(t,{formItemContext:r}),E=$(null),h=ut(),f=H({isInit:!1,width:0,translateX:0,disabled:!1,focusVisible:!1}),T=c=>{const O=y(c);s(Re,O),s(Be,O)},y=c=>te(c)?c.value:c,N=c=>te(c)?c.label:c,v=c=>!!(d.value||te(c)&&c.disabled),w=c=>t.modelValue===y(c),b=c=>t.options.find(O=>y(O)===c),u=c=>[o.e("item"),o.is("selected",w(c)),o.is("disabled",v(c))],F=()=>{if(!E.value)return;const c=E.value.querySelector(".is-selected"),O=E.value.querySelector(".is-selected input");if(!c||!O){f.width=0,f.translateX=0,f.disabled=!1,f.focusVisible=!1;return}const B=c.getBoundingClientRect();f.isInit=!0,f.width=B.width,f.translateX=c.offsetLeft,f.disabled=v(b(t.modelValue));try{f.focusVisible=O.matches(":focus-visible")}catch(me){}},Z=S(()=>[o.b(),o.m(a.value),o.is("block",t.block)]),J=S(()=>({width:`${f.width}px`,transform:`translateX(${f.translateX}px)`,display:f.isInit?"block":"none"})),Ne=S(()=>[o.e("item-selected"),o.is("disabled",f.disabled),o.is("focus-visible",f.focusVisible)]),je=S(()=>t.name||l.value);return dt(E,F),j(h,F),j(()=>t.modelValue,()=>{var c;F(),t.validateEvent&&((c=r==null?void 0:r.validate)==null||c.call(r,"change").catch(O=>pt()))},{flush:"post"}),(c,O)=>(g(),V("div",{id:n(i),ref_key:"segmentedRef",ref:E,class:L(n(Z)),role:"radiogroup","aria-label":n(m)?void 0:c.ariaLabel||"segmented","aria-labelledby":n(m)?n(r).labelId:void 0},[K("div",{class:L(n(o).e("group"))},[K("div",{style:q(n(J)),class:L(n(Ne))},null,6),(g(!0),V(Y,null,ft(c.options,(B,me)=>(g(),V("label",{key:me,class:L(u(B))},[K("input",{class:L(n(o).e("item-input")),type:"radio",name:n(je),disabled:v(B),checked:w(B),onChange:da=>T(B)},null,42,qo),K("div",{class:L(n(o).e("item-label"))},[k(c.$slots,"default",{item:B},()=>[Ie(Ve(N(B)),1)])],2)],2))),128))],2)],10,Wo))}}));var Zo=M(Qo,[["__file","segmented.vue"]]);const Jo=Oe(Zo);var ea=[bt,mt,Et,vt,gt,yt,ht,wt,_t,St,Ct,Tt,$t,kt,Pt,It,Vt,Ot,Rt,Bt,Dt,Lt,At,Nt,jt,Mt,Ft,xt,zt,Gt,Ht,Ut,Xt,Kt,Wt,qt,Yt,Qt,Zt,Jt,es,ts,ss,os,as,ns,ls,rs,cs,is,us,ds,ps,fs,bs,ms,Es,vs,gs,ys,hs,ws,_s,Ss,Cs,Ts,$s,ks,Ps,Is,Vs,Os,Rs,Bs,Ds,Ls,As,Ns,js,Ms,Fs,xs,zs,Gs,Hs,Us,Xs,Ks,Ws,qs,Ys,Qs,Uo,Zs,Js,eo,to,so,oo,ao,no,lo,ro,Jo],ta=[co,io,uo,po,fo,bo],sa=yo([...ea,...ta]);const oa=sa.version,aa=Object.prototype.toString,pe=e=>aa.call(e),na=e=>pe(e).slice(8,-1),ba=Array.isArray,ma=e=>pe(e)==="[object Date]",ae=e=>typeof e=="function",la=e=>typeof e=="string",ra=e=>e!==null&&typeof e=="object",ca=e=>ra(e)&&ae(e.then)&&ae(e.catch),fe=e=>pe(e)==="[object Object]",Ea=e=>{if(la(e))return{content:e};if(fe(e))return e},ia=(e,s)=>{if(!fe(e))throw new Error(`${s} expected Object but got ${na(e)}`)},va=(e,s,t,o,l)=>ee(void 0,null,function*(){try{let a={};const d={row:t,index:o};return e?Ce(e)?a=e.value:fe(e)?a=p({},e):ae(e)?a=yield e(s,d):ca(e)?a=yield e:a=e:a={},ia(a,l),a}catch(a){return Promise.reject(a)}}),be=(e,s)=>s?`plus-${e}-${s}`:`plus-${e}`,ga=e=>`${be("field",e)}`,ya=e=>`${be("label",e)}`,ha=e=>`${be("extra",e)}`,wa=(e,s)=>{const t={};return Object.keys(e||{}).forEach(o=>{o.startsWith(s)&&(t[o]=e[o])}),t},ua=(e,s)=>{const t=e.split(".").map(a=>Number(a)),o=s.split(".").map(a=>Number(a)),l=Math.max(t.length,o.length);for(let a=0;a<l;a++){if((t[a]||0)>(o[a]||0))return 1;if((t[a]||0)<(o[a]||0))return-1}return 0},_a=ua(oa,"2.6.0")<0,Sa=e=>e?n(e):"";var Ca=(e,s)=>{const t=e.__vccOpts||e;for(const[o,l]of s)t[o]=l;return t};export{Ca as _,la as a,ga as b,ha as c,ba as d,ca as e,wa as f,ya as g,Sa as h,ae as i,va as j,Ea as k,ma as l,na as t,_a as v};
|