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-16 03:10:39 +02:00
|
|
|
export let id: string | undefined = undefined;
|
2021-05-05 01:22:51 +02:00
|
|
|
let className: string = "";
|
2021-04-27 21:01:44 +02:00
|
|
|
export { className as class };
|
|
|
|
|
2021-05-27 17:13:36 +02:00
|
|
|
export let size: number | undefined = undefined;
|
2021-09-02 21:01:29 +02:00
|
|
|
export let wrap: boolean | undefined = undefined;
|
2021-07-21 16:48:02 +02:00
|
|
|
|
2021-05-27 17:13:36 +02:00
|
|
|
$: buttonSize = size ? `--buttons-size: ${size}rem; ` : "";
|
|
|
|
let buttonWrap: string;
|
|
|
|
$: if (wrap === undefined) {
|
|
|
|
buttonWrap = "";
|
|
|
|
} else {
|
|
|
|
buttonWrap = wrap ? `--buttons-wrap: wrap; ` : `--buttons-wrap: nowrap; `;
|
|
|
|
}
|
|
|
|
|
|
|
|
$: style = buttonSize + buttonWrap;
|
2021-03-29 21:48:31 +02:00
|
|
|
</script>
|
|
|
|
|
2022-02-03 05:52:11 +01:00
|
|
|
<div {id} class="button-group btn-group {className}" {style} dir="ltr" role="group">
|
2021-04-27 21:01:44 +02:00
|
|
|
<slot />
|
2021-04-27 17:20:13 +02:00
|
|
|
</div>
|
2021-05-26 01:21:33 +02:00
|
|
|
|
|
|
|
<style lang="scss">
|
2021-11-17 04:49:52 +01:00
|
|
|
.button-group {
|
2021-10-18 14:01:15 +02:00
|
|
|
display: flex;
|
2021-11-17 04:49:52 +01:00
|
|
|
flex-flow: row var(--buttons-wrap);
|
2021-05-26 01:21:33 +02:00
|
|
|
}
|
|
|
|
</style>
|