119 lines
33 KiB
JavaScript
119 lines
33 KiB
JavaScript
import{q as Me,s as oe,bC as ft,n as U,E as Ue,H as X,U as Ge,R as je,S as ke,r as _,bK as V,bV as G,a7 as ne,d as Z,D as ee,bD as ht,er as ct,V as ce,es as Oe,et as pt,u as vt,m as R,t as j,x as Je,h as x,a1 as Ve,L as gt,A as mt,eu as wt,ev as _e,ew as bt,ex as Be,ey as Ee,ez as re,eA as Ce,eB as Te,eC as ue,eD as yt,eE as Pe,a as $t,eF as qe,eG as xt,eH as Mt,eI as At,eJ as St,eK as Ot,eL as Qe,eM as _t,k as W,f as F,I as pe,B as ve,j as fe,eN as Bt,l as Ze,p as ie,eO as Et,w as Re,P as ze,W as Ct,v as Tt,c0 as Ie,T as Pt,ec as Le,X as zt,y as It,ai as ge,K as Lt,e7 as Dt,eP as De,al as Ft,cp as Nt,a9 as Ht,a2 as ae,cg as Wt}from"./index-232e6af6.js";import{c as Xt,t as Ae,i as et,g as Yt,b as Kt,u as Ut}from"./Eye-51fdc120.js";import{f as me}from"./format-length-c9d165c6.js";import{b as Gt}from"./next-frame-once-7035a838.js";let we;function jt(){return we===void 0&&(we=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),we}let q,te;const kt=()=>{var e,t;q=ft?(t=(e=document)===null||e===void 0?void 0:e.fonts)===null||t===void 0?void 0:t.ready:void 0,te=!1,q!==void 0?q.then(()=>{te=!0}):te=!0};kt();function Jt(e){if(te)return;let t=!1;Me(()=>{te||q==null||q.then(()=>{t||e()})}),oe(()=>{t=!0})}function Vt(e,t){return U(()=>{for(const n of t)if(e[n]!==void 0)return e[n];return e[t[t.length-1]]})}const Ar=Ue("n-internal-select-menu"),qt=Ue("n-internal-select-menu-body"),tt="__disabled__";function Q(e){const t=X(Ge,null),n=X(je,null),r=X(ke,null),i=X(qt,null),o=_();if(typeof document<"u"){o.value=document.fullscreenElement;const l=()=>{o.value=document.fullscreenElement};Me(()=>{V("fullscreenchange",document,l)}),oe(()=>{G("fullscreenchange",document,l)})}return ne(()=>{var l;const{to:s}=e;return s!==void 0?s===!1?tt:s===!0?o.value||"body":s:t!=null&&t.value?(l=t.value.$el)!==null&&l!==void 0?l:t.value:n!=null&&n.value?n.value:r!=null&&r.value?r.value:i!=null&&i.value?i.value:s??(o.value||"body")})}Q.tdkey=tt;Q.propTo={type:[String,Object,Boolean],default:void 0};let H=null;function nt(){if(H===null&&(H=document.getElementById("v-binder-view-measurer"),H===null)){H=document.createElement("div"),H.id="v-binder-view-measurer";const{style:e}=H;e.position="fixed",e.left="0",e.right="0",e.top="0",e.bottom="0",e.pointerEvents="none",e.visibility="hidden",document.body.appendChild(H)}return H.getBoundingClientRect()}function Qt(e,t){const n=nt();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function be(e){const t=e.getBoundingClientRect(),n=nt();return{left:t.left-n.left,top:t.top-n.top,bottom:n.height+n.top-t.bottom,right:n.width+n.left-t.right,width:t.width,height:t.height}}function Zt(e){return e.nodeType===9?null:e.parentNode}function rt(e){if(e===null)return null;const t=Zt(e);if(t===null)return null;if(t.nodeType===9)return document;if(t.nodeType===1){const{overflow:n,overflowX:r,overflowY:i}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(n+i+r))return t}return rt(t)}const Rt=Z({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(e){var t;ee("VBinder",(t=ht())===null||t===void 0?void 0:t.proxy);const n=X("VBinder",null),r=_(null),i=f=>{r.value=f,n&&e.syncTargetWithParent&&n.setTargetRef(f)};let o=[];const l=()=>{let f=r.value;for(;f=rt(f),f!==null;)o.push(f);for(const $ of o)V("scroll",$,w,!0)},s=()=>{for(const f of o)G("scroll",f,w,!0);o=[]},a=new Set,p=f=>{a.size===0&&l(),a.has(f)||a.add(f)},v=f=>{a.has(f)&&a.delete(f),a.size===0&&s()},w=()=>{Gt(d)},d=()=>{a.forEach(f=>f())},c=new Set,g=f=>{c.size===0&&V("resize",window,y),c.has(f)||c.add(f)},u=f=>{c.has(f)&&c.delete(f),c.size===0&&G("resize",window,y)},y=()=>{c.forEach(f=>f())};return oe(()=>{G("resize",window,y),s()}),{targetRef:r,setTargetRef:i,addScrollListener:p,removeScrollListener:v,addResizeListener:g,removeResizeListener:u}},render(){return ct("binder",this.$slots)}}),en=Rt,tn=Z({name:"Target",setup(){const{setTargetRef:e,syncTarget:t}=X("VBinder");return{syncTarget:t,setTargetDirective:{mounted:e,updated:e}}},render(){const{syncTarget:e,setTargetDirective:t}=this;return e?ce(Oe("follower",this.$slots),[[t]]):Oe("follower",this.$slots)}}),J="@@mmoContext",nn={mounted(e,{value:t}){e[J]={handler:void 0},typeof t=="function"&&(e[J].handler=t,V("mousemoveoutside",e,t))},updated(e,{value:t}){const n=e[J];typeof t=="function"?n.handler?n.handler!==t&&(G("mousemoveoutside",e,n.handler),n.handler=t,V("mousemoveoutside",e,t)):(e[J].handler=t,V("mousemoveoutside",e,t)):n.handler&&(G("mousemoveoutside",e,n.handler),n.handler=void 0)},unmounted(e){const{handler:t}=e[J];t&&G("mousemoveoutside",e,t),e[J].handler=void 0}},rn=nn,{c:se}=pt(),on="vueuc-style",le={top:"bottom",bottom:"top",left:"right",right:"left"},Fe={start:"end",center:"center",end:"start"},ye={top:"height",bottom:"height",left:"width",right:"width"},an={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},sn={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},ln={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},Ne={top:!0,bottom:!1,left:!0,right:!1},He={top:"end",bottom:"start",left:"end",right:"start"};function dn(e,t,n,r,i,o){if(!i||o)return{placement:e,top:0,left:0};const[l,s]=e.split("-");let a=s??"center",p={top:0,left:0};const v=(c,g,u)=>{let y=0,f=0;const $=n[c]-t[g]-t[c];return $>0&&r&&(u?f=Ne[g]?$:-$:y=Ne[g]?$:-$),{left:y,top:f}},w=l==="left"||l==="right";if(a!=="center"){const c=ln[e],g=le[c],u=ye[c];if(n[u]>t[u]){if(t[c]+t[u]<n[u]){const y=(n[u]-t[u])/2;t[c]<y||t[g]<y?t[c]<t[g]?(a=Fe[s],p=v(u,g,w)):p=v(u,c,w):a="center"}}else n[u]<t[u]&&t[g]<0&&t[c]>t[g]&&(a=Fe[s])}else{const c=l==="bottom"||l==="top"?"left":"top",g=le[c],u=ye[c],y=(n[u]-t[u])/2;(t[c]<y||t[g]<y)&&(t[c]>t[g]?(a=He[c],p=v(u,c,w)):(a=He[g],p=v(u,g,w)))}let d=l;return t[l]<n[ye[l]]&&t[l]<t[le[l]]&&(d=le[l]),{placement:a!=="center"?`${d}-${a}`:d,left:p.left,top:p.top}}function un(e,t){return t?sn[e]:an[e]}function fn(e,t,n,r,i,o){if(o)switch(e){case"bottom-start":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(e){case"bottom-start":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+i)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+i)}px`,transform:"translateX(-50%)"}}}const hn=se([se(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),se(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[se("> *",{pointerEvents:"all"})])]),cn=Z({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(e){const t=X("VBinder"),n=ne(()=>e.enabled!==void 0?e.enabled:e.show),r=_(null),i=_(null),o=()=>{const{syncTrigger:d}=e;d.includes("scroll")&&t.addScrollListener(a),d.includes("resize")&&t.addResizeListener(a)},l=()=>{t.removeScrollListener(a),t.removeResizeListener(a)};Me(()=>{n.value&&(a(),o())});const s=vt();hn.mount({id:"vueuc/binder",head:!0,anchorMetaName:on,ssr:s}),oe(()=>{l()}),Jt(()=>{n.value&&a()});const a=()=>{if(!n.value)return;const d=r.value;if(d===null)return;const c=t.targetRef,{x:g,y:u,overlap:y}=e,f=g!==void 0&&u!==void 0?Qt(g,u):be(c);d.style.setProperty("--v-target-width",`${Math.round(f.width)}px`),d.style.setProperty("--v-target-height",`${Math.round(f.height)}px`);const{width:$,minWidth:I,placement:B,internalShift:E,flip:Y}=e;d.setAttribute("v-placement",B),y?d.setAttribute("v-overlap",""):d.removeAttribute("v-overlap");const{style:m}=d;$==="target"?m.width=`${f.width}px`:$!==void 0?m.width=$:m.width="",I==="target"?m.minWidth=`${f.width}px`:I!==void 0?m.minWidth=I:m.minWidth="";const S=be(d),O=be(i.value),{left:b,top:N,placement:L}=dn(B,f,S,E,Y,y),z=un(L,y),{left:K,top:h,transform:M}=fn(L,O,f,N,b,y);d.setAttribute("v-placement",L),d.style.setProperty("--v-offset-left",`${Math.round(b)}px`),d.style.setProperty("--v-offset-top",`${Math.round(N)}px`),d.style.transform=`translateX(${K}) translateY(${h}) ${M}`,d.style.setProperty("--v-transform-origin",z),d.style.transformOrigin=z};R(n,d=>{d?(o(),p()):l()});const p=()=>{mt().then(a).catch(d=>console.error(d))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(d=>{R(j(e,d),a)}),["teleportDisabled"].forEach(d=>{R(j(e,d),p)}),R(j(e,"syncTrigger"),d=>{d.includes("resize")?t.addResizeListener(a):t.removeResizeListener(a),d.includes("scroll")?t.addScrollListener(a):t.removeScrollListener(a)});const v=Je(),w=ne(()=>{const{to:d}=e;if(d!==void 0)return d;v.value});return{VBinder:t,mergedEnabled:n,offsetContainerRef:i,followerRef:r,mergedTo:w,syncPosition:a}},render(){return x(gt,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var e,t;const n=x("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[x("div",{class:"v-binder-follower-content",ref:"followerRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))]);return this.zindexable?ce(n,[[Ve,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var pn="__lodash_hash_undefined__";function vn(e){return this.__data__.set(e,pn),this}function gn(e){return this.__data__.has(e)}function he(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new wt;++t<n;)this.add(e[t])}he.prototype.add=he.prototype.push=vn;he.prototype.has=gn;function mn(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function wn(e,t){return e.has(t)}var bn=1,yn=2;function ot(e,t,n,r,i,o){var l=n&bn,s=e.length,a=t.length;if(s!=a&&!(l&&a>s))return!1;var p=o.get(e),v=o.get(t);if(p&&v)return p==t&&v==e;var w=-1,d=!0,c=n&yn?new he:void 0;for(o.set(e,t),o.set(t,e);++w<s;){var g=e[w],u=t[w];if(r)var y=l?r(u,g,w,t,e,o):r(g,u,w,e,t,o);if(y!==void 0){if(y)continue;d=!1;break}if(c){if(!mn(t,function(f,$){if(!wn(c,$)&&(g===f||i(g,f,n,r,o)))return c.push($)})){d=!1;break}}else if(!(g===u||i(g,u,n,r,o))){d=!1;break}}return o.delete(e),o.delete(t),d}function $n(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function xn(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Mn=1,An=2,Sn="[object Boolean]",On="[object Date]",_n="[object Error]",Bn="[object Map]",En="[object Number]",Cn="[object RegExp]",Tn="[object Set]",Pn="[object String]",zn="[object Symbol]",In="[object ArrayBuffer]",Ln="[object DataView]",We=_e?_e.prototype:void 0,$e=We?We.valueOf:void 0;function Dn(e,t,n,r,i,o,l){switch(n){case Ln:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case In:return!(e.byteLength!=t.byteLength||!o(new Be(e),new Be(t)));case Sn:case On:case En:return bt(+e,+t);case _n:return e.name==t.name&&e.message==t.message;case Cn:case Pn:return e==t+"";case Bn:var s=$n;case Tn:var a=r&Mn;if(s||(s=xn),e.size!=t.size&&!a)return!1;var p=l.get(e);if(p)return p==t;r|=An,l.set(e,t);var v=ot(s(e),s(t),r,i,o,l);return l.delete(e),v;case zn:if($e)return $e.call(e)==$e.call(t)}return!1}var Fn=1,Nn=Object.prototype,Hn=Nn.hasOwnProperty;function Wn(e,t,n,r,i,o){var l=n&Fn,s=Ee(e),a=s.length,p=Ee(t),v=p.length;if(a!=v&&!l)return!1;for(var w=a;w--;){var d=s[w];if(!(l?d in t:Hn.call(t,d)))return!1}var c=o.get(e),g=o.get(t);if(c&&g)return c==t&&g==e;var u=!0;o.set(e,t),o.set(t,e);for(var y=l;++w<a;){d=s[w];var f=e[d],$=t[d];if(r)var I=l?r($,f,d,t,e,o):r(f,$,d,e,t,o);if(!(I===void 0?f===$||i(f,$,n,r,o):I)){u=!1;break}y||(y=d=="constructor")}if(u&&!y){var B=e.constructor,E=t.constructor;B!=E&&"constructor"in e&&"constructor"in t&&!(typeof B=="function"&&B instanceof B&&typeof E=="function"&&E instanceof E)&&(u=!1)}return o.delete(e),o.delete(t),u}var Xn=1,Xe="[object Arguments]",Ye="[object Array]",de="[object Object]",Yn=Object.prototype,Ke=Yn.hasOwnProperty;function Kn(e,t,n,r,i,o){var l=re(e),s=re(t),a=l?Ye:Ce(e),p=s?Ye:Ce(t);a=a==Xe?de:a,p=p==Xe?de:p;var v=a==de,w=p==de,d=a==p;if(d&&Te(e)){if(!Te(t))return!1;l=!0,v=!1}if(d&&!v)return o||(o=new ue),l||yt(e)?ot(e,t,n,r,i,o):Dn(e,t,a,n,r,i,o);if(!(n&Xn)){var c=v&&Ke.call(e,"__wrapped__"),g=w&&Ke.call(t,"__wrapped__");if(c||g){var u=c?e.value():e,y=g?t.value():t;return o||(o=new ue),i(u,y,n,r,o)}}return d?(o||(o=new ue),Wn(e,t,n,r,i,o)):!1}function Se(e,t,n,r,i){return e===t?!0:e==null||t==null||!Pe(e)&&!Pe(t)?e!==e&&t!==t:Kn(e,t,n,r,Se,i)}var Un=1,Gn=2;function jn(e,t,n,r){var i=n.length,o=i,l=!r;if(e==null)return!o;for(e=Object(e);i--;){var s=n[i];if(l&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){s=n[i];var a=s[0],p=e[a],v=s[1];if(l&&s[2]){if(p===void 0&&!(a in e))return!1}else{var w=new ue;if(r)var d=r(p,v,a,e,t,w);if(!(d===void 0?Se(v,p,Un|Gn,r,w):d))return!1}}return!0}function it(e){return e===e&&!$t(e)}function kn(e){for(var t=qe(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,it(i)]}return t}function at(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function Jn(e){var t=kn(e);return t.length==1&&t[0][2]?at(t[0][0],t[0][1]):function(n){return n===e||jn(n,e,t)}}function Vn(e,t){return e!=null&&t in Object(e)}function qn(e,t,n){t=Xt(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var l=Ae(t[r]);if(!(o=e!=null&&n(e,l)))break;e=e[l]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&xt(i)&&Mt(l,i)&&(re(e)||At(e)))}function Qn(e,t){return e!=null&&qn(e,t,Vn)}var Zn=1,Rn=2;function er(e,t){return et(e)&&it(t)?at(Ae(e),t):function(n){var r=Yt(n,e);return r===void 0&&r===t?Qn(n,e):Se(t,r,Zn|Rn)}}function tr(e){return function(t){return t==null?void 0:t[e]}}function nr(e){return function(t){return Kt(t,e)}}function rr(e){return et(e)?tr(Ae(e)):nr(e)}function or(e){return typeof e=="function"?e:e==null?St:typeof e=="object"?re(e)?er(e[0],e[1]):Jn(e):rr(e)}function ir(e,t){return e&&Ot(e,t,qe)}function ar(e,t){return function(n,r){if(n==null)return n;if(!Qe(n))return e(n,r);for(var i=n.length,o=t?i:-1,l=Object(n);(t?o--:++o<i)&&r(l[o],o,l)!==!1;);return n}}var sr=ar(ir);const lr=sr;function dr(e,t){var n=-1,r=Qe(e)?Array(e.length):[];return lr(e,function(i,o,l){r[++n]=t(i,o,l)}),r}function ur(e,t){var n=re(e)?_t:dr;return n(e,or(t))}const xe={top:"bottom",bottom:"top",left:"right",right:"left"},A="var(--n-arrow-height) * 1.414",fr=W([F("popover",`
|
|
transition:
|
|
box-shadow .3s var(--n-bezier),
|
|
background-color .3s var(--n-bezier),
|
|
color .3s var(--n-bezier);
|
|
position: relative;
|
|
font-size: var(--n-font-size);
|
|
color: var(--n-text-color);
|
|
box-shadow: var(--n-box-shadow);
|
|
word-break: break-word;
|
|
`,[W(">",[F("scrollbar",`
|
|
height: inherit;
|
|
max-height: inherit;
|
|
`)]),pe("raw",`
|
|
background-color: var(--n-color);
|
|
border-radius: var(--n-border-radius);
|
|
`,[pe("scrollable",[pe("show-header-or-footer","padding: var(--n-padding);")])]),ve("header",`
|
|
padding: var(--n-padding);
|
|
border-bottom: 1px solid var(--n-divider-color);
|
|
transition: border-color .3s var(--n-bezier);
|
|
`),ve("footer",`
|
|
padding: var(--n-padding);
|
|
border-top: 1px solid var(--n-divider-color);
|
|
transition: border-color .3s var(--n-bezier);
|
|
`),fe("scrollable, show-header-or-footer",[ve("content",`
|
|
padding: var(--n-padding);
|
|
`)])]),F("popover-shared",`
|
|
transform-origin: inherit;
|
|
`,[F("popover-arrow-wrapper",`
|
|
position: absolute;
|
|
overflow: hidden;
|
|
pointer-events: none;
|
|
`,[F("popover-arrow",`
|
|
transition: background-color .3s var(--n-bezier);
|
|
position: absolute;
|
|
display: block;
|
|
width: calc(${A});
|
|
height: calc(${A});
|
|
box-shadow: 0 0 8px 0 rgba(0, 0, 0, .12);
|
|
transform: rotate(45deg);
|
|
background-color: var(--n-color);
|
|
pointer-events: all;
|
|
`)]),W("&.popover-transition-enter-from, &.popover-transition-leave-to",`
|
|
opacity: 0;
|
|
transform: scale(.85);
|
|
`),W("&.popover-transition-enter-to, &.popover-transition-leave-from",`
|
|
transform: scale(1);
|
|
opacity: 1;
|
|
`),W("&.popover-transition-enter-active",`
|
|
transition:
|
|
box-shadow .3s var(--n-bezier),
|
|
background-color .3s var(--n-bezier),
|
|
color .3s var(--n-bezier),
|
|
opacity .15s var(--n-bezier-ease-out),
|
|
transform .15s var(--n-bezier-ease-out);
|
|
`),W("&.popover-transition-leave-active",`
|
|
transition:
|
|
box-shadow .3s var(--n-bezier),
|
|
background-color .3s var(--n-bezier),
|
|
color .3s var(--n-bezier),
|
|
opacity .15s var(--n-bezier-ease-in),
|
|
transform .15s var(--n-bezier-ease-in);
|
|
`)]),P("top-start",`
|
|
top: calc(${A} / -2);
|
|
left: calc(${D("top-start")} - var(--v-offset-left));
|
|
`),P("top",`
|
|
top: calc(${A} / -2);
|
|
transform: translateX(calc(${A} / -2)) rotate(45deg);
|
|
left: 50%;
|
|
`),P("top-end",`
|
|
top: calc(${A} / -2);
|
|
right: calc(${D("top-end")} + var(--v-offset-left));
|
|
`),P("bottom-start",`
|
|
bottom: calc(${A} / -2);
|
|
left: calc(${D("bottom-start")} - var(--v-offset-left));
|
|
`),P("bottom",`
|
|
bottom: calc(${A} / -2);
|
|
transform: translateX(calc(${A} / -2)) rotate(45deg);
|
|
left: 50%;
|
|
`),P("bottom-end",`
|
|
bottom: calc(${A} / -2);
|
|
right: calc(${D("bottom-end")} + var(--v-offset-left));
|
|
`),P("left-start",`
|
|
left: calc(${A} / -2);
|
|
top: calc(${D("left-start")} - var(--v-offset-top));
|
|
`),P("left",`
|
|
left: calc(${A} / -2);
|
|
transform: translateY(calc(${A} / -2)) rotate(45deg);
|
|
top: 50%;
|
|
`),P("left-end",`
|
|
left: calc(${A} / -2);
|
|
bottom: calc(${D("left-end")} + var(--v-offset-top));
|
|
`),P("right-start",`
|
|
right: calc(${A} / -2);
|
|
top: calc(${D("right-start")} - var(--v-offset-top));
|
|
`),P("right",`
|
|
right: calc(${A} / -2);
|
|
transform: translateY(calc(${A} / -2)) rotate(45deg);
|
|
top: 50%;
|
|
`),P("right-end",`
|
|
right: calc(${A} / -2);
|
|
bottom: calc(${D("right-end")} + var(--v-offset-top));
|
|
`),...ur({top:["right-start","left-start"],right:["top-end","bottom-end"],bottom:["right-end","left-end"],left:["top-start","bottom-start"]},(e,t)=>{const n=["right","left"].includes(t),r=n?"width":"height";return e.map(i=>{const o=i.split("-")[1]==="end",s=`calc((${`var(--v-target-${r}, 0px)`} - ${A}) / 2)`,a=D(i);return W(`[v-placement="${i}"] >`,[F("popover-shared",[fe("center-arrow",[F("popover-arrow",`${t}: calc(max(${s}, ${a}) ${o?"+":"-"} var(--v-offset-${n?"left":"top"}));`)])])])})})]);function D(e){return["top","bottom"].includes(e.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function P(e,t){const n=e.split("-")[0],r=["top","bottom"].includes(n)?"height: var(--n-space-arrow);":"width: var(--n-space-arrow);";return W(`[v-placement="${e}"] >`,[F("popover-shared",`
|
|
margin-${xe[n]}: var(--n-space);
|
|
`,[fe("show-arrow",`
|
|
margin-${xe[n]}: var(--n-space-arrow);
|
|
`),fe("overlap",`
|
|
margin: 0;
|
|
`),Bt("popover-arrow-wrapper",`
|
|
right: 0;
|
|
left: 0;
|
|
top: 0;
|
|
bottom: 0;
|
|
${n}: 100%;
|
|
${xe[n]}: auto;
|
|
${r}
|
|
`,[F("popover-arrow",t)])])])}const st=Object.assign(Object.assign({},ie.props),{to:Q.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentStyle:[Object,String],headerStyle:[Object,String],footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number}),hr=({arrowStyle:e,clsPrefix:t})=>x("div",{key:"__popover-arrow__",class:`${t}-popover-arrow-wrapper`},x("div",{class:`${t}-popover-arrow`,style:e})),cr=Z({name:"PopoverBody",inheritAttrs:!1,props:st,setup(e,{slots:t,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:i,inlineThemeDisabled:o}=Ze(e),l=ie("Popover","-popover",fr,Et,e,i),s=_(null),a=X("NPopover"),p=_(null),v=_(e.show),w=_(!1);Re(()=>{const{show:m}=e;m&&!jt()&&!e.internalDeactivateImmediately&&(w.value=!0)});const d=U(()=>{const{trigger:m,onClickoutside:S}=e,O=[],{positionManuallyRef:{value:b}}=a;return b||(m==="click"&&!S&&O.push([ze,B,void 0,{capture:!0}]),m==="hover"&&O.push([rn,I])),S&&O.push([ze,B,void 0,{capture:!0}]),(e.displayDirective==="show"||e.animated&&w.value)&&O.push([Ct,e.show]),O}),c=U(()=>{const m=e.width==="trigger"?void 0:me(e.width),S=[];m&&S.push({width:m});const{maxWidth:O,minWidth:b}=e;return O&&S.push({maxWidth:me(O)}),b&&S.push({maxWidth:me(b)}),o||S.push(g.value),S}),g=U(()=>{const{common:{cubicBezierEaseInOut:m,cubicBezierEaseIn:S,cubicBezierEaseOut:O},self:{space:b,spaceArrow:N,padding:L,fontSize:z,textColor:K,dividerColor:h,color:M,boxShadow:C,borderRadius:k,arrowHeight:T,arrowOffset:dt,arrowOffsetVertical:ut}}=l.value;return{"--n-box-shadow":C,"--n-bezier":m,"--n-bezier-ease-in":S,"--n-bezier-ease-out":O,"--n-font-size":z,"--n-text-color":K,"--n-color":M,"--n-divider-color":h,"--n-border-radius":k,"--n-arrow-height":T,"--n-arrow-offset":dt,"--n-arrow-offset-vertical":ut,"--n-padding":L,"--n-space":b,"--n-space-arrow":N}}),u=o?Tt("popover",void 0,g,e):void 0;a.setBodyInstance({syncPosition:y}),oe(()=>{a.setBodyInstance(null)}),R(j(e,"show"),m=>{e.animated||(m?v.value=!0:v.value=!1)});function y(){var m;(m=s.value)===null||m===void 0||m.syncPosition()}function f(m){e.trigger==="hover"&&e.keepAliveOnHover&&e.show&&a.handleMouseEnter(m)}function $(m){e.trigger==="hover"&&e.keepAliveOnHover&&a.handleMouseLeave(m)}function I(m){e.trigger==="hover"&&!E().contains(Ie(m))&&a.handleMouseMoveOutside(m)}function B(m){(e.trigger==="click"&&!E().contains(Ie(m))||e.onClickoutside)&&a.handleClickOutside(m)}function E(){return a.getTriggerElement()}ee(ke,p),ee(je,null),ee(Ge,null);function Y(){if(u==null||u.onRender(),!(e.displayDirective==="show"||e.show||e.animated&&w.value))return null;let S;const O=a.internalRenderBodyRef.value,{value:b}=i;if(O)S=O([`${b}-popover-shared`,u==null?void 0:u.themeClass.value,e.overlap&&`${b}-popover-shared--overlap`,e.showArrow&&`${b}-popover-shared--show-arrow`,e.arrowPointToCenter&&`${b}-popover-shared--center-arrow`],p,c.value,f,$);else{const{value:N}=a.extraClassRef,{internalTrapFocus:L}=e,z=!Le(t.header)||!Le(t.footer),K=()=>{var h;const M=z?x(Lt,null,ge(t.header,T=>T?x("div",{class:`${b}-popover__header`,style:e.headerStyle},T):null),ge(t.default,T=>T?x("div",{class:`${b}-popover__content`,style:e.contentStyle},t):null),ge(t.footer,T=>T?x("div",{class:`${b}-popover__footer`,style:e.footerStyle},T):null)):e.scrollable?(h=t.default)===null||h===void 0?void 0:h.call(t):x("div",{class:`${b}-popover__content`,style:e.contentStyle},t),C=e.scrollable?x(Dt,{contentClass:z?void 0:`${b}-popover__content`,contentStyle:z?void 0:e.contentStyle},{default:()=>M}):M,k=e.showArrow?hr({arrowStyle:e.arrowStyle,clsPrefix:b}):null;return[C,k]};S=x("div",It({class:[`${b}-popover`,`${b}-popover-shared`,u==null?void 0:u.themeClass.value,N.map(h=>`${b}-${h}`),{[`${b}-popover--scrollable`]:e.scrollable,[`${b}-popover--show-header-or-footer`]:z,[`${b}-popover--raw`]:e.raw,[`${b}-popover-shared--overlap`]:e.overlap,[`${b}-popover-shared--show-arrow`]:e.showArrow,[`${b}-popover-shared--center-arrow`]:e.arrowPointToCenter}],ref:p,style:c.value,onKeydown:a.handleKeydown,onMouseenter:f,onMouseleave:$},n),L?x(zt,{active:e.show,autoFocus:!0},{default:K}):K())}return ce(S,d.value)}return{displayed:w,namespace:r,isMounted:a.isMountedRef,zIndex:a.zIndexRef,followerRef:s,adjustedTo:Q(e),followerEnabled:v,renderContentNode:Y}},render(){return x(cn,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===Q.tdkey},{default:()=>this.animated?x(Pt,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var e;(e=this.internalOnAfterLeave)===null||e===void 0||e.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}}),pr=Object.keys(st),vr={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function gr(e,t,n){vr[t].forEach(r=>{e.props?e.props=Object.assign({},e.props):e.props={};const i=e.props[r],o=n[r];i?e.props[r]=(...l)=>{i(...l),o(...l)}:e.props[r]=o})}const lt={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:Q.propTo,scrollable:Boolean,contentStyle:[Object,String],headerStyle:[Object,String],footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},mr=Object.assign(Object.assign(Object.assign({},ie.props),lt),{internalOnAfterLeave:Function,internalRenderBody:Function}),wr=Z({name:"Popover",inheritAttrs:!1,props:mr,__popover__:!0,setup(e){const t=Je(),n=_(null),r=U(()=>e.show),i=_(e.defaultShow),o=Ut(r,i),l=ne(()=>e.disabled?!1:o.value),s=()=>{if(e.disabled)return!0;const{getDisabled:h}=e;return!!(h!=null&&h())},a=()=>s()?!1:o.value,p=Vt(e,["arrow","showArrow"]),v=U(()=>e.overlap?!1:p.value);let w=null;const d=_(null),c=_(null),g=ne(()=>e.x!==void 0&&e.y!==void 0);function u(h){const{"onUpdate:show":M,onUpdateShow:C,onShow:k,onHide:T}=e;i.value=h,M&&ae(M,h),C&&ae(C,h),h&&k&&ae(k,!0),h&&T&&ae(T,!1)}function y(){w&&w.syncPosition()}function f(){const{value:h}=d;h&&(window.clearTimeout(h),d.value=null)}function $(){const{value:h}=c;h&&(window.clearTimeout(h),c.value=null)}function I(){const h=s();if(e.trigger==="focus"&&!h){if(a())return;u(!0)}}function B(){const h=s();if(e.trigger==="focus"&&!h){if(!a())return;u(!1)}}function E(){const h=s();if(e.trigger==="hover"&&!h){if($(),d.value!==null||a())return;const M=()=>{u(!0),d.value=null},{delay:C}=e;C===0?M():d.value=window.setTimeout(M,C)}}function Y(){const h=s();if(e.trigger==="hover"&&!h){if(f(),c.value!==null||!a())return;const M=()=>{u(!1),c.value=null},{duration:C}=e;C===0?M():c.value=window.setTimeout(M,C)}}function m(){Y()}function S(h){var M;a()&&(e.trigger==="click"&&(f(),$(),u(!1)),(M=e.onClickoutside)===null||M===void 0||M.call(e,h))}function O(){if(e.trigger==="click"&&!s()){f(),$();const h=!a();u(h)}}function b(h){e.internalTrapFocus&&h.key==="Escape"&&(f(),$(),u(!1))}function N(h){i.value=h}function L(){var h;return(h=n.value)===null||h===void 0?void 0:h.targetRef}function z(h){w=h}return ee("NPopover",{getTriggerElement:L,handleKeydown:b,handleMouseEnter:E,handleMouseLeave:Y,handleClickOutside:S,handleMouseMoveOutside:m,setBodyInstance:z,positionManuallyRef:g,isMountedRef:t,zIndexRef:j(e,"zIndex"),extraClassRef:j(e,"internalExtraClass"),internalRenderBodyRef:j(e,"internalRenderBody")}),Re(()=>{o.value&&s()&&u(!1)}),{binderInstRef:n,positionManually:g,mergedShowConsideringDisabledProp:l,uncontrolledShow:i,mergedShowArrow:v,getMergedShow:a,setShow:N,handleClick:O,handleMouseEnter:E,handleMouseLeave:Y,handleFocus:I,handleBlur:B,syncPosition:y}},render(){var e;const{positionManually:t,$slots:n}=this;let r,i=!1;if(!t&&(n.activator?r=De(n,"activator"):r=De(n,"trigger"),r)){r=Ft(r),r=r.type===Nt?x("span",[r]):r;const o={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((e=r.type)===null||e===void 0)&&e.__popover__)i=!0,r.props||(r.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),r.props.internalSyncTargetWithParent=!0,r.props.internalInheritedEventHandlers?r.props.internalInheritedEventHandlers=[o,...r.props.internalInheritedEventHandlers]:r.props.internalInheritedEventHandlers=[o];else{const{internalInheritedEventHandlers:l}=this,s=[o,...l],a={onBlur:p=>{s.forEach(v=>{v.onBlur(p)})},onFocus:p=>{s.forEach(v=>{v.onFocus(p)})},onClick:p=>{s.forEach(v=>{v.onClick(p)})},onMouseenter:p=>{s.forEach(v=>{v.onMouseenter(p)})},onMouseleave:p=>{s.forEach(v=>{v.onMouseleave(p)})}};gr(r,l?"nested":t?"manual":this.trigger,a)}}return x(en,{ref:"binderInstRef",syncTarget:!i,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const o=this.getMergedShow();return[this.internalTrapFocus&&o?ce(x("div",{style:{position:"fixed",inset:0}}),[[Ve,{enabled:o,zIndex:this.zIndex}]]):null,t?null:x(tn,null,{default:()=>r}),x(cr,Ht(this.$props,pr,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:o})),{default:()=>{var l,s;return(s=(l=this.$slots).default)===null||s===void 0?void 0:s.call(l)},header:()=>{var l,s;return(s=(l=this.$slots).header)===null||s===void 0?void 0:s.call(l)},footer:()=>{var l,s;return(s=(l=this.$slots).footer)===null||s===void 0?void 0:s.call(l)}})]}})}}),br=Object.assign(Object.assign({},lt),ie.props),Sr=Z({name:"Tooltip",props:br,__popover__:!0,setup(e){const{mergedClsPrefixRef:t}=Ze(e),n=ie("Tooltip","-tooltip",void 0,Wt,e,t),r=_(null);return Object.assign(Object.assign({},{syncPosition(){r.value.syncPosition()},setShow(o){r.value.setShow(o)}}),{popoverRef:r,mergedTheme:n,popoverThemeOverrides:U(()=>n.value.self)})},render(){const{mergedTheme:e,internalExtraClass:t}=this;return x(wr,Object.assign(Object.assign({},this.$props),{theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:this.popoverThemeOverrides,internalExtraClass:t.concat("tooltip"),ref:"popoverRef"}),this.$slots)}});export{Sr as N,en as V,wr as _,se as a,Q as b,on as c,tn as d,cn as e,qt as f,Ar as i,Jt as o,lt as p,hr as r,Vt as u};
|
|
//# sourceMappingURL=Tooltip-38260d83.js.map
|