Run prettier over everything and fix some imports

This commit is contained in:
Ryan Gossiaux
2021-12-13 18:22:16 -08:00
parent 3bf974a654
commit 82b138f0ae
63 changed files with 3317 additions and 3319 deletions

View File

@@ -1,29 +1,29 @@
<script lang="ts">
import { usePortalGroupContext } from "./PortalGroup.svelte";
import { usePortalRoot } from "./ForcePortalRootContext.svelte";
import { portal } from "./use-portal";
let forceInRoot = usePortalRoot();
let groupTarget = usePortalGroupContext();
$: target = (() => {
// Group context is used, but still null
if (
!(forceInRoot && $forceInRoot) &&
groupTarget !== undefined &&
$groupTarget !== null
)
return $groupTarget;
import { usePortalGroupContext } from "./PortalGroup.svelte";
import { usePortalRoot } from "$lib/internal/ForcePortalRootContext.svelte";
import { portal } from "$lib/hooks/use-portal";
let forceInRoot = usePortalRoot();
let groupTarget = usePortalGroupContext();
$: target = (() => {
// Group context is used, but still null
if (
!(forceInRoot && $forceInRoot) &&
groupTarget !== undefined &&
$groupTarget !== null
)
return $groupTarget;
// No group context is used, let's create a default portal root
if (typeof window === "undefined") return null;
let existingRoot = document.getElementById("headlessui-portal-root");
if (existingRoot) return existingRoot;
// No group context is used, let's create a default portal root
if (typeof window === "undefined") return null;
let existingRoot = document.getElementById("headlessui-portal-root");
if (existingRoot) return existingRoot;
let root = document.createElement("div");
root.setAttribute("id", "headlessui-portal-root");
return document.body.appendChild(root);
})();
let root = document.createElement("div");
root.setAttribute("id", "headlessui-portal-root");
return document.body.appendChild(root);
})();
</script>
<div use:portal={target}>
<slot />
<slot />
</div>