2021-04-21 14:12:47 +02:00
|
|
|
<script>
|
2021-04-21 14:19:10 +02:00
|
|
|
import "@spectrum-css/buttongroup/dist/index-vars.css"
|
2021-04-21 14:12:47 +02:00
|
|
|
export let vertical = false
|
2021-04-21 14:19:10 +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-04-21 14:19:10 +02:00
|
|
|
<div use:group class="spectrum-ButtonGroup" class:spectrum-ButtonGroup--vertical={vertical}>
|
2021-04-21 14:12:47 +02:00
|
|
|
<slot />
|
|
|
|
</div>
|