2021-04-21 14:12:47 +02:00
|
|
|
<script>
|
2021-05-04 12:04:42 +02:00
|
|
|
import "@spectrum-css/buttongroup/dist/index-vars.css"
|
|
|
|
export let vertical = false
|
2021-04-21 14:19:10 +02:00
|
|
|
|
2021-05-04 12:04:42 +02:00
|
|
|
function group(element) {
|
|
|
|
const buttons = Array.from(element.getElementsByTagName("button"))
|
|
|
|
buttons.forEach((button) => {
|
|
|
|
button.classList.add("spectrum-ButtonGroup-item")
|
|
|
|
})
|
|
|
|
}
|
2021-04-21 14:12:47 +02:00
|
|
|
</script>
|
|
|
|
|
2021-05-04 12:04:42 +02:00
|
|
|
<div
|
|
|
|
use:group
|
|
|
|
class="spectrum-ButtonGroup"
|
|
|
|
class:spectrum-ButtonGroup--vertical={vertical}
|
|
|
|
>
|
|
|
|
<slot />
|
|
|
|
</div>
|