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";
|
2021-06-30 19:55:56 +02:00
|
|
|
import { dropdownKey } from "./context-keys";
|
2021-04-28 22:15:24 +02:00
|
|
|
|
2021-05-06 23:04:38 +02:00
|
|
|
import ButtonToolbar from "./ButtonToolbar.svelte";
|
2021-04-01 16:29:24 +02:00
|
|
|
|
2021-06-30 14:01:33 +02:00
|
|
|
export let id: string | undefined = undefined;
|
2021-04-28 22:15:24 +02:00
|
|
|
let className = "";
|
|
|
|
export { className as class };
|
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>
|
|
|
|
|
2022-02-03 05:52:11 +01:00
|
|
|
<ButtonToolbar {id} class="dropdown-menu btn-dropdown-menu {className}" wrap={false}>
|
2021-10-18 14:01:15 +02:00
|
|
|
<div on:mousedown|preventDefault|stopPropagation on:click>
|
2021-09-15 17:56:56 +02:00
|
|
|
<slot />
|
|
|
|
</div>
|
2021-05-27 17:13:36 +02:00
|
|
|
</ButtonToolbar>
|
2021-05-26 01:21:33 +02:00
|
|
|
|
2021-05-06 23:04:38 +02:00
|
|
|
<style lang="scss">
|
2021-09-15 17:56:56 +02:00
|
|
|
div {
|
|
|
|
display: contents;
|
|
|
|
}
|
|
|
|
|
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-05-06 23:04:38 +02:00
|
|
|
min-width: 0;
|
2021-05-27 17:13:36 +02:00
|
|
|
padding: calc(var(--buttons-size) / 10) 0;
|
2021-05-06 23:04:38 +02:00
|
|
|
|
2021-04-16 17:14:47 +02:00
|
|
|
background-color: var(--window-bg);
|
|
|
|
border-color: var(--medium-border);
|
2021-05-06 23:04:38 +02:00
|
|
|
|
|
|
|
:global(.btn-group) {
|
|
|
|
position: static;
|
|
|
|
}
|
2021-04-16 17:14:47 +02:00
|
|
|
}
|
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>
|