2021-04-15 15:59:52 +02:00
|
|
|
<!--
|
|
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
-->
|
2021-10-26 00:43:02 +02:00
|
|
|
<script lang="ts">
|
2021-04-28 22:15:24 +02:00
|
|
|
import { setContext } from "svelte";
|
2022-02-04 09:36:34 +01:00
|
|
|
|
2021-06-30 19:55:56 +02:00
|
|
|
import { dropdownKey } from "./context-keys";
|
2021-03-30 18:57:50 +02:00
|
|
|
|
2021-06-30 14:01:33 +02:00
|
|
|
export let id: string | undefined = undefined;
|
2021-06-25 16:44:09 +02:00
|
|
|
let className: string = "";
|
|
|
|
export { className as class };
|
|
|
|
|
2021-06-24 20:41:50 +02:00
|
|
|
export let labelledby: string | undefined = undefined;
|
2021-09-08 19:18:37 +02:00
|
|
|
export let show = false;
|
2021-04-28 22:15:24 +02:00
|
|
|
|
|
|
|
setContext(dropdownKey, null);
|
2021-03-30 18:57:50 +02:00
|
|
|
</script>
|
|
|
|
|
2021-09-15 17:56:56 +02:00
|
|
|
<div
|
|
|
|
{id}
|
|
|
|
class="dropdown-menu"
|
|
|
|
class:show
|
|
|
|
aria-labelledby={labelledby}
|
|
|
|
on:mousedown|preventDefault|stopPropagation
|
|
|
|
>
|
2021-09-08 14:27:46 +02:00
|
|
|
<div class="dropdown-content {className}">
|
2021-06-25 16:44:09 +02:00
|
|
|
<slot />
|
|
|
|
</div>
|
2021-05-26 01:21:33 +02:00
|
|
|
</div>
|
|
|
|
|
2021-04-14 19:36:41 +02:00
|
|
|
<style lang="scss">
|
2021-06-25 16:44:09 +02:00
|
|
|
.dropdown-menu {
|
2021-09-09 15:06:07 +02:00
|
|
|
border-radius: 5px;
|
2021-04-27 17:20:13 +02:00
|
|
|
background-color: var(--frame-bg);
|
2021-04-16 18:14:09 +02:00
|
|
|
border-color: var(--medium-border);
|
2021-08-06 18:21:23 +02:00
|
|
|
min-width: 1rem;
|
2021-04-16 18:14:09 +02:00
|
|
|
}
|
2021-04-14 19:36:41 +02:00
|
|
|
</style>
|