You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
3.4 KiB
1 lines
3.4 KiB
import{c as a}from"./context-KbjOeZY_.js";import{J as p,F as x,$ as m,d as y,O as I,c as $,G as b,a2 as z}from"./index-bVOhw2NF.js";import{u as Z}from"./use-false-until-truthy-BNJRTcsy.js";import{b as o,s as g}from"./light-Cua7cqmF.js";const K=a("n-modal-body"),T=a("n-modal-provider"),A=a("n-modal"),q=a("n-drawer-body"),C=a("n-popover-body");function l(s,t,n="default"){const e=t[n];if(e===void 0)throw new Error(`[vueuc/${s}]: slot[${n}] is empty.`);return e()}function c(s,t=!0,n=[]){return s.forEach(e=>{if(e!==null){if(typeof e!="object"){(typeof e=="string"||typeof e=="number")&&n.push(p(String(e)));return}if(Array.isArray(e)){c(e,t,n);return}if(e.type===x){if(e.children===null)return;Array.isArray(e.children)&&c(e.children,t,n)}else e.type!==m&&n.push(e)}}),n}function F(s,t,n="default"){const e=t[n];if(e===void 0)throw new Error(`[vueuc/${s}]: slot[${n}] is empty.`);const r=c(e());if(r.length===1)return r[0];throw new Error(`[vueuc/${s}]: slot[${n}] should have exactly one child.`)}function w(s,t){console.error(`[vdirs/${s}]: ${t}`)}class E{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(t,n){const{elementZIndex:e}=this;if(n!==void 0){t.style.zIndex=`${n}`,e.delete(t);return}const{nextZIndex:r}=this;e.has(t)&&e.get(t)+1===this.nextZIndex||(t.style.zIndex=`${r}`,e.set(t,r),this.nextZIndex=r+1,this.squashState())}unregister(t,n){const{elementZIndex:e}=this;e.has(t)?e.delete(t):n===void 0&&w("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:t}=this;t||(this.nextZIndex=2e3),this.nextZIndex-t>2500&&this.rearrange()}rearrange(){const t=Array.from(this.elementZIndex.entries());t.sort((n,e)=>n[1]-e[1]),this.nextZIndex=2e3,t.forEach(n=>{const e=n[0],r=this.nextZIndex++;`${r}`!==e.style.zIndex&&(e.style.zIndex=`${r}`)})}}const d=new E,i="@@ziContext",L={mounted(s,t){const{value:n={}}=t,{zIndex:e,enabled:r}=n;s[i]={enabled:!!r,initialized:!1},r&&(d.ensureZIndex(s,e),s[i].initialized=!0)},updated(s,t){const{value:n={}}=t,{zIndex:e,enabled:r}=n,u=s[i].enabled;r&&!u&&(d.ensureZIndex(s,e),s[i].initialized=!0),s[i].enabled=!!r},unmounted(s,t){if(!s[i].initialized)return;const{value:n={}}=t,{zIndex:e}=n;d.unregister(s,e)}},M=y({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(s){return{showTeleport:Z(I(s,"show")),mergedTo:$(()=>{const{to:t}=s;return t??"body"})}},render(){return this.showTeleport?this.disabled?l("lazy-teleport",this.$slots):b(z,{disabled:this.disabled,to:this.mergedTo},l("lazy-teleport",this.$slots)):null}}),{cubicBezierEaseIn:f,cubicBezierEaseOut:h}=g;function V({transformOrigin:s="inherit",duration:t=".2s",enterScale:n=".9",originalTransform:e="",originalTransition:r=""}={}){return[o("&.fade-in-scale-up-transition-leave-active",{transformOrigin:s,transition:`opacity ${t} ${f}, transform ${t} ${f} ${r&&`,${r}`}`}),o("&.fade-in-scale-up-transition-enter-active",{transformOrigin:s,transition:`opacity ${t} ${h}, transform ${t} ${h} ${r&&`,${r}`}`}),o("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${e} scale(${n})`}),o("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${e} scale(1)`})]}export{M as L,K as a,T as b,F as c,q as d,V as f,l as g,A as m,C as p,L as z};
|