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-04-01 16:29:24 +02:00
|
|
|
<script lang="typescript">
|
2021-04-28 22:15:24 +02:00
|
|
|
import { setContext } from "svelte";
|
|
|
|
import { dropdownKey } from "./contextKeys";
|
|
|
|
|
2021-04-01 16:29:24 +02:00
|
|
|
import ButtonGroup from "./ButtonGroup.svelte";
|
|
|
|
|
2021-04-28 22:15:24 +02:00
|
|
|
export let id: string | undefined;
|
|
|
|
let className = "";
|
|
|
|
export { className as class };
|
2021-04-01 16:29:24 +02:00
|
|
|
|
2021-04-28 22:15:24 +02:00
|
|
|
export let api = {};
|
2021-04-01 16:29:24 +02:00
|
|
|
|
2021-04-28 22:15:24 +02:00
|
|
|
setContext(dropdownKey, null);
|
2021-04-01 16:29:24 +02:00
|
|
|
</script>
|
|
|
|
|
2021-04-16 17:14:47 +02:00
|
|
|
<style>
|
2021-04-27 17:20:13 +02:00
|
|
|
:global(.dropdown-menu.btn-dropdown-menu) {
|
2021-04-19 14:47:10 +02:00
|
|
|
display: none;
|
2021-04-16 17:14:47 +02:00
|
|
|
background-color: var(--window-bg);
|
|
|
|
border-color: var(--medium-border);
|
|
|
|
}
|
2021-04-23 22:22:53 +02:00
|
|
|
|
2021-04-27 17:20:13 +02:00
|
|
|
:global(.dropdown-menu.btn-dropdown-menu.show) {
|
2021-04-23 22:22:53 +02:00
|
|
|
display: flex;
|
|
|
|
}
|
2021-04-16 17:14:47 +02:00
|
|
|
</style>
|
|
|
|
|
2021-04-28 22:15:24 +02:00
|
|
|
<ButtonGroup {id} class={`dropdown-menu btn-dropdown-menu ${className}`} {api}>
|
|
|
|
<slot />
|
|
|
|
</ButtonGroup>
|