1 |
- {"version":3,"file":"teleport.mjs","names":["computed","warn","IN_BROWSER","useTeleport","target","teleportTarget","_target","value","undefined","targetElement","document","body","querySelector","container","createElement","className","appendChild"],"sources":["../../src/composables/teleport.ts"],"sourcesContent":["// Utilities\nimport { computed, warn } from 'vue'\nimport { IN_BROWSER } from '@/util'\n\n// Types\nimport type { Ref } from 'vue'\n\nexport function useTeleport (target: Ref<boolean | string | Element>) {\n const teleportTarget = computed(() => {\n const _target = target.value\n\n if (_target === true || !IN_BROWSER) return undefined\n\n const targetElement =\n _target === false ? document.body\n : typeof _target === 'string' ? document.querySelector(_target)\n : _target\n\n if (targetElement == null) {\n warn(`Unable to locate target ${_target}`)\n return undefined\n }\n\n let container = targetElement.querySelector(':scope > .v-overlay-container')\n\n if (!container) {\n container = document.createElement('div')\n container.className = 'v-overlay-container'\n targetElement.appendChild(container)\n }\n\n return container\n })\n\n return { teleportTarget }\n}\n"],"mappings":"AAAA;AACA,SAASA,QAAQ,EAAEC,IAAI,QAAQ,KAAK;AAAA,SAC3BC,UAAU,6BAEnB;AAGA,OAAO,SAASC,WAAWA,CAAEC,MAAuC,EAAE;EACpE,MAAMC,cAAc,GAAGL,QAAQ,CAAC,MAAM;IACpC,MAAMM,OAAO,GAAGF,MAAM,CAACG,KAAK;IAE5B,IAAID,OAAO,KAAK,IAAI,IAAI,CAACJ,UAAU,EAAE,OAAOM,SAAS;IAErD,MAAMC,aAAa,GACjBH,OAAO,KAAK,KAAK,GAAGI,QAAQ,CAACC,IAAI,GAC/B,OAAOL,OAAO,KAAK,QAAQ,GAAGI,QAAQ,CAACE,aAAa,CAACN,OAAO,CAAC,GAC7DA,OAAO;IAEX,IAAIG,aAAa,IAAI,IAAI,EAAE;MACzBR,IAAI,CAAE,2BAA0BK,OAAQ,EAAC,CAAC;MAC1C,OAAOE,SAAS;IAClB;IAEA,IAAIK,SAAS,GAAGJ,aAAa,CAACG,aAAa,CAAC,+BAA+B,CAAC;IAE5E,IAAI,CAACC,SAAS,EAAE;MACdA,SAAS,GAAGH,QAAQ,CAACI,aAAa,CAAC,KAAK,CAAC;MACzCD,SAAS,CAACE,SAAS,GAAG,qBAAqB;MAC3CN,aAAa,CAACO,WAAW,CAACH,SAAS,CAAC;IACtC;IAEA,OAAOA,SAAS;EAClB,CAAC,CAAC;EAEF,OAAO;IAAER;EAAe,CAAC;AAC3B"}
|